Issues with my "Room Generation" system, I need help.

Hello there, I’ve been working on a new game for the last 3 years, PS1-style graphics, but I programmed a Procedural Room Generation system in Blueprints originally C++ but for quicker prototyping I moved it to Blueprint, but I have run into an issue.

Everything is working as is, but the rooms keep generating inside of each other and I have thought about a bunch of work arounds but they all mess up the vision I have for this game, and break stuff.

Here’s my codebase.








The rooms are supposed to generate on a 16 by 16 grid and be massive mazes to collect loot in and bring the loot to the exit to bring up your score.

but my procedural room generation system is cloning rooms inside eachother, do you have any fixes or solutions to this issue, I’m really tired and I’ll check back in the morning, I’m not new to game dev I’ve been here for 8 years now.

If you have any quick solutions or know exactly what’s wrong let me know how I could improve onto this system, I know there’s room gen plugins, But I want to make mine from scratch so I can manipulate it in unique ways, that plugins wouldn’t do for me, there’s at least 5 different levels that rely on the same system, but generate different room types depending on the level you’re currently in. Example You’re on level 2, generate cave level instantly including it’s randomized paths etc. and randomized exit/entrance, also the game generates loot in random spots within the randomized rooms, including enemy spawns, this allows the game to stay fresh.

Procedural generation is the core loop of the game, it allows the player to play a fresh experience every time they play, currently the game is single player, but I plan on switching it to be multiplayer, I know I’ll have to do a bunch of replication non-sense so both players see eachother and are in the same place as player 1,

Thanks in advance, this game is my passion project.

1 Like

I did a maze like this once, its in my game.

There are two possible problems

1 You’re spawning rooms on top of each other because you have something wrong with your code

2 Your code is working correctly, but the rooms are circling back on each other and re-connecting

Solution for 1 is fix your code :slight_smile:

Solution for 2 is build in a sort of sensor ( read overlap ), so that a newly spawned rooms can destroy themselves if they overlap an existing room.

I haven’t read your code in any detail, its a bit hard to see whats going on. But I would recommend not trying to control everything from a central point, which it looks like you’re doing. Its a nightmare. Its much easier to have the code entirely in the room BP, and code them to not overlap.

If you know for sure its just going to be a 8x8 grid ( for instance ), then central control is fine, but you might have problems with not being able to get through all rooms, unless the doors happen to be on the correct wall etc. One way around that, is to code the rooms to only insert doors after they have been placed.

1 Like

Thanks, I’ll make sure to try that!

1 Like