Search Unity

Random Dungeon Generator Showoff! (PICS)

Discussion in 'Works In Progress - Archive' started by Slyder, Jul 27, 2014.

  1. Slyder

    Slyder

    Joined:
    Oct 17, 2013
    Posts:
    270
    I've been working on a random dungeon generator over the last week. Using a multi-pass path branching system. My Room Generator is building the actual rooms. The Dungeon Generator itself builds a "multi-dimensional" List which stores the room information and allows the Dungeon to generate extra branching paths in addition to path loops. Anyways, here's what I have so far...

    Basic linear branching Dungeon with straight paths...
    dungeon02.JPG

    Another Linear Dungeon with straight paths...
    Dungeon03.JPG
    Linear Dungeon with winding path. No branch paths...
    Dungeon04.JPG
    NONLINEAR Dungeon with no branching paths.
    Dungeon05.JPG
     
    Last edited: Jul 27, 2014
  2. Slyder

    Slyder

    Joined:
    Oct 17, 2013
    Posts:
    270
    Some more Dungeons... Dungeon06.JPG Dungeon01.JPG Dungeon07.jpg


    NEXT THING TO ADD: Merging rooms and extra room types (L-shape, U-shape, etc...)
     
    Last edited: Jul 27, 2014
    balaam and ReeRoo like this.
  3. Slyder

    Slyder

    Joined:
    Oct 17, 2013
    Posts:
    270
  4. peterdeghaim

    peterdeghaim

    Joined:
    Apr 10, 2014
    Posts:
    154
    dayum nice work man!
     
  5. Slyder

    Slyder

    Joined:
    Oct 17, 2013
    Posts:
    270
    Thanks man...We should have some more advanced room shapes in this week such as large L shapes, U shapes, etc... Also internal walls to break up some of the rooms a bit more.

    Still need to add room swapping in for when we have more than one dungeon type.
     
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,536
    Cool stuff!
     
  7. Squabbler

    Squabbler

    Joined:
    Jan 11, 2013
    Posts:
    11
    Awesome stuff.

    When you are building the linear dungeon Lists, are you putting the child rooms inside of the room list item? How are connected rooms related in the list?

    For example, I created a dungeon map generator in JS that creates a random map based on a tree structured array of rooms, and I'm trying to port it to C# for Unity purposes, but I can't figure out the best way to handle it.
     
    Last edited: Jul 28, 2014
  8. Slyder

    Slyder

    Joined:
    Oct 17, 2013
    Posts:
    270
    There is a pathList which stores the data for each Node. Each node has a left, right, up, and down ptr to link to other Nodes. There's also a nodeList that stores pointers to every room in parallel so that I can search them linearly and handle path loops using an x,y "index". The x and y index is used to calculate world coordinates for the Room generator.

    Basically everything is generated by building paths and then paths off of those paths. The paths are build recursively and many variables can be changed to change the way the paths form...such as chance to branch, chance to change directions, and whether or not the path can move in the same direction it started(overlapping paths).
     
    Squabbler likes this.
  9. Samuel411

    Samuel411

    Joined:
    Dec 20, 2012
    Posts:
    646
    Is there any possibility of making them unlimited? Good work though.
     
  10. Slyder

    Slyder

    Joined:
    Oct 17, 2013
    Posts:
    270
    I have not considered unlimited dungeons. I
    I can't think of a way to generate an Unlimited dungeon like this. I don't see how you would handle path loops. The larger your dungeon gets, the more iterations it takes to determine if you're attempting to build a room that already exists (loop)

    Eventually you would run out of memory with massive dungeon. Also, you would have to generate the dungeon as you traverse it, creating the adjacent rooms on the fly...
     
  11. balaam

    balaam

    Joined:
    Aug 4, 2013
    Posts:
    4
    I think random dungeon generators are great fun and these screenshots are great.

    Sometime I think about starting one that includes a concept of goals / is more directed. For instance there's a goal room, with the exit and a entrance room. The the dungeon is generated to make an interesting journey between entrance and exit. Lock and key puzzles perhaps, or a mini boss etc.