RunMap generation algorithm #31
Loading…
Reference in a new issue
No description provided.
Delete branch "run-map-generation-algorithm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current run map generation algorithm is:
Take a grid of a set length and width
Make a "source" at row -1, and a "sink" at row gridHeight + 1. These are the start and end points of a map
Begin a configurable number of random walks at row 0. Each random walk increases its row index by 1, and either moves left, stays in the same column, or moves right. Every place this walk touches is a room.
A single walk never branches, but you can get a situation like this that looks branch-y:
The branches both lead to the same room, and there is no notion of "walk A's version of the room and walk B's version of the room."
Random decisions are made with a seed. We should use the same seed for everything having to do with randomness, to make it possible to debug problems more easily.
Right now, the map is visualized with an ASCII debug readout. I will make it viewable in game now that I feel like I understand the algorithm a bit and have the underlying algorithm seemingly working. Next steps are that visualization in-game and also adding different types of rooms, rather than just "room or not room".
a5129bc5ebtod70c4b3bd0