"not so random" dungeon generation

Hey hello!

I want to do a random Metroidvania, since in vertical its more likely to have unreachable rooms/areas I thought I would be better just create rooms before hand and then place them randomly and connect them, but I have no idea how I can accomplish this goal, specially the part where I connect the rooms.

first of I would like to know if you think this is possible, 2nd do you think is the best to do it? 3rd how can I do it?

Thank you!!

Well, granted I haven’t bit off anything as big as procedural generation in unity. But logically the easiest way to do it would be to pre set where the rooms will appear with some kind of marker, then build your prefabs, then you can just instantiate them in the spots “randomly” If you wanted to also have different enemy spawn patterns in the room have spawn spots in the room that randomly generate what enemy will be in it (or what pattern of enemy)

The option is to build a system that counts rooms. Essentially initialize by making the “starting room” then detect if room has exit == yes (which the initial room always will) you would instantiate another room at the next “room location” the easiest way to do this method would be attatch a room connector spot to every prefab so it knows there to initialize the prefab. Then you just have it run down however many rooms you want in the chain so say you set it to “20” as the max, have it, at 20, ensure the last room is the “boss room.”

Is this a tile based system or is it more freeform?

In either case a BSP (Binary Space Partition) will help with placing non-overlapping rooms within an area. If your not familiar with BSPs i would look into tile based versions, the theory is still the same for non tile based versions.

Quick Primer NameBright - Coming Soon

Has some actual code Dungeon generation using BSP trees | eskerda.com

Thanks for the response, that’s more or less the idea I had. But you know, one thing is having the concept and different thing is the implementation. Hopefully I will find out how I can do this.

The game is tiled based.

Yes Im familiar with the concept of BSP trees, I have been looking into random dungeon generation a lot (roguebasin.com) before coming here, the thing is most information is about how to create rooms from scratch so I don’t know how I can use BSP trees to place the rooms but I will look into it. Thanks!