Random Map Generation

You want people to enjoy playing your game multiple times.

You don’t want your game to become stale and boring where what happens next is super predictable or the steps to beat your opponent are scripted. Sure you want strategy, but you want the strategy to have to be adaptable.

In multiplayer games, often the opponents unpredictability will keep your game feeling like a fresh experience every play through. But sometimes you want to spice it up just a little bit more, so you add in some randomness.

Map Randomness

Today I was continuing my journey in Unreal Engine development and the particular tutorial I was watching was creating a random map for the turn based strategy game.

There are several ways of generating a random dungeon or map for your game with rooms and corridors but today I want to talk about a simple couple of methods called Quad Trees and Binary Space Provisioning (BSP).

Quad Trees and BSP are basically the same idea.

In Quad Trees you take a rectangular area and divide it into 4 randomly sized smaller rectangles. You then take each of the 4 smaller rectangles and divide them into 4 randomly sized smaller rectangles. Keep going until you have rectangles about the size that you want.

For Binary Space Provisioning you do the exact same thing except you only divide each space into 2 smaller rectangles at a time. You then divide each of those 2 smaller rectangles into 2 more rectangles. Again, keep going until you have rectangles about the size that you want.

You can then use whatever rules you want to choose which of the rectangles you created become rooms by limiting size, combining rectangles, keeping rooms a certain distance apart, etc.

After that come up with some ways to connect the rooms either directly or indirectly. And voila, you have a random map.

Keep getting wiser, stronger, and better.

I Want to Be a Better Developer