Search Unity

DunGen - Procedural Dungeon Generation

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

  1. 3DMethods

    3DMethods

    Joined:
    Jul 25, 2016
    Posts:
    2
    Getting strange results with A* Pathfinding and the latest 2.11 Beta. It seems to be generating nav mesh for unused tiles that were used in the layout generation process.
     

    Attached Files:

  2. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    I've just pushed a new beta build with a bug fix which should help. When injecting required tiles to the main path, there was a chance that DunGen would need to backtrack and remove the injected tile. DunGen didn't re-add this injected tile back to the pending list, so it was considered to have been placed successfully; I've fixed this issue in the new beta build.


    This was an issue when generating a dungeon layout synchronously. I think I've fixed it in the new beta build.

    The dungeon generator needs to wait one frame so Unity has time to clean up any GameObjects that were destroyed; but the generator skips by these pauses if told to generate synchronously. I'm working around this now by disabling the GameObject before calling Destroy(). I was thinking about using DestroyImmediate() instead, but I'm sure the last time I tried that in play-mode, Unity dumped a load of warnings to the console so I'm a little reluctant to use that approach.
     
    hopeful likes this.
  3. ToamoaStudio

    ToamoaStudio

    Joined:
    Jul 1, 2015
    Posts:
    13
    Everything works perfectly when I add a rule or more in the inspector! Thanks!!!

    For the problem with injection through code, I found that the problem occure when I inject two or more tiles and I create random floats for their "normalizedPathDepth" (if I choose the floats manualy so that they are not 0, 1 or the same then it works (not sure if this part is comprehensible...)).
     
  4. darrrrUC

    darrrrUC

    Joined:
    Sep 30, 2013
    Posts:
    2
    Ive lurked around but am unable to find the answer. So my question is if this is possible to use for a multiplayer game? My issue is ofcourse that the exact same dungeon needds to be generated for 4 different people. Cheers
     
  5. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Glad it's mostly working for you now.

    Yeah, unfortunately it's always going to fail when trying to inject at 0, 1 or the same place as another required injected tile since they're all considered critical to the generation process. Maybe I should look into allowing it to be more lenient with its placement, so if it can't place it exactly x% of the way through the main path, it can try the tile before/after instead. I'm not sure exactly how I'd achieve that right now though.


    I haven't done it myself but I know a few people are making multiplayer games with DunGen. You can pass the same seed to the generator on all clients to generate an exact local copy of the dungeon on each.
     
    darrrrUC likes this.
  6. darrrrUC

    darrrrUC

    Joined:
    Sep 30, 2013
    Posts:
    2
    Great, Thanks!
     
  7. chalitnc

    chalitnc

    Joined:
    Aug 9, 2012
    Posts:
    13
    With the official release of 5.6.0f3, I had to make the following changes to the UnityNavMeshAdapter integration script :

    Line 71 : x.bakedNavMeshData to x.navMeshData
    Line 78 : surface.Bake() to surface.BuildNavMesh();

    Let me know if I have missed out on anything!
     
  8. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Thanks for pointing this out. I hadn't tried it with the release version of 5.6 yet. I've updated the beta package with these changes.
     
    hopeful likes this.
  9. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    170
    The new update is phenomenal! Very happy with all of the changes and additions.

    I have two concerns, however:

    1) My favorite addition, all thanks to the multithreading support now in Unity, is the asynchronous generation setting. However, am I correct in my observation that the spawners, Random Prefab, Blockers, etc, do not abide by the Max Frame Time constraints? The game makes a very long pause after the dungeon is done generating and it starts to spawn in objects.

    Is this possible, and if so do you have plans to support this? Or can I add or enable it somehow in the current version?

    2) The #1 feature to me at the moment is the ability to constrain the dungeon's generated area space to certain dimensions. That is to say, mark boundaries that the dungeon must not cross during generation. The best I have been able to do is to create a relatively straight dungeon with little to know branch depth, in order to accomplish this.

    If this is not clear, I made a crude illustration:



    My apologies if this has been requested before - I have researched it in the past but couldn't find anything.

    Another asset, Dungeon Architect, supports this feature, and I am very much in need of something similar for my current project. I understand your dungeon generation is much different, but do you think you can add this sometime in the future?

    Thanks.
     
  10. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    hi, 1st time use dungen... no idea how to use it, read the readme.pdf, still completely clueless...

    how do i create 1 level, 2 levels or 4 levels? levels like high ceiling & multilevels?
     
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,011
    This is for a player experience where the player begins at the starting room and works their way along to the end room, which usually contains a boss.

    Within that basic flow, you can have rooms that are multi-level ... you are pretty much free to make whatever rooms you want. You can also randomize the number of rooms in the level and where objects are placed.

    For games where the player is given a quest to accomplish (or a list of tasks), this is a good type of dungeon map.
     
  12. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    2.11 Beta 4 Released

    Asynchronous generation has been improved, an optional dungeon boundary has been added, and some other minor fixes/improvements.


    I hadn't considered the possibility that prop placement might benefit from asynchronous generation. I've added support for this in the new beta build. Thanks for pointing it out.

    I've also added support for providing an optional AABB (axis-aligned bounding box) boundary that dungeon tiles must be placed inside. Enabling this option might increase generation times if the bounds are too small as DunGen will have to retry more often.


    I've just finished completely re-writing the documentation for 2.11 (beta). There is some 2.11 specific stuff in there, but most of it should be applicable if you're using a stable build. Hopefully it's easier to follow now.

    There's nothing special about multi-floor dungeons - just add a doorway that's not at ground height.
     
    matteumayo and hopeful like this.
  13. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    Code (csharp):
    1.  
    2. OutOfMemoryException: Out of memory
    3. System.Array.Resize[GameObjectChance] (DunGen.GameObjectChance[]& array, Int32 length, Int32 newSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Array.cs:1929)
    4. System.Array.Resize[GameObjectChance] (DunGen.GameObjectChance[]& array, Int32 newSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Array.cs:1913)
    5. System.Collections.Generic.List`1[DunGen.GameObjectChance].set_Capacity (Int32 value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:622)
    6. System.Collections.Generic.List`1[DunGen.GameObjectChance].GrowIfNeeded (Int32 newCount) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:100)
    7. System.Collections.Generic.List`1[DunGen.GameObjectChance].Add (DunGen.GameObjectChance item) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:91)
    8. DunGen.DoorwayPairFinder.CalculateOrderedListOfTiles () (at Assets/Extensions/DunGen/Code/DoorwayPairFinder.cs:87)
    9. DunGen.DoorwayPairFinder.GetDoorwayPairs (Nullable`1 maxCount) (at Assets/Extensions/DunGen/Code/DoorwayPairFinder.cs:58)
    10. DunGen.DungeonGenerator.AddTile (DunGen.Tile attachTo, IEnumerable`1 useableTileSets, Single normalizedDepth, DunGen.DungeonArchetype archetype, TilePlacementResult result) (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:616)
    11. DunGen.DungeonGenerator+<GenerateBranchPaths>c__Iterator3.MoveNext () (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:519)
    12. DunGen.DungeonGenerator.Wait (IEnumerator routine) (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:146)
    13. DunGen.DungeonGenerator+<InnerGenerate>c__Iterator1.MoveNext () (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:220)
    14. DunGen.DungeonGenerator.Wait (IEnumerator routine) (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:146)
    15. DunGen.DungeonGenerator+<OuterGenerate>c__Iterator0.MoveNext () (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:137)
    16. DunGen.DungeonGenerator.Wait (IEnumerator routine) (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:146)
    17. DunGen.DungeonGenerator.Generate () (at Assets/Extensions/DunGen/Code/DungeonGenerator.cs:91)
    18. DunGen.Editor.DungeonGeneratorWindow.GenerateDungeon () (at Assets/Extensions/DunGen/Code/Editor/Windows/DungeonGeneratorWindow.cs:53)
    19. DunGen.Editor.DungeonGeneratorWindow.OnGUI () (at Assets/Extensions/DunGen/Code/Editor/Windows/DungeonGeneratorWindow.cs:34)
    20. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    21.  
    22.  
    using dungen 2.11b4 unity5.6.0f3
     
  14. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    hi,

    how do i create 1 corridor to 1 room or 2/3 corridors to a room

    So far i can only create room to room...

    My Train Archetype
    Branching Depth 1-2
    Branch Count 3-4
    Straighten 1

    but no matter how i change the numbers i cannot get 1 corridor to 1 room...
     
    Last edited: Apr 25, 2017
  15. NightCode

    NightCode

    Joined:
    Jan 10, 2016
    Posts:
    1
    @OP3NGL Looks like you have ran out of memory. What are your computer specs? Maybe try generating a small dungeon?
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,011
    I don't think DunGen is designed to work that way. You could probably get closer to what you want by either a) making a special door piece that only joins to corridors, or b) including the corridors as part of the rooms.
     
  17. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    159
    Hi! DunGen looks great and I'm strongly considering purchasing it.

    However, I do have one concern, and I'd like to find hear from others who have used this plugin to see how they find it.

    It appears that each room (or "tile" as the correct terminology seems to be) must be saved as a Prefab asset. My worry here is that making modifications to common elements like collision would be laborious.

    Let's say I create 100 tiles, but then I need to change the Layer that my wall colliders use for some unforeseen reason. I'd have to go through every single tile and change every single wall collider individually (as opposed to say, a tile being a collection of prefabs, and you'd only need to change the single prefab once and it would propagate out to all instances in all tiles).

    Has anyone found this to be a problem? Is there any potential workaround if so?
     
  18. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    170
    @CrowbarSka

    You can do things like have spawners (of which DunGen's are fantastic) in the tile prefab that spawn another prefab in order to achieve a nested-prefab-like system. Depending on your workflow, you can make one tile seem like many different tiles using this method.

    If you do need a nested-prefab based workflow that works with DunGen, I can vouch for Visual-Design-Cafe's nested prefab system that just came out a few weeks back. Be wary, of course, as it's a new asset.
     
    Dwight_Everhart likes this.
  19. CrowbarSka

    CrowbarSka

    Joined:
    Dec 15, 2009
    Posts:
    159
    That seems like a great approach for getting some variation, but I'm thinking more along the lines of the bare bones prefabs that make the foundations of my project. I've worked on projects where changes to the basic building blocks have popped up like maybe 50-75% of the way through development, and at that point you really need a good system where you can just tweak a prefab and have it take effect throughout the whole game instantly.

    I'll check out that nested prefab system though. Thanks for the suggestion :)
     
  20. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    i7-7700k
    16gb
    1080 ti

    I got another question.... How do I bake lightmaps in dungen?
     
    Last edited: Apr 26, 2017
  21. katasteel

    katasteel

    Joined:
    Nov 21, 2014
    Posts:
    189
  22. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    280

    hmm the links are not working?
    have you tried with automated portal generation in apex ?
    (dont know if that helps)

    need to try apex with dungen on the weekends myself
     
  23. spvn

    spvn

    Joined:
    Dec 10, 2013
    Posts:
    35
    Hey very interested to buy dungen, but does anyone have experience with using it alongside Probuilder? Would the following workflow be feasible?

    1. Build a ton of individual rooms/levels in probuilder
    2. Use dungen to randomise levels for each playthrough of the game by procedurally picking from this pool of levels to link together.

    From what I've read this all seems feasible, any thoughts? Thanks
     
  24. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    280
    whats basically what i use it for
    works nicely :)
    just be aware of the limitations (doors on the "edge of the rooms")
    one criticial path

    but apart from that its great :)
    if you are using probuilder i would also take a look at archimatix and surforge
     
  25. katasteel

    katasteel

    Joined:
    Nov 21, 2014
    Posts:
    189
    It is all one grid.
    Auto portal connections are to navigate from one grid to another.
    But because of the gap it doesn't think it is traversable.

    Also this only happens once in a while, but it is "game breaking" when it happens.
     
  26. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,615
    A few questions before I buy.

    Are we able to use our own FBX files , such as walls, floors etc?? I know within reason to certain sizes, so I'm thinking modular walls. I just i'm not interested in basic walls with no real design, and I want to make sure I'm able to use my own with in reason.

    I see you support Sector, I use World Streamer. So not sure if anyone has used it with World Streamer or not.

    Last Apex Path, which should work, really but wanted to see if anyone has successfully. Not to worried because if it don't I make my own with some games anyways. This asset would be for a new game.

    Thanks! for any info, this has been on my wish list.

    PS: Which platforms does it support, PC , Android,IOS, XB1, PS4?
     
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,011
    Just in case the dev doesn't get back to you right away ... I'll give you my impression of this kit. This is a logical framework for attaching one room to the next, with a flow of going from what you have designated as a starting room, through various other rooms you have specified, to an end room. So it's for the classic dungeon crawl from the entrance to the boss in the final room, but not necessarily for simulating real spaces. You supply all the art ... the walls, the floor and ceiling, colliders, the lighting, the encounter spawn points, door art, and so on. DunGen assembles the rooms according to a flow map you create, plus a dash of random generator seed. Pieces within rooms can also be set to randomly appear, so you can have variations in room decoration.

    As for special rules, as you might imagine, you have to design each room of yours so that at least one door is on the edge of the bounding box, and for rooms that will be in the middle, they'll obviously need at least two doors. If you make doorways that aren't used in the random generation, they can be filled with "door blockers" that you specify.

    While DunGen supports some branching, it does not make loops or intersections. If you want a loop or intersection, you'd need to cleverly place the whole loop or intersection within a room.

    DunGen does assist with the placement of locked doors and keys, such that keys will spawn before a locked door is placed.

    As for SECTR, DunGen is only set up to use VIS. If you wanted to do other SECTR stuff, you'd manage that on your own.

    As for navmesh, you'll need something that makes a mesh at runtime, or some sort of alternative.

    Since it's just C# scripts doing random generation, I would imagine it works on all platforms.

    If you need an official response right away, it's probably best to use the support email address.
     
    Aegon-Games and recon0303 like this.
  28. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,615
    Thanks for the detailed reply now this will do just fine, I was looking at this one and the other one on the store to see which one fits my needs. Thanks!
     
  29. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    in dungen, how does one bake lightmaps?
     
  30. gearedgeek

    gearedgeek

    Joined:
    Jun 19, 2015
    Posts:
    146
    Is there any beginning tutorial video on how to create a basic level with Dungen?
     
  31. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    I was wondering if there is way to force the tiles to spawn in a way that some of tilesets never self connect with itself.

    For example, if I have a room type tile sets and corridoor type tile sets, I always want the rooms to be connected only by the corridoor ( or any other types than itself ). So they are conntect like room->corridoor->room->corridoor etc.. ?

    I know there is allow immediate repeat option but it is only for a tile not per tilesets.
     
  32. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    I also get on XboxOne

    ExecutionEngineException: Attempting to JIT compile method 'System.Linq.OrderedEnumerable`1<DunGen.DoorwayPair>:CreateOrderedEnumerable<single> (System.Func`2<DunGen.DoorwayPair, single>,System.Collections.Generic.IComparer`1<single>,bool)' while running with --aot-only.

    :(
     
  33. henmachuca

    henmachuca

    Joined:
    Oct 14, 2016
    Posts:
    95
    Hello, Guys...
    is there any video tutorials helping set it up?
    I'm having a hard time doing so.

    Thank you
     
  34. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Sorry I've been away from the forums for so long. I'll try to answer as many unanswered questions as I can.


    Generally, you wouldn't bake lightmaps in a procedurally generated environment - you'd have to rely on dynamic lighting only. From this thread, it looks like it might be possible to bake lightmaps and save them with a prefab, but I haven't tried it.


    Unfortunately, I haven't got any real tutorial videos for DunGen. The closest thing is this video, but it's a few years old now and is just me running through the creation of a simple dungeon - there's no instructions.


    There's no option out-of-the-box, but it should be possible with some source-code tweaks by setting up separate doorway types for rooms and corridors and using custom matching logic. I've posted about it before here.


    It looks like a LINQ method I used in 2.11 doesn't work on AoT platforms. Can you please try this new build and see if it works now? I can't test it myself.
     
  35. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    @AegonGames


    Hi, I have tried the new beta , but it still has the same issue :

    ExecutionEngineException: Attempting to JIT compile method 'System.Linq.OrderedEnumerable`1<DunGen.DoorwayPair>:GetEnumerator ()' while running with --aot-only.

    this one is on line :

    at DunGen.DoorwayPairFinder.OrderDoorwayPairs (IEnumerable`1 potentialPairs, Int32 count) [0x00031] in E:\Pixellore\Remilore\UnityProject\Assets\DunGen\Code\DoorwayPairFinder.cs:82
    at DunGen.DoorwayPairFinder.GetDoorwayPairs (Nullable`1 maxCount) [0x0005d] in E:\Pixellore\Remilore\UnityProject\Assets\DunGen\Code\DoorwayPairFinder.cs:73
     
  36. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    Ok, I have another problem.

    @AegonGames

    When you use priority for doorway connectors, it uses the corresponding prefab correctly, but it doesn't correctly use the rotation of the doorway that has more priority.

    What I mean is that out of two doorways it should always use the doorway orientation of the higher priority one but sometimes it uses the other doorway's orientation. This causes the doorway prefabs to rotated in opposite direction sometimes. This needs to be fixed asap please.

    -- Edit --

    I have have actually fixed this by making the MakeConnection function to use choosen door as transform source instread. I still think this is a bug.. or better because it will work either way if it is changed to use choosen door. It would be nice to have this included in the official version.
     
    Last edited: May 12, 2017
  37. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Hopefully this new beta build will resolve both of the issues you're having.


    V̶e̶r̶s̶i̶o̶n̶ ̶2̶.̶1̶1̶.̶1̶ ̶(̶B̶e̶t̶a̶ ̶5̶)̶ - Now available on the Asset Store
    Available on Asset Store as of 23rd May 2017
    Updated: 19th May 2017


    Features
    • [New in Beta 5] Tiles can now optionally designate entrance and exit doorways (available by manually adding a Tile component to your tile)

    Changes
    • Door prefabs will now always take on the transform of the Doorway that spawned it
    • [New in Beta 2] "Allow Immediate Repeats" now defaults to true to avoid confusion when testing DunGen with a setup that has only one tile. It's still possible to override this behaviour both globally and on a per-tile basis
    • [New in Beta 3] The DungeonGenerator class has a new "Retrying" event that is fired whenever DunGen has to retry the entire dungeon layout

    Bugfixes
    • JIT errors should no longer be thrown on platforms that require AoT compilation (such as Xbox One & iOS)
    • [New in Beta 2] Fixed an error preventing use of the PlayMaker integration
    • [New in Beta 3] Fixed a rare issue that caused rooms with vertical doorways to sometimes be flipped upside-down
    • [New in Beta 3] Fixed an issue that caused the dungeon generator to incorrectly revisit certain statuses (PostProcessing, Complete), thus making multiple calls to the OnGenerationStatusChanged event
    • [New in Beta 4] Fixed multiple errors with the dungeon flow editor window
    • [New in Beta 4] Fixed an OutOfMemoryException that could occur when a tile had a weight of zero
     
    Last edited: May 24, 2017
    hopeful and castor76 like this.
  38. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    Hi @AegonGames

    Thanks for the update. I think the door prefab rotation problem is now fixed!
    Sadly, I found some other issues.
    Sometimes, the doorway spawns blocker prefabs on the spot where they are actually connected. This happens around 1 out of 20 times for my setup. So the rooms are connected, but there is blocker prefab spawned as well as connector prefab.

    When this happens the connector prefab seems like spawning after some progress and not parented under the doorway prefab and the problematic blocker prefab is created and parented under the doorway prefab.

    This absolutely can't happen as the players will be furious at such set up after playing for hours only to find out that they can't complete the game. It's a critical bug.
     
    Last edited: May 12, 2017
  39. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    88
    I found a problem that stairs go through rooms sometimes, anyone knows if it can be fixed?
    And anyone knows what are the Locked Door Prefabs which is below the tiles list?
     
  40. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    215
    map1.JPG

    As you can see my AStar path is broken. I get multiple graphs when I use it with the built in Adapter. Any Ideas?
     
  41. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Unfortunately, I haven't been able to reproduce the issue you're seeing. I ran a script for an hour that constantly generated dungeon layouts and checked to see if there were any doorways with both a connector and a blocker prefab, but it didn't find any. Just to be sure it wasn't a bug in the validation script, I manually checked over 100 dungeon layouts. Whatever the issue is, it seems to be implementation-specific and not something that happens in all circumstances.

    Connector prefabs not being parented to the doorway is by design to avoid doors from being culled with the rest of the room.

    Is there any more information you can give me about your specific setup that might help? If you could manage to reproduce the issue in a small test project (without any game assets/scripts) and email it to me that would be extremely helpful.


    DunGen should automatically calculate correct bounding boxes for your tiles, but if you're seeing problems you can manually override it by adding a Tile component to your tile prefabs and checking the "Override Automatic Tile Bounds" checkbox. This will let you manually enter values for the tile's bounding box.

    The "Locked Door Prefabs" field is a list of prefabs that are placed in doorways that are marked as locked by the Lock & Key System. See the TileSets included in the demo scene as an example.


    Are the breaks at narrow passages in your layout? It looks like you might need to decrease the voxel size in A* Pathfinding Project Pro (sorry, I can't remember the exact name of the field).

    If the breaks in the NavMesh are at doorways and you're using door prefabs, you'll also need to follow the steps in the "Handling Doors" section of the documentation on page 39 to stop the doors from being considered unwalkable.
     
    hopeful likes this.
  42. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    158
    Thanks for your continuous support!

    How to tell if Dungeon Generation was Successful?
    There is OnGenerationStatusChanged with GenerationStatus.Complete and RegisterPostProcessStep, but those fire every Try. Expected behaviour would be, that it is done with GenerationStatus.Complete, but that happens multiple times and it seems the generation atempt may still fail after that step. How to tell everything is Ready to go, for NavMeshGeneration for example?
     
  43. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    215
    That was it exactly. I should have know as I rolled my own similar solution before you had yours. I like yours better.

    Here is another issue that you may find or may have good input on. I have MOBS generated in DunGe, like GlobalProps. Apparently these are created before the navmesh is calculated, and the mesh goes around them leaving holes and or disconnects where the MOB is located. Any ideas on a way around this?
     
    hopeful likes this.
  44. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    It looks like that was a bug introduced with the asynchronous generation in 2.11. I've updated the beta build with a fix; PostProcessing & Complete states should now correctly be entered no more than once per Generate() call.


    If possible, I'd handle this case by assigning any moving objects such as enemies to layers/tags that aren't considered unwalkable by the NavMesh generator. A* Pathfinding Project Pro has both a "Layer Mask" and "Tag Mask" field under the recast graph options to do this.

    Of course that could be a problem if you're already using layers or tags for other logic. The RegisterPostProcessStep() call from the BaseAdapter class assumes you want the logic to run after built-in DunGen post-processing functions, but it's easy enough to change the code to make it run earlier. I'll look into exposing that as a UI option in the next version.
     
    Binary42 likes this.
  45. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Sorry for the rapid-fire beta builds. I've just pushed 2.11.1 beta 4; This one should fix the OutOfMemoryException that a few people have been seeing.
     
    hopeful likes this.
  46. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    158
    Diddn't fix it, still gets called/set per retry. But its not that critical at the moment (for me).
     
  47. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    @AegonGames

    I have sent you email with bug about the blocker spawning at the same place and connector. Please have a look at it asap.

    Thanks.
     
  48. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    433
    Sorry, I'm not sure how this happened but I somehow managed to overwrite that change in a later beta build. The new 2.11.1 Beta 5 should have that fix merged back in.


    Thanks for that; I was able to reproduce the issue. It was caused by DunGen revisiting the Branching step and adding additional tiles to the end of a previously capped branch. It was supposed to have been fixed in Beta 3 but I messed it up somehow. The new beta build should fix it though.
     
    Binary42, hopeful and castor76 like this.
  49. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,507
    Excellent. I will try that!
     
  50. ToamoaStudio

    ToamoaStudio

    Joined:
    Jul 1, 2015
    Posts:
    13
    Hi,

    I have a problem : when I put 0 on a tile weight, the tile appear every two room instead of not appearing at all.


    Also I have a little question : is there a way to tell the generator to have a defined number of branches (per dungeon and not per tile) ?
     
unityunity