Now granted this is random I didn't like the fact that the rooms where always squares and rectangles. What if I wanted to make a L-shaped room bend around another room? Also the way I did this was just making a text room and fill it in the map buffer. The only way I could add doors and or corridors within these maps would be constant rereading of the map to find plausible places for doors and cooridors.
So I created a Room class that holds tokens. Tokens will be the connectors from one map to another, doors from one room to another, and other special events that can happen in a map. Maybe a pit? A treasure chest that holds items? And the Tokens placement within the room. I am planning on adding scripts in Eracia later on, each room could hold multiple scripts, storyline, and epic battles.
The Room class will have an ID in the map it is within and the door tokens will tell the map which room the player is within. This could help intelligent Monsters "hear" the player and run to stop our hero from achieving victory. I could also add path nodes within each Room, so these intelligent monsters will know exactly where to go to stop our "noisy" hero. The possibilities are endless! /brainstormThis is Plan B generation idea. Start with one room givae it an ID of 1 and add the connector token from the map to the new one. Place the Player Start token there so the Player don't start at 0, 0 or whatever other placement on last map was. Maybe add some random items and or Monsters. Now find a random place on the map, give it a shape add some noise to it so its not a perfect square or rectangle and place it in the map. Write down some coordinates where its walls are and find a wall to place a door token. Create another room with the door token from Room 1 and give it ID 2, again maybe add some random items or Monsters, maybe have it bend around room one? Maybe create another Room to bend around Room 1? Or maybe start at Room 1 again and go another way?
That is my next approach to this. I hope to work on this tonight and have it finished by Monday.