I now have my map’s critical path being laid out using valid entrance and exit routes for each room.
The white dots on each square represent that room’s possible entrance/exit points.Adjacent rooms need to have connecting entrance and exit points in order to be placed.
You can think of them like doors. Basically every time I want to place a room, I make sure that the current room can connect to the door of the previous room. I added the red line in Photoshop to illustrate the path that’s created.
My next step is to randomly add rooms adjacent to rooms that have other possible exit points that aren’t along the critical path. Then I will add rooms randomly to those new rooms and so on until I can’t spawn any more rooms.
These additional rooms may or may not loop back onto the critical path. I don’t care if they do, as long as I have guaranteed that the player can reach the end of the map. At some point later, I’ll programmatically make some of these rooms contain loot for the player, this will encourage them to wander the whole level even if they figured out the shortest path to the end.