Floor generation used to crash, but does no longer


As one might have noticed, there was a chance - something like 1 in 50 - that starting a floor would essentially crash the game. That's fixed now, but I for some reason want to talk a bit about why that was happening in the first place.

When TBOE generates a floor, it sends around this "walker" from one space to another, reserving rooms as it goes, leaving a trail of reservations in its wake. and once it's reserved a certain number of rooms it then reserves an item room and an exit room. Finally, every reservation is turned into an actual room.

When the walker goes around, there's a chance that it will not just keep going and instead 'teleport' back to a previous room and branch off from there. that way the level doesn't end up just being a big snake shape. And how that's done is it grabs a list of all the rooms that exist, picks one at random and goes there. That, right there, is the source of this crash. because it flat out didn't work. grabbing a list of the rooms that exist will do nothing if all we have are reservations and no rooms yet. Remember, the reservations are turned into rooms only in the final step.

This usually doesn't matter, the walker just doesn't teleport back and keeps on going. BUT, in rare situations it would walk in a spiral shape such that all four adjacent rooms, left, right, up and down, all of these are already reserved. At that point the walker is trapped and has nowhere to go. And the above teleport is broken so it can't do that. so it just stands there forever, trying to find somewhere to go. but there's nowhere to go.

anyway once I understood that, easy fix. just make it possible to teleport to reservations instead of just rooms, and to make sure I generated a thousand floors in quick succession, no crash, prob solved.

Files

tboe_lnx.zip 46 MB
Jan 21, 2024
tboe_win.zip 46 MB
Jan 21, 2024
tboe_web.zip Play in browser
Jan 21, 2024

Get The Bondage of Eliza

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.