Generating premade rooms in random sequence.

Get help using Construct 2

Post » Mon Nov 24, 2014 9:14 pm

I'm currently working on a platformer rogue-like game but the thing I'm struggling with is generating the rooms in random sequence. All my rooms are premade but I want then to be generated in random sequence and connect properly.
The rooms can be made of left/right entrance but sometimes also up/down or both up & down. They shouldn't repeat also. The thing is, how do I make them all connect properly and prevent the existence of entrances leading to nowhere? Some examples would be really appreciated.
B
29
S
16
G
2
Posts: 109
Reputation: 3,380

Post » Tue Nov 25, 2014 1:21 am

You probably want to look into procedural tilemap generation. There's lots of way to do it and the general idea can be translated fairly easily into many engines/programming languages.

https://www.scirra.com/tutorials/1112/procedural-dungeon-generation-a-roguelike-game Seems like a good start but it doesn't use tilemaps.

I recommend you look into how you'd code it to fully understand. Tilemaps and arrays go together really well because they both are conceptually a grid.
Put simply, it moves across each tile in a sequence and applies actions to each tile based on a bunch of conditions you set. If you set the right conditions and actions you'll end up with what you want.


Edit: This looks like maybe a better tutorial https://www.scirra.com/tutorials/1123/smarter-procedural-roguelike-dungeon
B
4
Posts: 8
Reputation: 221

Post » Tue Nov 25, 2014 9:50 pm

I'm not sure if that will help me, maybe I'm too newbie in this kind of stuff, but I will try to explain again. My rooms aren't based off grid tiles and they are all premade by me, all on separate layouts. Some of them have left/right entrances, some of them have up/down entrances, and some of them have left, right and up etc. just like Rogue Legacy for example. And my problem is, I don't know how to connect all those rooms based on the entrances, so there are no entrances going to nowhere and everything connects in a smart way. So I want to have rooms created by me be generated in random sequence with every run.
B
29
S
16
G
2
Posts: 109
Reputation: 3,380

Post » Tue Nov 25, 2014 10:11 pm

Hi @MozayKnows

So, if you want to leave a room by the right, you need a way of seeing a list of rooms with entrances on the left but which haven't already been used in your game?

Could you create some arrays - rooms with left entrances, rooms with right entrances etc. and then use the randomize function to select a particular qualifying room?
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests