Multiple level generation when descending using wizard mode command can lead to undefined behavior

Issue #277 new
Elias Erkamo created an issue

It appears that when multiple dungeon levels are generated without the player character acting inbetween, some creature data is not cleared properly between creature initializations and carries over between generated creatures. This can carry over even between different runs started in the same session (so long as the player character does not take any action, which seems to clear it), and causes entries in Monster.Creature.Acts arrays to stack up over level generations, which eventually causes the array to overflow, leading to an assert failure (line 1154 of Creature.h). It also seems like it might have a potential to cause unintended behavior by the monster AI during monster initialization.

It’s unclear whether this is caused by a general problem within level generation that is merely exacerbated by use of the wizard mode ascend / descend command, or if the required sequence is only possible through the use of that wizard mode command (since it allows the player to descend without any time passing). In any case, even when using the wizard mode command, many levels can be generated before enough bad data to cause the assert failure accumulates, so the issue seems unlikely to interrupt normal gameplay.

Comments (0)

  1. Log in to comment