So, I would like to see one of us design a working random map generator for the Game Jam. Below is sort of minimum requirements from my perspective. This is all open to change based on what we want corporately.
- It needs to include passages and rooms created at random.
- All rooms and passages should connect to the greater map. IE no islands of passages/rooms that cannot be accessed.
- Some dead end passages are fine.
- There should always be at least 2 stairs up and down. (Maybe the minimum number can change, but there needs to be at least one.)
- Items and staircases should be allowed to be placed at random by the map generator. IE occaionally a random item or staircase should be generated in a corridor.
- Special rooms should be designed that the map generator can pull from instead of making all rooms simple rectangles.
- Special rooms should have a way of designating a weight to how often they are placed on a map. This way they appear infrequently and are excited to play through.
- Special rooms should have mechanisms to encourage items and other creatures to appear in them. Some random chance should still apply.
Implementation
I was thinking, we could design special rooms in a text document that was parsed by the game and consumed by the mapmaker. This is actually how Angband creates its maps, so not an original idea.
See below for some examples of what could be in the rooms list.
Each room would require some metadata:
- Name, more for us to talk about which room than the game caring.
- Rarity value to determine how often the room is placed when compared to another room. From 0 to 9, with 9 being exceptionally rare and 0 being placed often.
- Value Modifier: The percent chance of getting a more valuable item in the room. 0 would be the same as any tunnel on the level. 9 would be items in the room will often be exceptionally more valuable than expected on the level.
Name: Basic Room
Rarity: o
Value Modifier: 1
##%%%##
#.....#
%.....%
#.....#
##%%%##
- Hash tags are walls
- Periods are normal floor
- % signs are designated for the map maker to know where a passage from a tunnel to the special room is allowed. These could just be a 50/50 chance of having an actual door or just being an open connection from the room to the passage.
Name: Room With Closet
Rarity: 3
Value Modifier: 4
##%%%##
#.....#
%.###.%
%.#3#.%
%.#+#.%
#.....#
##%%%##
- + signs would be designated mandatory doors.
- We could use numbers in the map for designating places with increased chance of having items and characters. 0 being only slightly better than the ambient scatter of items and 9 being almost guaranteed an item. This could also be connected to the value of the item.
Feedback
There are probably a lot of ways to create a random level generator. Curious for feedback on this method. Perhaps this is ambitious to complete for a one day challenge.