What is a good approach for room generation?

Hello! I’m making a horror game inspired by DOORS and other similar games like Pressure, but with some new mechanics.

I’ve hit a roadblock generating the rooms, so I’ve decided to redo the room generation from scratch. I will include overlap protection so the game doesn’t generate impossible routes. I will also implement props and entity nodes later.

My current system uses ModuleScripts to give a “biome” some configuration, like door types, rooms, and their weights. Rooms contain two main parts, one for the Entrance and the other for the Exit.

Any suggestions are greatly appreciated, along with any examples you may have.

1 Like

Some ideas that come to mind are wave function collapse and maze generation algorithms (treating the rooms like a maze helps you get rid of scenarios such as non-accessible rooms, weird routes, etc).

Some ideas from graph theory can also be helpful.

1 Like

Thank you. I will look into that.

You can approach the generation itself any way you would like, as it’s pretty straightforward. If you are still unsure, I would recommend having a start and end part/attachment and using the positions of those parts to connect the rooms. As for the overlap protection, I found that checking for double turns and eliminating turns in that direction works pretty well for DOORS-type games.

1 Like

Thanks. I will try that.

1 Like

Oh, and if you need some extra guidance for avoiding room collisions, you can refer to this post

1 Like