GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Random Dungeon Generation

I'm making a random dungeon generator for a game I'm working on. So far I've tried having one actor that spawns a room, moves, and use RNG with a table to change a game attribute to a random number with a corresponding room that has a connecting door (ex. if it spawns a room with a top door then it will spawn a room that has a bottom door above it so that its not blocked off). This worked fine for about 5 seconds until i ran into the problem of not being able to do different paths due to using one game attribute. To Fix this i'd have to use multiple attributes creating 1-4 different attributes for each room (one for each door) for all 15 different rooms. So then i tried having the attribute being a self attribute for each actor so that its more organized to use and allows for me to go through each specific room and set it up so that I can just set it to self attributes rather than finding out which game attributes are being used, has been used, etc. Then there would be the issue of detecting where all the rooms are and which room each one is in order to not have any overlapping room spawns or blocked off doors which i can't seem to figure out how to do. Does anyone have and tips or tricks to help, think I'm just going about this all wrong, knowledge of any way i can detect if an actor has been spawned and where it is, have a simpler way of making a Random Dungeon Generator, etc?

Comments

  • SecretlyAnAlienSecretlyAnAlien Posts: 2Member

    The solution is to make a grid of actors and a table corresponding to said actors. Having each actor representing a cell and each actor read the four cells around it to see which doors are open near it. Then have each actor spawn a random actor that doesn't cut off any doors. Make sure to have each actor at the ends of the grid only spawn rooms that don't have doors leading to nothing. Tedious but it works

Sign In or Register to comment.