Search Unity

DunGen - Procedural Dungeon Generation

Discussion in 'Assets and Asset Store' started by Aegon-Games, Mar 7, 2014.

  1. gammaker

    gammaker

    Joined:
    Feb 8, 2014
    Posts:
    12
    ah, I missed one thing.

    Can I know the size(Rectangle size: width, length) of Dungeon that was generated by Dungen?
     
  2. IronStomachVR

    IronStomachVR

    Joined:
    Oct 25, 2013
    Posts:
    22
    Loving your asset and your help on Navmesh generation. I ended up using the method found in the following thread and thought I would share it. http://forum.unity3d.com/threads/unity-dynamic-navmesh-generation-built-in.220300/
    This has the benefit of no baking needing to be done but the drawback is you cannot have height differences in your dungeon. It is on the roadmap though for Unity 5.5 to have baked Navmeshes saved to prefabs of rooms. I hope this helps some.

    I had a question though. Is there a way to ensure corridor like rooms always generate inbetween all other main/regular rooms. I can sort of get it to work with weighting but not really and when I got like 100+ tiles in my project weighting wont be so easy. If it is just not possible that is fine as well. I just thought it would help for balancing game performance to have simple corridors with doors that way occlusion culling never has to render 2 complex rooms at the same time. I hope I phrased that well. View attachment 177873 View attachment 177873 View attachment 177873
     
  3. IronStomachVR

    IronStomachVR

    Joined:
    Oct 25, 2013
    Posts:
    22
    sorry. here is a pic
     

    Attached Files:

  4. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    so another advanced newby question

    when I disable rotation on the dungen tiles
    and use

    http://forum.unity3d.com/threads/pr...ting-baked-prefabs.324514/page-5#post-2556300

    to bake the lightmap for the tiles

    the assignment of the lightmaps to the tiles happens automatically when
    the dungeon is generated?

    the rotation is disabled because of the directional component
    else (from my understanding) i would have to bake the lightmap for each rotation

    integration or help with this would be extremely helpful
    and also would make the dungeons look mmmmuuuuuucccccchhhh better ;)
     
  5. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Can dungeons have multiple exits and link together?
    Can keys be comprised of multiple parts or be spells/abilities/equipment - eg. an axe to cut through a weak wooden door or fire to burn it, or mist form to move through an iron grill?
     
  6. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    DunGen design is aimed at getting the player to follow a path from start to end in a single dungeon layout. If you want to create triggers in different rooms that can teleport a character out of the dungeon, or around in the dungeon, you can do this, but it's something you'd set up on your own.

    As for keys, DunGen's design is to make sure a key object is placed in the dungeon before the locked door it opens is encountered. If you want to get creative with what sort of model or situation is associated with the key function, you can do that on your own. For instance, I think it is probably possible to have a NPC encounter act as a key delivery mechanism.
     
    Aegon-Games likes this.
  7. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    This is going to be a long string of answers. I'm still looking for a better place to deal with Q&A stuff, something like answerhub where questions are separated and answers don't get lost in 17 pages of posts. Hopefully I'll have something more appropriate set up soon.


    You should be able to use single-doorway tiles for start, goal, and cap tiles. Using them anywhere else should result in an error. If you're seeing any other behaviour then it's likely a bug somewhere.

    You can't use single-doorway tiles at all with the tile injection system since it might not try to place the tile at the end of a branch. I don't think I made DunGen report this as an error though so that's something I'll have to do to make it more clear.

    I'll look into the SECTR VIS issue then. Like I said, I've only used it with the Keep demo and I didn't run into any flickering there but I'll try to reproduce the issue and see if there's anything I can do to fix it.


    If you're using the 2.9 beta, the Dungeon class should have a Bounds variable that will tell you the size of the whole dungeon. If you're not using the beta, you can use one of DunGen's helper functions UnityUtil.CalculateObjectBounds and give it the dungeon's root GameObject as the first parameter.


    There's no way to ensure that corridors are generated between rooms unfortunately. DunGen doesn't differentiate between corridors and rooms, everything is just a generic "tile" which can be anything you like (even chunks of an outdoor environment).

    If you're comfortable with C# it should be possible to modify the Archetype class to hold two lists of TileSets (one for rooms, one for corridors) and have the DungeonGenerator alternate which list it picks from when adding a new room. That would give you a corridor on each side of every room but wouldn't account for rooms places as nodes on the flow graph.


    I haven't tried it but I would have assumed this would just work with DunGen if the stored lightmaps are being applied in Awake() or Start(). DunGen is already kind of bloated so I'm not sure direct integration for this is likely to be something I do but I'll take a closer look when I've got some time. Any suggestions for how I could potentially make this process easier with DunGen are also more than welcome.


    As hopeful said, DunGen was really designed for a single main path so multiple exits can't be done unfortunately. You could have "portals" scattered around the dungeon which teleport you to another dungeon, but there's not really a way to have branching paths or interconnected dungeons.

    The lock & key system just places prefabs so it's completely up to you how you want to handle the logic. The actual prefabs can be whatever you like.
     
    Last edited: Mar 18, 2016
    Arganth likes this.
  8. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    The lightmapping script actually works with dungen :)

    I tried it yesterday and it is just beautyful
    (i disabled rotation on all tiles/havent tried if it works with rotation but usually not)

    and it looks absolutely beautyfull (with UBER shader and snow/wetness activated)


    considering this are the just the "empty" demo rooms :)

    the "low" framerate comes from a lot of image effects/AA stack
     
    hopeful likes this.
  9. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    Still have 1 Problem

    i use TPC from opsive
    and the player slightly stop when going from one room to the next (crossing the doorways) which is really odd

    is there still a collider or something present? (getting bullet holes in thin air -> doorways)

    any ideas?
     
  10. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    There shouldn't be any colliders on the doorways. The player getting stuck could be due to the seam between the floor colliders - even if there's no visible seam, the physics could cause the character to get stuck momentarily.

    The only thing that comes to mind is the trigger volume DunGen places around each room (to let you implement logic on entering/exiting a room). It's attached as a component to the room tile itself, you can try disabling the collider in play mode to see if it helps but they're triggers so nothing should be being blocked by them.
     
  11. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    I don't want to teleport, but have multiple dungeons link together.

    Is this possible with DunGen?

    Actually, I read the next post which answers my question..

     
  12. gammaker

    gammaker

    Joined:
    Feb 8, 2014
    Posts:
    12
    Question about lock and key.

    0. Made key manager file and set key prefab.
    1. I made cap_tile_set and shine_tile_set.
    2. I added Locked Door Prefabs in these tile set
    3. I added these tilesets in Archetype file as branch tile set. ("Instead of")
    4. I added Keys and Locks in Line Segment of Dungeon flow.

    and play. Why cant I see any key & lock door?

    If I add Locked Door prefabs in basic archy type tile set, then I can see lock doors.
    but I want to set locked door in these cap tile.(always 1 at least) and key set line segment somewhere(randomly).

    as you answered before, I want to some cap tile work like a goal node (lock placement entrance.)

    if there is some solution. then tell me.
     
  13. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    There's no way to make DunGen assign a locked door to a specific tile in an archetype. The start & goal nodes are special and there's no way to emulate their behaviour on a branch cap tile.
     
  14. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Some more small tweaks. I think I'll submit this build to the Asset Store tomorrow assuming there aren't any new issues brought up.

    Version 2.9.0 (Beta)
    - Download

    - Change Reverted the ProBuilder support changes made in 2.8.0 - these are no longer necessary
    - Change The Dungeon class now has a Bounds variable which reports the axis-aligned bounding box of the entire dungeon layout
    - Bugfix Fixed an error in the runtime analyser
    - Change A root GameObject can now be chosen when using the RuntimeDungeon component. If none is specified, it will default to the old behaviour of creating a new root named "Dungeon"
    - Change RandomPrefab props now have options for keeping the spawned prefab's position or rotation as an offset. Previously, spawned prefabs always snapped into position and ignored the prefab's transform (this is still the default behaviour)
    - Feature Added integration for generating navigation meshes with both RAIN and A* Pathfinding Project Pro
    - Change The utility function UnityUtil.CalculateObjectBounds() now ignores trigger colliders by default. Room bounds should no longer encompass any trigger colliders
    - Bugfix Fixed errors when using custom doorway socket connection logic

    * NEW *
    - Bugfix Moved TypeUtil class to the editor folder as it was causing issues when trying to build for Windows Store (and possibly other platforms)
    - Change Added an option to disable the trigger volumes DunGen places around each tile. If disabled, the DungenCharacter component won't receive events when moving between rooms
     
    hopeful likes this.
  15. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    @AegonGames thanks for this.

    Nav mesh generation sounds really cool.

    Just wondering whether in future it might be possible to add support for Apex Path using it's Portals to link rooms together?

    cheers

    Nalin
     
  16. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Apex Path does look really good; I've been meaning to check it out but never got around to it. I'll pick it up at some point and try to add integration into DunGen for it, but I'm not sure exactly when that'll be.
     
  17. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Great - thanks for considering it :)
     
  18. sk1zZ

    sk1zZ

    Joined:
    Mar 30, 2015
    Posts:
    9
    Good day.
    I have a couple of questions.
    1. If you remove the delay of frame before generating, will be no problems? I have whole logic in the old version, and there was no delay.
    2. Is it possible to create a dungeon only from unique (not repeating) tiles?
    3. Can I make repeating (the same) tiles are not connected with each other?
     
  19. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    1. As long as you're not generating a dungeon in response to a collision event, there should be no issues.
    2. It's not possible to ensure that every tile is different in a dungeon layout.
    3. There is an option in the dungeon settings (on the RuntimeDungeon component) to try to avoid repeating tiles. I can't remember exactly what the option is called since I don't have DunGen in front of me right now
     
    sk1zZ likes this.
  20. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Another small bugfix release for those using fixed tile rotations:


    * NEW * Version 2.9.1 (Beta)
    - Download

    - Bugfix Fixed an error causing the "Allow Tile Rotation" override to not work properly
    - Change Dungeon generation will fail much less frequently, especially when imposing constraints such as fixed tile rotations
    - Change In the event DunGen does fail (editor only; at runtime, DunGen will keep trying indefinitely), points-of-failure will be listed to give a better idea of the cause
     
    montyfi and hopeful like this.
  21. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Splendid, I am using RAIN and A*, any example on how this works?
     
    Last edited: Apr 23, 2016
  22. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Oops, I forgot to update the online docs. Pages 21 & 22 of the documentation cover how to setup RAIN and A* integration. I've tried to make it as painless as possible but any feedback is welcome.
     
    hopeful likes this.
  23. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Does that mean the AI won't pass through a closed door that is already opened by a player?

    But hey, that is indeed a really painless method to integrate Navmesh! Thanks AegonGames!
     
  24. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Yeah sorry; right now the RAIN integration doesn't handle changing NavMesh walkability through doors - they're always going to be considered closed. It's working for the A* Pathfinding Project Pro integration but I didn't have time to figure it out for RAIN as well.

    I'll try to get around to looking into it soon - the last few months have been pretty hectic. If anyone already knows how RAIN usually handles toggling walkability of specific nodes at runtime that would be a big help.
     
  25. dustinandrew

    dustinandrew

    Joined:
    Apr 30, 2010
    Posts:
    102
    DunGen is great and I've been able to get it set up and working quickly. But there are a few issues I'm having and some features I would love to see added.

    I'm making a 2D game that moves downward and I'm trying to figure out how to force the generator to always create downward. My Runtime Dungeon's up vector is set to 0,1,0. And by adding a starting tileset that only has doors facing down, it kind of always creates in a downward direction, but I still get a lot of dungeons that turn upward.

    So, is there any setting I could change to force a direction?

    If not, this would be a feature I would love to see added. Maybe a direction weight that favors doors that face that direction for branches and main lines.

    Also, I'm seeing some tile overlapping, almost like its trying to connect branches over another branch in 3D. It would be nice to have a setting for 2D, so that it doesn't overlap when trying to connect branches. It might be related to the way I have my doorways setup in 2D. Is this the correct way to set it up for 2D? When it connects the tiles, it alternates at different Z depths, which is fine for 2D, but I think this causes the overlapping.



    Below you can see the purple room branches off of the green room, going over the blue room.



    Also, I would love to see width/height properties added to Tiles, so that you could specifically force a tile size instead of DunGen trying to guess it.
     
    Last edited: Apr 25, 2016
  26. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    There's no setting to force direction right now. I might be able to add an option to bias dungeon generation in a specific direction though.

    I can't tell from the screenshot if the doorways are set up correctly. They're facing the right way, but they also need to be oriented so that their local +Y is up. The only thing I can think of that would cause that layering effect is if some of the doorways are upside down.

    The bounds calculation should be fairly accurate; DunGen is just combining the renderer and collider bounds for all objects in the tile. Are you running into issues with bounds sizes?
     
  27. JeiBell

    JeiBell

    Joined:
    Oct 1, 2013
    Posts:
    4
    Hi AegonGames,

    I am running into a few issues with the Dungeon Flow Editor ver. 2.9.0:

    1) Any portion of a node which overlaps the 'Start' or 'Goal' nodes prevents the selection of that node. This appears to be an issue where 'Start' and 'Goal' are rendered on top of the movable nodes. If you cannot reproduce, try selecting the 'Start' or 'Goal' nodes before re-selecting the custom node.

    Request: Force 'Start' and 'Goal' nodes to render in the background, behind other nodes.

    2) Completely overlapping a node on the 'Goal' node will cause the dungeon generation to fail 100% of the time. Once this happens, there is no way to save the Dungeon Flow and everything must be recreated from scratch since you cannot move a custom node (due to Issue 1).

    Note: Fully overlapping the 'Start' node does not crash the dungeon generating process.

    Request: Prevent failure of dungeon creation when custom nodes fully overlap 'Goal' node.

    3) The graphical representation of nodes is not accurate when trying to replicate the special feature of having a 'Boss' node right before 'Goal'; such as, in the middle of the dungeon or at a 'Mini-Boss'. Chaining specific nodes to follow each other due to dungeon length and positioning of nodes change how much overlap is required to get the desired effect.

    Example: A dungeon length of 20 units and editor window sized to its smallest will require 50% or more overlap of custom nodes to produce a pattern of [Node, Node, Segment], yet anything else less than 50% will produce [Node, Segment, Node]. Thus, increasing the dungeon length to 100 units will require moving node's closer together.

    Request: Provide a better method of managing precise node/segment placement; such as a Control Flow Graph with the added benefit of assigning weights and lengths to each node/segment.

    4) To help mitigate the problem in Issue 3, nodes would have to be placed almost directly on top of each other; it is hard to read and select nodes overlapping 99%, especially if you have many nodes and segments.

    Request: Provide a drop-down of all existing nodes (and another for segments) to help with the selection process; selecting an element from the drop-down will make it active in the Inspector and graph's foreground, ready for mouse input.

    Also, I am interested in generating looped corridors, so when playing around with the 'Connection Chance' attribute under the 'Dungeon Flow' asset, the below error shows every time I regenerate a dungeon using your demo code under Unity 5.3.4f1 for OSX. If I leave 'Play' mode and come back, it will successfully generate a looped corridor dungeon.

    KeyNotFoundException: The given key was not present in the dictionary.
    System.Collections.Generic.Dictionary`2[DunGen.Tile,DunGen.DungeonGraphNode].get_Item (DunGen.Tile key) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:150)
    DunGen.DungeonGraph..ctor (DunGen.Dungeon dungeon) (at Assets/DunGen/Code/Graph/DungeonGraph.cs:28)
    DunGen.Dungeon.PostGenerateDungeon (DunGen.DungeonGenerator dungeonGenerator) (at Assets/DunGen/Code/Dungeon.cs:48)
    DunGen.DungeonGenerator.PostProcess () (at Assets/DunGen/Code/DungeonGenerator.cs:922)
    DunGen.DungeonGenerator.InnerGenerate (Boolean isRetry) (at Assets/DunGen/Code/DungeonGenerator.cs:289)
    DunGen.DungeonGenerator.OuterGenerate () (at Assets/DunGen/Code/DungeonGenerator.cs:164)
    DunGen.DungeonGenerator.Generate () (at Assets/DunGen/Code/DungeonGenerator.cs:129)
    DunGen.RuntimeDungeon.Generate () (at Assets/DunGen/Code/RuntimeDungeon.cs:31)
    Generator.GenerateRandom () (at Assets/DunGen/Demo/Scripts/Generator.cs:68)
    Generator.Update () (at Assets/DunGen/Demo/Scripts/Generator.cs:80)

    Thanks!
     
    Last edited: May 3, 2016
  28. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    1 is now fixed in the newest beta build (below), as is the error you were seeing with the doorway connection feature.

    I was unable to reproduce issue 2. Completely overlapping the goal node caused the tile to be placed after the goal, but didn't cause the generation to fail for me.

    Issues 3 & 4 are going to take some time as I'll need to redesign not only the UI, but the data representation behind it (and ensure it's backwards compatible). Right now, these issues are going to have to go on my backlog I'm afraid.


    Version 2.9.1 (Beta)
    - Download

    - Bugfix Fixed an error causing the "Allow Tile Rotation" override to not work properly
    - Change Dungeon generation will fail much less frequently, especially when imposing constraints such as fixed tile rotations
    - Change In the event DunGen does fail (editor only; at runtime, DunGen will keep trying indefinitely), points-of-failure will be listed to give a better idea of the cause

    * NEW *
    - Bugfix Fixed an issue causing nodes in the Dungeon Flow to be unselectable if placed over the top of the Start or Goal nodes
    - Bugfix Fixed an issue causing doorways from a previous dungeon to be considered when trying to connect overlapping doorways
     
    Last edited: May 10, 2016
    hopeful likes this.
  29. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    I've made some more small additions to the beta. This build has been going a little too long now so I'll be pushing it to the Asset Store shortly.

    Version 2.9.1 (Beta)
    - Download

    - Bugfix Fixed an error causing the "Allow Tile Rotation" override to not work properly
    - Change Dungeon generation will fail much less frequently, especially when imposing constraints such as fixed tile rotations
    - Change In the event DunGen does fail (editor only; at runtime, DunGen will keep trying indefinitely), points-of-failure will be listed to give a better idea of the cause
    - Bugfix Fixed an issue causing nodes in the Dungeon Flow to be unselectable if placed over the top of the Start or Goal nodes
    - Bugfix Fixed an issue causing doorways from a previous dungeon to be considered when trying to connect overlapping doorways

    * NEW *
    - Bugfix Fixed an ambiguous reference to TooltipAttribute when using PlayMaker integration with newer versions of Unity
    - Feature There are now options to avoid rotating Door and Blocker prefabs placed by the Doorway component
     
    Last edited: May 10, 2016
    hopeful likes this.
  30. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Are you still planning to bring this kind of flow graph to DunGen?

    I think it would be great! This way, I could setup more possible route to reach the end route, and even a more complex branch.

    What about a corridor generation system? (Where user set up a few needed prefabs to generate a corridor, and let DunGen generates the corridor from the given set of prefab).
     
  31. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Wow, it's really been almost two years since I posted that?

    I'd still love to make those improvements (including what you said about corridors, that was also planned) but it wouldn't just be bringing those features to DunGen; it'll need to be a complete re-design built from the ground up. I'd previously been referring to it as DunGen v3 but it'll more likely be separate from DunGen since - although it'll be a huge upgrade for most people - it doesn't fit all of the requirements of DunGen (specifically, arbitrary sized rooms; the new system would need rooms to be intervals of a set grid size).

    So to answer your question: yes it's still planned, but I don't have anything concrete or short-term to offer I'm afraid (which is why I stopped mentioning it a while back). It's a lot of work and I already have my hands full with other Unity assets and games.
     
    Gekigengar likes this.
  32. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    I remember having the the doors (and props) on their own Layer and tell Rain to exclude that for navmesh calculation. So technical (navigation wise but not sensors) there would be no doors for the AI, but it would trigger the doors to open like the player would, via colider. For locked doors, i had dynamic obstacles that would be removed on unlock. Somwhere is still a demo of that linked in this thread. ^^
     
    Last edited: May 24, 2016
  33. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Hi. I need to know if Dungen works in AOT platforms so there are no JIT compile errors. (such as IOS and other consoles)

    This means no usage of Linq stuff etc..

    Can anyone confirm?
     
  34. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    How difficult would it to make the generation code break down into steps that can be yielded. Ie simulating some sort of async generating so that the main thread isn't blocked 100% all the way, but can yield in many steps along the way so the generation process can have the progress indicator?
     
  35. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    The
    The generator's code is well human readable and you'll find plenty option to grab the progress.
     
  36. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Problem is the whole generation process just blocks main thread. It is not a problem of getting the progress value, but the generation itself blocks the main thread so I have no chance of grabbing any progress during generation.
     
  37. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    I would try to add a class member as a counter that gets increased with each generation step and/or iterator block and read that into a the progression coroutine.
     
  38. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Yeah I would like that too. But there is no point of running the generation progression checking in our own coroutine, because the main thread of the generation BLOCKS the Unity thread so we can't read anything until the process has been finished.

    The map generation itself needs to run in coroutine.
     
  39. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Sorry for being away from the forums for so long. Making the generation run in a co-routine (or otherwise asynchronously) has been on my to-do list for a while; I don't think it's going to be a quick/easy fix, but I'm hoping it will be in the next major version (2.10)
     
    hopeful likes this.
  40. elanthus

    elanthus

    Joined:
    Aug 31, 2015
    Posts:
    1
    Are the rooms in your samples set up correctly? I can't even get those to work. I opened up the 2D sample scene, removed corridor and corner, and I'm seeing lots of half-open doorways, as well as inaccessible and overlapping rooms. Unity 5.3.5f1, DunGen 2.9.1.
     

    Attached Files:

  41. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Sorry, took a lot longer than it should have to figure this one out. Turns out it had nothing to do with half-open doorways, the demo scene just makes it look like that because the tiles are so simplistic.

    The tiles are actually overlapping due to incorrect bounds being calculated. For some reason "Ignore Sprite Bounds" was checked in the 2D demo scene. I've had a couple of support requests that happened to be this exact problem (but I didn't think I'd made the same mistake in my own 2D demo scene :oops:).

    I think in future versions "Ignore Sprite Bounds" will be unchecked by default since it shouldn't affect 3D dungeons anyway, but it's very important for 2D dungeons to have this option disabled.


    TL;DR: Make sure "Ignore Sprite Bounds" is unchecked for 2D dungeons.
     
    hopeful likes this.
  42. ashwinFEC

    ashwinFEC

    Joined:
    May 19, 2013
    Posts:
    49
    jasonMcintosh and hopeful like this.
  43. Randhall

    Randhall

    Joined:
    Feb 21, 2013
    Posts:
    17
    Hey Aegon Games

    You have a bug in the doorway inspector class in the current (2.9.1) version.

    In line 36 you are assigning door rotation flag to blocker rotation flag.
    This makes the tick boxes to avoid rotation non functional.

    Love the generator. Will be looking for any future updates.

    Keep up the good work.
     
    Gekigengar and hopeful like this.
  44. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @AegonGames

    Hi, I see on the asset store that TaD Sewer kit is DunGen ready, has anyone used this out of the box with no modifications to the prefabs?

    Thanks.
     
    Last edited: Aug 6, 2016
  45. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    You don't have to modify the prefabs but you do have to setup all of your doors in DunGen. I believe some of the screenshots that @AegonGames has posted were made with the 3DForge sewer kit as well.

    I've used DunGen with both the sewer kit as well as ManufacturaK4's Underworld pack. The sewer kit was super simple to work with after I defined my doors in DunGen. The Underworld pack, while it worked, was a total pain in the butt to get setup because all of the Underworld cave parts are different sizes. Don't get me wrong, Underworld is beautiful and a great cave pack, but the TaD method Cobus (@S4G4N) uses with the sewer kit's uniform "room" sizes makes using it with DunGen SUPER easy!
     
  46. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @Shawn67

    Thank you for the information, much appreciated ..

    Thanks.
     
    Last edited: Aug 11, 2016
  47. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    I am having the exact same issue with with 2D tiles. I used this tool once before about a year ago and didn't have this issue so it might be something that popped up since then. Perusing through the code, I can't find anything specifically looking for Collider2D components so I decided to add 3D box colliders to my tiles for the heck of it. No luck there either.

    For the record my up vector is set to 0,0,-1 and I have my tiles setup like so:
    example.PNG

    Most of the time things are ok, but sometimes I get results like this:
    bad_scene.PNG
     
  48. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    So I read the above post about sprite bounds after doing some testing with the demo scene. Unfortunately, I don't use sprites in my tiles, just meshes and colliders. For now I simply am working around the issue by placing a deactivated dummy sprite in the tile that fills the whole area.
     
  49. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Thanks for letting me know, it should be fixed in the new beta version.

    Hmm, really DunGen should work with any renderer or collider, so using meshes instead of sprites shouldn't be an issue. Next time you run into the issue, could you select the dungeon in the hierarchy? There should be a red line drawn around where DunGen thinks the bounds of the room should be (calculated by combining the Bounds property of every renderer and collider in the room).



    New Version
    I was kind of hoping for a big feature/improvement to come with 2.10 (async dungeon generation specifically) but I've held some of these changed back long enough and I'm going to be pretty swamped for the near future, so this is going to have to go out as-is.

    I am using DunGen in the project that's eating up my time so I've managed to sneak a few features in that we needed for our own development. We'd also ideally like asynchronous dungeon generation so there's still hope it'll make it in before 2.10 comes out of beta (no promises though, it's a big task).

    Version 2.10.0 (Beta)
    - Download

    - Bugfix Fixed an issue with the 2D demo scene which caused tiles to overlap
    - Change "Ignore Sprite Bounds" in the dungeon generation settings is now unchecked by default
    - Feature Doorways now have a priority for deciding which doorway's "Door Prefab" should be chosen
    - Feature Added an option to specify which layer the tile trigger volume is placed on (Defaults to "Ignore Raycasts", only effective if "Place Tile Triggers" is checked)
    - Bugfix "Avoid Door Prefab Rotation?" for doorways should now be set properly
    - Bugfix Door prefabs should now always be cleaned up correctly


    Asset Kits
    There wasn't really a big marketing push from Unity on this, so there's a good chance a lot of people don't know about the new Asset Kits that Unity are doing. Basically it's a collection of assets to help you create a game of a specific genre or theme. Assets included in the kit are 20% off to Plus subscribers, and 40% off for Pro users (you can buy separate assets as well, no need to buy the entire bundle).

    DunGen was included in the Dungeon Crawler Asset Kit along with some other great assets, so if you're a Unity subscriber and haven't picked DunGen up yet, you can do so at a discount (no rush though, the offer isn't going anywhere for a while). I'd also like to point out that the developer of Multistory Dungeons (also in the asset kit) has included DunGen-ready prefabs, so if you're looking for Diablo-style art, you might want to take a look at that pack.
     
    hopeful likes this.
  50. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    989
    Oh no worries there. It happens about 50% of the time ;) The bounding areas are definately messed up, sometimes they don't even surround the tile they are for. Once I get back to my machine I'll post some steps to reproduce the issue in the dwmo 2D scene.