You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.
keyword_oil_drum_spreeresolution_fixedtype_bug | by CorvusCorax
In a multiplayer game, once the game is created, multiGameInit() will call campInit(), where the host will place PLAYER_COUNT *2 oil drums randomly on the map:
if such a drum (or in fact any oil drum on the map) gets picked up, a new oil drum will be randomly placed on the map
move.c: #2912
static void checkLocalFeatures(DROID *psDroid)
{
SDWORD i;
BASE_OBJECT *psObj;
// only do for players droids.
if(psDroid->player != selectedPlayer)
{
return;
}
droidGetNaybors(psDroid);// update naybor list.
// scan the neighbours
for(i=0; i<(SDWORD)numNaybors; i++)
{
#define DROIDDIST (((TILE_UNITS*5)/2) * ((TILE_UNITS*5)/2))
psObj = asDroidNaybors[i].psObj;
if ( psObj->type != OBJ_FEATURE
|| ((FEATURE *)psObj)->psStats->subType != FEAT_OIL_DRUM
|| asDroidNaybors[i].distSqr >= DROIDDIST )
{
// object too far away to worry about
continue;
}
if(bMultiPlayer && (psObj->player == ANYPLAYER))
{
giftPower(ANYPLAYER,selectedPlayer,true); // give power
CONPRINTF(ConsoleString,(ConsoleString,_("You found %u power in an oil drum."),OILDRUM_POWER));
addOilDrum(1);
}
else
{
addPower(selectedPlayer,OILDRUM_POWER);
CONPRINTF(ConsoleString,(ConsoleString,_("You found %u power in an oil drum"),OILDRUM_POWER));
}
removeFeature((FEATURE*)psObj); // remove artifact+ send multiplay info.
}
}
checkLocalFeatures() gets called any time a droid moved, so if any droid moves near an oil drum it gets picked up, a destroy message is sent on the network, but before that addOilDrum(1) is called which will place one new oildrum on the map, too. And inform all other players about it.
Now imagine the beforementioned cramped map. Theres almost no free space on the map, except in the middle, where 8 players armies are battling it out.
Right in the middle of a battlefield is a bad place for an oil drum to magically appear though!
Why?
Because the next cycle after it appeared, multiple players might have droids near it.
(it doesn't matter if they are on the same team or not)
Each of them will claim it the next cycle after they received that notification, since the droids are moving. Then subsequently send an obj removal notification to all the others, as well as place one new oil drum on the map.
So For each nearby player, one new oildrum is placed on the map.
But remember, we said the map was cramped, so at least one of these oil drums ends up in the midst of a pulk of units again!
And gets magically duplicated...
This is almost like sharing movies on PirateBay. I can have it, and you can have it too, and then we give copies to others!
It didn't take long with 8 players on the attached map, and we couldn't build a single building anymore because everything was full of oil drums. And that was at the time when we barely had reached ripples. Oil drums spawned faster than we could pick them up and I got these errors galore:
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,14)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (7,39)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (9,11)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (6,12)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (16,23)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (8,12)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,24)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (16,22)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (16,25)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,22)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,25)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (16,26)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,14)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,26)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (20,12)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (16,27)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,27)!
error |08:07:43: [recvMultiPlayerRandomArtifacts] Already something at (15,25)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (15,23)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (16,24)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (16,23)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (16,21)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (16,25)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (15,23)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (15,24)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (15,25)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (8,11)!
error |08:07:44: [recvMultiPlayerRandomArtifacts] Already something at (16,26)!
...
In a single player game (as in against AI) this is not reproducable, since AI doesn't pick up oil drums. So the exponential growth never gets started.
Note, the exact resoning to why the oildrums multiply is a guess. I might have it wrong. All I know is,
we reached peak oil!
;) scnr
Issue migrated from trac:2174 at 2022-04-16 06:37:44 -0700
The text was updated successfully, but these errors were encountered:
keyword_oil_drum_spree
resolution_fixed
type_bug
| by CorvusCoraxIn a multiplayer game, once the game is created, multiGameInit() will call campInit(), where the host will place PLAYER_COUNT *2 oil drums randomly on the map:
if such a drum (or in fact any oil drum on the map) gets picked up, a new oil drum will be randomly placed on the map
checkLocalFeatures() gets called any time a droid moved, so if any droid moves near an oil drum it gets picked up, a destroy message is sent on the network, but before that addOilDrum(1) is called which will place one new oildrum on the map, too. And inform all other players about it.
Now imagine the beforementioned cramped map. Theres almost no free space on the map, except in the middle, where 8 players armies are battling it out.
Right in the middle of a battlefield is a bad place for an oil drum to magically appear though!
Why?
Because the next cycle after it appeared, multiple players might have droids near it.
(it doesn't matter if they are on the same team or not)
Each of them will claim it the next cycle after they received that notification, since the droids are moving. Then subsequently send an obj removal notification to all the others, as well as place one new oil drum on the map.
So For each nearby player, one new oildrum is placed on the map.
But remember, we said the map was cramped, so at least one of these oil drums ends up in the midst of a pulk of units again!
And gets magically duplicated...
This is almost like sharing movies on PirateBay. I can have it, and you can have it too, and then we give copies to others!
It didn't take long with 8 players on the attached map, and we couldn't build a single building anymore because everything was full of oil drums. And that was at the time when we barely had reached ripples. Oil drums spawned faster than we could pick them up and I got these errors galore:
In a single player game (as in against AI) this is not reproducable, since AI doesn't pick up oil drums. So the exponential growth never gets started.
Note, the exact resoning to why the oildrums multiply is a guess. I might have it wrong. All I know is,
we reached peak oil!
;)
scnr
Issue migrated from trac:2174 at 2022-04-16 06:37:44 -0700
The text was updated successfully, but these errors were encountered: