Howdy, Stranger!

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

Procedural Dungeon Generation?

Hi, I am searching for a way to create random dungeon generation in unity. I have searched for days for this, but my search's results is not satisfying me. Most of the time I get these even rooms which I do not want. I want a generator that can create uneven rooms (ex. Enter the Gungeon, Soul Knight) and some corridors too. Is there any way to do so?

Best Answer

  • Accepted Answer

    Thanks @Mouledoux for trying to help me, but I found the answer:

    1. Have 3 scripts, Generator, Room, and Corridor.
    2. Generator will generate an entry room which the player will spawn in.
    3. Generator will spawn corridors with the Corridor script,
    4. Generator will tell the corridors to extend to a random value,
    5. Corridors will tell the generator where they ended.
    6. Generator will get that Vector3 and add onto it another Vector3 from the room which is the offset.
    7. Repeat.


  • Yes, you need to make the rooms yourself, and have the generator place them on the map.

  • Yea I know, but I do not have any way of adding corridors since I don't know how far does it need to be from the corridor.

  • What do you mean? As the programmer, you absolutely know how far a corridor is, or where to place them.

    If you want to make it even easier, make all your rooms on a grid system. So wen you go to attach them, they'll all connect together with a corridor that is also made to fit your grid system.

  • ++

Sign In or Register to comment.