Dev-Log: Procedural Map Generation



Hello everyone!

I've been working on the sequel. My first aim is to create a basic gameplay loop so I can test out the new game mechanics like I've shared some of them in the previous article. I've done some basics like human shaders and player movement. Then I've moved on to map generation. I wanted to post something. Anything. So I decided to write about the system I'm currently working on.

Well, the map in the DoubleMe feels kinda the same. To help fix that problem, I've turned to procedural generation. Here's a simple graph of what the algorithm does first (Sorry for the paint art):

The idea is the have handmade sections. Then generator creates rotated (90-180-270) and flipped (X - Y - XY) versions of those sections. Flipping a section does not equal to rotating 180 degrees. Now we have a palette and start generating.

The generator starts with a randomly selected root section. All sections have connections (The doors in the graph). The generator starts spawning sections for each of the root's connections. Then it does the same with newly spawned sections. And goes on and on until the section limit is reached. There are some requirements and checks to be made: collision, connection direction, limits, etc. If you want the technical details of how the algorithm works, write in the comments. Even with a simple 3 sections, it can generate quite a variety. These are the sections used in the video below: 

And here are some top-down outputs:


Now, these 3 sections are PLACEHOLDERS. Meaning they probably won't be in the game. I've made them just to test and develop the algorithm. There will be more open area sections along with the closed ones. Also, these placeholder sections look like they're from a prison. The map theme will be different this time. They're also only 3 sections in the palette so that's why it still kinda looks similar. I'll be making more of them with the designated theme. Also, never mind the doors leading to skybox. They will be closed with a secondary pass.

After this generation generator then tells each section to generate their props. These are things like boxes, walls, and lights. Solid props like walls really change the design of the section so makes things fresh since generated sections will look and play differently even though they're coming from the same section.

As I said, it kinda looks similar because I use such a tiny palette of 3 sections. I'll be making new sections with the new map theme. I'll post the update when it's ready so look out for that!

Get DoubleMe

Leave a comment

Log in with itch.io to leave a comment.