Well, I'm planning on creating a traditional dungeon-crawling game, in which the map will randomly generate itself, choosing randomly from a list of pre-built rooms. Now, here's my plan for doing this:
I make a series of rooms, each with between 2-4 exits. Since I know that making it randomly choose a room when going through an exit can attach a north and an east exit, or something equally disorienting, I figure that I micro-manage each room so that each individual exit chooses from a list of rooms that have an exit that is in line with it, i.e. east lines with west, north with south. In my mind, by doing this, it will build a coherent and easily-followed path in which backtracking won't become a pain for the player.
There will be seven floors, with a boss guarding the exit to the next floor. Now, in order to make sure that the first floor doesn't exit to the fifth, which exits to the second, and so on, I figure that I would make several copies of the list of rooms, each one for a specific floor, and with a bit more tweaking, make it so only floor-one rooms seek floor-one rooms, and et cetera.
Now, I am fairly certain that I know how to do this. It would involve making the rooms first, with the exits that run if-then scripts to randomly select a room (i.e. 50% chance to enter a hallway, 50% chance to enter a boss fight).
But here's my dilemma. If there's only one room of each type per floor list (i.e. one floor-one hallway, one floor-one corner, etc...), and the game randomly chooses a room already in use, it will modify the exits of that room, and therefore make backtracking hell, which is not what I want. Now, I figure making several copies of the same room for each floor, while not very convenient, might work. Also, making each if-then script check for a boolean attribute that each room has which defines the room as "in-use" may help so that it doesn't use a room currently in use.
But another dilemma is the backtracking itself. What is stopping the game from randomly choosing another room when I go through the exit I just came through. I don't want it so that I enter an intersection from a hallway, turn around, go through the same exit and then enter the final boss room. I want a definite build so that the player can backtrack and follow alternate paths. This is where I am at a loss for ideas.
So how to I keep the rooms from constantly shifting behind the player? Any help would be appreciated.