tmewett / BrogueCE

Brogue: Community Edition - a community-lead fork of the much-loved minimalist roguelike game
https://sites.google.com/site/broguegame/
GNU Affero General Public License v3.0
1.03k stars 109 forks source link

Redo the level if stairs cannot be placed #635

Closed flend closed 11 months ago

flend commented 11 months ago

Rapid Brogue seed 519 cannot place stairs in level 2 since there are no qualifying squares (basically every square is part of a machine). This patch rerolls the level when this (very rare) case occurs.

nstoddard commented 11 months ago

Does this fix #536 too?

flend commented 11 months ago

Does this fix #536 too?

Yes, I didn't know the issue existed but I recreated the crash on v1.13 release and this patch fixes it. The discussion in the ticket is interesting and you could make the machine-placing code more complex to avoid eating up all the level but I think this solution should be added in any case: it's more general and in-line with usual roguelike procgen practices.