Would like help generating "Rooms" for a roguelike. How to spawn in a group of many actors while maintaining their relative distances from eachother?

Hi everyone! My friend and I have been creating a roguelike for a while now and would appreciate some help with randomly generating “rooms”. Each room itself will not be generated differently, but the order in that the rooms are chosen will be random each time.

Each room will be about this long and there will be subsequently placed after each other in each level. I couldn’t find a method of doing this while browsing, but maybe I was just using the wrong search terms when googling.

Basically what I would like to know is if there is a method for spawning a large group of actors while maintaining their relative positions to one another. Previously we had a method in which each cube would be a static mesh in one singular actor, but now that they have a small bit of logic in each cube, we can no longer do that. If you have any idea of a method that could accomplish this please help a designer out and comment it, even if it’s just a forum link or a YouTube link that I missed.

Hi DFM_Tymes,

I’ve built a system like that, it’s called rdBPtools - it allows you to define how an object can be transformed randomly from it’s original location among other things:

Instead of this method, I made it so each room is one actor because I was able to find a way to have all the logic I used to have in each cube actor, so now the walls are just static meshes and each chunk is an individual actor.

Your solution of using blueprint actors will work at first but it might get unwieldy for larger or more complicated rooms.

You can also spawn sublevel instances in the world using the Load Level Instance blueprint function. If you override the Level Name parameter of that node you can even spawn multiple instances of the same room. This will probably be the most robust way of handling roguelike rooms.

image

If you decide not to use level instances and instead keep to using Blueprints for the rooms, remember to have a soft reference to them and only load them asynchronously or you’ll need to have every single room type in your game loaded before you can play a single level.

Thank you Ari, this is exactly what I needed! It was very simple to add in a prototype version using level instances.

1 Like