4 ms·
In high school I got half of my class to procedurally generate dungeon maps using simple rules and neighbouring cell populations. Example ruleset: - Rooms
by kroltan 4y ago
In high school I got half of my class to procedurally generate dungeon maps using simple rules and neighbouring cell populations.
Example ruleset:
- Rooms are rectangles 3 to 6 cells large in either direction. Place them randomly with a gap of 1 cell until there are no more valid room locations.
- If a cell is between two rooms, and has a cell between the same two rooms on either side of the cross axis between the rooms, then it can be a door, but only if there is no door connecting this pair of rooms yet.
- If an empty cell is in a corner, and there is a door 2 less than 2 cells away from it, then it is a torch.
- If an empty cell has 2 cells distance to any walls, then it is a table(-like decoration).
- If an empty cell is directly adjacent to a table-like decoration, it has a 50% chance of being a seat;
This will generate a lot of dimly lit mess halls, but the actual rulesets would be larger and evolve through time, we would start anew once someone made too many mistakes.