Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Procedural Dungeon Toolkit - Dungeon Themed Procedural Generation Toolkit

Discussion in 'Assets and Asset Store' started by r3eckon, Sep 23, 2016.

?

What kind of update would you like to see released first ?

Poll closed May 13, 2018.
  1. Prefab placement helper GUI ( Easily editing the generation point of objects without code )

    8 vote(s)
    33.3%
  2. Generation rules editor GUI ( Editing the current generation parameters for custom levels )

    5 vote(s)
    20.8%
  3. Level type selection GUI ( Easily selecting , adding , removing saved types of levels )

    2 vote(s)
    8.3%
  4. Add more assets to the current level ( Chests , Rare Items )

    3 vote(s)
    12.5%
  5. AI manager script ( For mob pathing / spawning )

    5 vote(s)
    20.8%
  6. Other / Post in thread

    1 vote(s)
    4.2%
  1. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Great news, the new version has been released !
     
  2. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    For those of you desperately waiting for AI navigation around the dungeon, Here is a quick look from Unity's official youtube channel showing off the Navmesh generation abilities of Unity 5.6 showing off a procedurally generated maze and navmesh baking at runtime.

     
    StevenPicard likes this.
  3. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Unity 5.6 just officially released ! Navmesh generation capabilities are going to be implemented shortly in the asset :)
     
    StevenPicard likes this.
  4. rdograndy2015

    rdograndy2015

    Joined:
    Jan 18, 2017
    Posts:
    2
    Awesome man that's the last thing I needed for my dungeon crawler
     
    r3eckon likes this.
  5. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Same thing here, before I turned this into an asset I wanted to make small dungeon crawler game for the OSVR headset. I slowly add bits to the generator until it becomes pretty much a full game, but having navigation around the dungeon is a must for an actual game.

    With this version, I believe we have the ability to bake navmeshes onto prefabs and also re-bake them at runtime based on the procedural geometry added to the levels. This should make it quite easy to enable navigation on any type of part, especially for stairs and also rooms where drawers and tables might be added.
     
    StevenPicard likes this.
  6. rdograndy2015

    rdograndy2015

    Joined:
    Jan 18, 2017
    Posts:
    2
    yeah I started out doing a google cardboard and a pc version, but vr started acting really strange when I added to much detail(changed texdtures and added tiling), so I dedcided to just do pc. :)
     
  7. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Interesting, I cant test the google cardboard right now but is it possible to allocate more video memory for the higher res textures? Webgl builds did the same thing until I allocated enough video memory in the build settings. Also some other threads mention using debug build to sort this problem.
     
  8. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Hello everyone, here is a quick progress report for the navigation features I have been working on.​

    The scripts used in Unity 5.6 allow for any prefab to be used to create navmeshes. While this works perfectly out of the box for square tiles such as the floor tiles, for more complicated navigable objects an invisible, non collidable mesh is added over the stairwell to give the illusion of a smooth surface on stairs. Since no mesh renderer component is needed, there is no impact on rendering performance. A collider is needed but deactivated by default, more on this later.​


    Without any modification to the generator this could only be used to generate navmeshes in areas where the player based object pooling activates objects, as meshes are removed from the navmesh building pipeline as objects are deactivated. To circumvent this, Custom Objects prefabs containing a children named "Navmap" will now be detected upon generation. This child is then added to a GlobalNavmap object so that they stay activated at all times, allowing AI's to navigate the whole dungeon without the player being close-by.





    Since objects that are deactivated by the player based pooling have no collider for the AI to stand on, another type of gameobject named "NavmapCollider" is added to the GlobalNavmap as well. These objects are also invisible.



    I'm currently working on getting an AI working with this generated map. A new tile type to spawn mobs has been added and when objects with the SpawnableMob script attached to them are detected by the custom object generation they are un-parented from their parent node so that they can avoid pooling.

    This new version should release some time next week given that I do not face any problems and am able to release the next version before the end of this week :)


     
    Last edited: Apr 4, 2017
    StevenPicard likes this.
  9. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Quick video showcase of the procedural navmesh capabilities !

     
    StevenPicard likes this.
  10. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Awesome! I can't wait.
     
    r3eckon likes this.
  11. rdograndy

    rdograndy

    Joined:
    Dec 18, 2016
    Posts:
    11
    They're avenging the fallen brethren killed by all the hours we spent playing pacman in the arcade XD
     
    r3eckon likes this.
  12. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Last progress report before I send the next update, I've just increased the performance for large maps and framerates are now solid even inside the editor. There was a small memory leak in the map drawing script making ram usage slowly go up forever while the map is on screen due to a new texture being created on each frame.

    The AI script now includes some basic AI vision using raycasting to allow the player to escape if you are out of visual range. This range can be set in the inspector as it is a public variable for the basic AI script I have written. This script also features a delay counted in milliseconds that you can increase or decrease to control how often the AI tries to find player position, it is set to 1 second by default.

    Now I simply need to write the new documentation for AI and Navmesh features usage and the updated version will be sent for validation! If the team takes the typical amount of time to validate this version it should be live by next week!
     
    StevenPicard likes this.
  13. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Awesome! I can't wait because I am demoing your asset at the next Unity meeting I attend. I need time to get to grips with the new features.
     
    r3eckon likes this.
  14. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Nice! I'll make sure to post the documentation on this thread so you can have an overview of how to use the upcoming features before actually getting the update :)
     
  15. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
  16. rdograndy

    rdograndy

    Joined:
    Dec 18, 2016
    Posts:
    11
    I cannot get the color picker to work on the map editor. I open up the color selector the click the set color button and it only turns everything white, nothing else. Am I doing something wrong?
     
  17. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Make sure the opacity is high enough, for some reason by default its set to 0.
     
  18. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
  19. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    The update is available!!
     
    r3eckon likes this.
  20. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Yup! Update has released about an hour ago :D
     
  21. rdograndy

    rdograndy

    Joined:
    Dec 18, 2016
    Posts:
    11
    First of all you're the best :D second, is there a way to increase time between spawns? I've noticed that the capsules tend to get stuck in groups if they all bunch together.
     
    r3eckon likes this.
  22. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    You could add a timer variable to the SpawnableMob script and make sure it reaches a certain amount before the mob starts walking towards the player, like so :

    Here is the variable declaration and setting of a random delay that you can set in the editor ( public variables can be set in the editor )




    And here is how to increment the timer and enable the navigation once its been reached



    I hope you have no trouble implementing this solution, I will add this to the asset in the next version :)
     
    StevenPicard likes this.
  23. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Hello everyone, I hope all of you had an happy Easter weekend!

    If anyone has trouble with the new navmesh tools feel free to send me an email, otherwise I hope you all had an easy time generating your own navmeshes. The added documentation should cover everything you need to know to get navigation on your own prefabs. However if you are not getting a good navmesh at first, you can try different agent parameters as well as making sure the NavMap objects are correctly setup for your wanted path.

    I found that the best way to debug your prefab's navigation is actually at runtime after the map has been generated, since the navmesh will be re-generated as soon as the NavMap objects are moved, rotated, scaled, etc. or as soon as the agent is changed. You can use trick this to see live changes to your Navmesh, while keeping the changes temporary if things get more problematic.

    New and better looking prefabs will be added in a little bit, I have recently contacted a couple 3D artists and asked them to create a bunch of models for the generator. I have no release date for these new prefabs however.

    This is all for now! Again if you have any questions feel free to reply to this thread or send me an email :)
     
    StevenPicard likes this.
  24. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Thank you StevenPicard and everyone who took the time to write a review for the asset, they are really helpful to potential consumers and gets the asset out there as well! If you feel like it, consider writing one of your own and share your thoughts if you have not yet :)

    Little sneak peek of what I am currently working on below.. Moving away from just dungeon generation seems simple enough when building the pieces and assembling them into what looks like an office building..or close to it at least. The environment generation rules for an office building floor of a set size should be simple enough to translate into a new procedural tile map generation algorithm, but for the mean time I will be testing with a custom map to make sure these building blocks even work!

     
    Last edited: Dec 21, 2017
    StevenPicard likes this.
  25. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Very exciting! That would be so cool.
     
  26. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    I just pushed version 1.14 to the asset store for verification, this small update fixes trouble I had with object avoidance in the latest update, as well as fixing the behavior of tiles with multiple objects of the same kind generating in multiple directions. This latest update allows for walls to work in environments like the office building I posted earlier. With any luck this version may release before the end of this week.
     
  27. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    As you can see below, Cube walls are not needed at all to generate the environment :)

     
    StevenPicard likes this.
  28. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    I can't wait!! :confused::D
     
    r3eckon likes this.
  29. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Will this version be out soon and will you be doing a video tutorial on using the new techniques for generating the non-cube walls?
     
  30. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    I was actually planning on making a new video tutorial on how to use the asset entirely given its changed a lot since the first tutorial I made, so this part of the process will be included as well in it as an example of how I create environments.

    For the most part, this type of wall works with existing features but as the directional pattern detection algorithm was written in the previous version, as soon as a compatible pattern was found in any direction the generation process jumped to the next tile, leaving behind some directions that might have been valid for the pattern. This means that if a wall already generated at the current map-wise position, some walls needed at this position were not there. The cube wall was circumventing this problem by being a solid cube taking up the entire tile and thus blocking every direction a wall could have been needed. Now while this is fixed, it's still possible to add a single object even if multiple could generate by selecting an Orientation that isnt "Automatic". This is needed for floor tiles and cube walls, being that they take the entire tile with a single object and that they would cause z-fighting with each other if all generated on top of one another.

    In the end this new method of working with direction detection for the custom object's patterns allows you to add the same object in every possible direction the pattern can be found. This does imply some amount of clipping and z-fighting in corners where the thickness of the wall meets with the face of a perpendicular wall, but a minor change in the pattern based W translation parameter trades this for a corner that looks a little off, something that can be addressed with a corner model, or simply using an infinitely thin plane as a wall.
     
    Last edited: Apr 27, 2017
  31. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Oh and with any luck the new version will be released before this weekend :)
     
  32. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    And the new version includes this feature?
     
  33. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Yes, its more of a behavior fix of an existing feature than a new feature but it will be there in the next version.
     
    StevenPicard likes this.
  34. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
  35. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    The new update has released :D
     
    StevenPicard likes this.
  36. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    When do you think you'll get around to doing a new tutorial video? Having one that covers the entire process using current techniques form beginning to end would be tremendously helpful. I plan on demoing it in around two weeks at the Unity meeting and I plan on showing the construction of a dungeon with levels, chests, keys and at least one enemy.
     
  37. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    I'm planning on recording the new tutorial this week, editing it should be quite easy so I can most likely upload it by this weekend. I have been away from my work computer for a little while now but I should be able to get back on it this week and record.
     
    StevenPicard likes this.
  38. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    The tutorial has been recorded but I had lots of problems with my computer yesterday ( honestly thought my data hard drive was gone for good :O ) so I still need to do editing, the video may be uploaded around monday.
     
    StevenPicard likes this.
  39. AquaAF

    AquaAF

    Joined:
    Jun 12, 2015
    Posts:
    6
    Hey man, I recently purchased the asset and I'm loving it so far but I'm in a little trouble, I'm trying to create a portal which is only spawned once to act as an end goal, but I still want to use the procedural part (the reason I said that is because I saw that there is a neat feature which allows you to create your own dungeon). I'm able to have the portal spawn but I want to be sure there is always one in the scene due to it sometimes not spawning or spawning 2 feet away next to 2 other portals I put the spawn chance relatively low so that doesn't happen often in either case but there are exceptions. Loving the S*** out the asset tho
     
    Last edited: May 14, 2017
  40. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Hello and thanks for buying the asset! The generation algorithm features a "Goal" tile type which should always be a single tile added at the very end of the map generation process, however this code is a little older and might need some reworking in order to work properly with my newer tile detection algorithms so I cannot say for sure a tile of this type will be generating every level, especially smaller ones. Now this feature works fine with most cases, the problem is that there is nothing making sure this tile is a minimum distance away from the spawn, therefore you can get something like this where the spawn 6 is very close to the goal 5, which might not make for a hard to complete level.



    I plan on reworking this feature a little bit after I also implement a better set of level generation algorithms to take level flow into consideration and also fix the floating rooms, but in the mean time if you want to there is a way to simply add a new tile type to the generation process like I recently did with the MobSpawn type and place it using your own rules.
     
  41. Borunor

    Borunor

    Joined:
    Nov 11, 2016
    Posts:
    21
    Good afternoon, I would like to know that this asset allows me to generate a complete dungeon procedural generated on runtime. What I need is a tool that generate a different dungeon with prefabs enemy and prefab object (showed with logic) every time I go inside a certain building in my game. Before to buy your assets may I know if it can generate a random map on runtime? Many thanks before hand
     
  42. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Yep! Dungeons are always generated at runtime using this asset. Currently the script is tied to a static object acting as a single dungeon map holder, but given your projected usage it would be entirely possible to attach the script to different map holders and load/unload them using a custom script to call the "Generate" method of the DungeonGenerator script when you need a new dungeon. Some dungeons can then be procedurally generated, while other dungeons use a premade map you created, since each map holder is its own independent dungeon generation capable object.
     
  43. AquaAF

    AquaAF

    Joined:
    Jun 12, 2015
    Posts:
    6
    Thank you for your reply, love your work keep it up GL on the new algorithm. Also is there a roadmap by any chance?
     
  44. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Not currently I'm afraid, I have too many conceptual features in mind to give a concrete roadmap of what the future of this asset will be like, but right now I do have some improved textures and models coming up!
     
  45. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Sadly the new tutorial will be a bit late due to some computer issues, most of the recorded files were incompatible with my editing software and the footage was jumpy possibly due to the encoder not being set properly so I have to record all over again. It should finally be uploaded before the end of this week if everything goes well, if you have any questions in the mean time feel free to ask them here!
     
  46. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Hello everyone, I managed to get the tutorial done last night, its still uploading but should eventually be live at the following link

     
    StevenPicard likes this.
  47. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    Thanks!
     
    r3eckon likes this.
  48. healym

    healym

    Joined:
    May 17, 2016
    Posts:
    19
    Hi, your plugin looks amazing! I'm very interested purchasing it, but I'd like to ask you a question about it first.
    I'd like to create an randomly generated maze (or a maze from a graphic file) that procedurally connects premade rooms. Each room would have no ceiling (I see that you can do this) so that the player can see some of the surrounding maze walls. Would it be possible to randomly connect these rooms into a maze with your plugin?
     
  49. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Hello, yes it would be possible to use entire rooms as a prefabs, the custom object system allows for any gameobject to be instantiated at its respective location on the map, however procedural maze generation is going to require your own procedural tile map generation algorithm ( you can find many, many sources online as maze generation is one of the starting points ) or at the very least a small code addition to mine to make it work with the rest of the environment.

    If the current type of levels are good enough for you, adding your premade rooms instead of procedurally generated rooms implies adding Tile Types which are arbitrary numbers the objects use to find where they belong. Two types such as a "Premade Room Entrance" which is randomly placed perpendicular to a corridor and serves as the origin of the room and "Premade Room Taken Area" which would override existing tiles on the map that are in the way of the room, to make sure your room is placed correctly and that nothing is clipping through it. If the room spans multiple floors, it will be required to add this type on these floors as well.

    After that its a matter of translating and rotating this room correctly relative to the "Premade Room Entrance" and you are done with the hard part, now removing ceilings is just like removing any other object, they all feature a toggle to switch them on and off !

    If you have more questions or if this answer was unclear just to let me know :)
     
  50. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Quick screenshot of a texture and model work currently being done for the asset, proper textures and matching patterns make it all look so much better!