Chaosforge Forum

DoomRL => Bug Reports => Topic started by: AStranger on June 04, 2011, 18:00

Title: [0.9.9.3] (Linux) Too many enemies cause odd behaviors
Post by: AStranger on June 04, 2011, 18:00
While trying to re-obtain the elite diamond badge (lost the first during a power outage, eventually got it again) I ended up generating way too many mobs in the City of Skulls. Here is a screenshot of the ordeal:
Spoiler (click to show/hide)

Now if you look closely you'll notice two players on the screen. Apparently after enough mobs get generated the player gets duplicated, but it doesn't stop there. After a bit more mobs get spawned is the point where a good number of the mobs just stop moving altogether. Unfortunately it's really hard to tell if it is the new mobs that don't get to move or if it is the old ones, but I think it's the new ones that get frozen in time.

So I made a sandbox level to try to show the bug in action and it just got weirder:
Spoiler (click to show/hide)

After starting this map and rocketing to level 19 you can walk around and see multiple copies of the player. Sure enough if you hurt one of them you do get hurt. Then you quit and the mortem says 'He killed 254 out of 1198 hellspawn. (21%)', which doesn't seem correct because of 'Level.summon("arch", 1400)' and the fact that all of them get killed. If you comment out the 'Level.nuke()' line then walk around killing archviles by hand you'll notice that none of them move. Pay close enough attention and you'll also notice that when you kill a vile other viles around the level die too. This implies that not every vile is unique and they are linked somehow.

So now I started poking around at which point certain flaws became exposed and here is what I got:
Spoiler (click to show/hide)

My guess is that the extra players are tied to the size of byte somehow, but I haven't a clue with the mobs freezing. Hopefully this will help locate the bug.
Title: Re: [0.9.9.3] (Linux) Too many enemies cause odd behaviors
Post by: tehtmi on June 04, 2011, 18:18
Wow, this is a good analysis of the bug.  I think I can explain a bit more.  Probably when dropping beings past 256, only the low 8 bits are used, and a being that is already on the map is dropped on to the map at a new place (well, that doesn't quite match your report, but it seems the right basic idea).  Any being can be on the map in two places, but it will only consider itself to be in one of those places internally.  The AI will treat the being as if it is at the "internal" location, but attacks to any of the locations can still hurt and kill the being.  Not sure what would cause all mobs to freeze.  Actually, I suspect this is not too hard to fix though.

And for farming lost souls for berserk, my rule of thumb is three-four pain elementals or agony + 2-3. (;

Edit: I forgot you like to get blademaster.  I guess you could handle more then...
Title: Re: [0.9.9.3] (Linux) Too many enemies cause odd behaviors
Post by: ParaSait on June 04, 2011, 20:13
Just sayin: up to 384 until they freeze may seem like a totally random amount, but it's not. 384 - 256 = 128...
Title: Re: [0.9.9.3] (Linux) Too many enemies cause odd behaviors
Post by: thelaptop on June 04, 2011, 23:01
I think we need to add the "make numbers bigger than 255 damnit" to the list of things that need resolution by 0.9.9.4.
Title: Re: [0.9.9.3] (Linux) Too many enemies cause odd behaviors
Post by: raekuul on June 05, 2011, 06:55
Since there's no way we'd be able to fit 65535 monsters on the map, this is probably going to be resolved in the same way that HP was changed around 0.9.9.1 or thereabouts.
Title: Re: [0.9.9.3] (Linux) Too many enemies cause odd behaviors
Post by: Ander Hammer on June 09, 2011, 09:47
Ooooh, voodoo dolls.

Would be kind of a neat concept for special levels...