Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

DunGen - Procedural Dungeon Generation

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

  1. IsntCo

    IsntCo

    Joined:
    Apr 12, 2014
    Posts:
    141
    Is there a way to disallow certain tiles to repeat at all? I know there is an option for Disallow Immediate Repeat, but I don't want any of my tiles to repeat at all. I have 50 tiles and want them to only appear 0-1 times.
     
  2. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    There wasn't, but I was able to add this option to the latest beta build. I haven't done much testing yet since there aren't many tiles in the demo scene; I could only try it with short dungeons.

    Version 2.11.6 - Now Available on the Asset Store

    Available on the Asset Store as of 19th February 2019
    Be sure to backup your project before updating to a beta version of DunGen

    Changes

    • Most DunGen components now support editing multiple selected objects
    • All inspector lists are now re-orderable
    • Added some in-editor tooltips to properties that didn't already have them
    • The Tile and RuntimeDungeon components now also allow for editing bounds in the scene view
    • There is now an option to disallow any tile repetition. This can be done on a per-tile basis or overridden globally in the dungeon generator

    Bugfixes

    • Fixed an issue preventing the dungeon generating from working until the scene/editor is restarted after finding an issue with the dungeon layout
    • SECTR VIS integration will now correctly use the already calculated tile bounds instead of its own. This should prevent any gaps from forming between sectors (resulting in incorrect culling)
    • Fixed an issue causing some DunGen components to not save correctly when edited in the new prefab editor in Unity 2018.3
    • Undo/redo should now work consistently
     
    Last edited: Feb 19, 2019
  3. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    195
    I know i asked that before but maybe i missed couple of developments last year or so, does dungen supports Symmetric dungeons generations?
     
  4. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Sorry, there's no way to generate symmetrical dungeons.
     
  5. phosphorous_

    phosphorous_

    Joined:
    Jul 25, 2016
    Posts:
    30
    How does DunGen work with the new prefab system? I noticed there are updates related to that, but is it now so that you can define a room using the new prefab editor (including door prefabs, props etc)?
     
  6. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Sorry for the late reply.

    You can make any DunGen prefabs using the new prefab editor. For the most part, everything works the same in 2018.3 except that - thanks to the new prefab system - prefabs are made in a separate editor and can now be nested properly.

    For DunGen, this means that you can now safely use prefabs for things like doorways and props that you couldn't previously do without running into issues with nesting.
     
    hopeful likes this.
  7. docalypse

    docalypse

    Joined:
    May 29, 2018
    Posts:
    3
    I am currently prototyping a game using DunGen and 3DForge Interior for my tilesets. Upon real-time generation entering play mode, my editor slows to a crawl and I can not figure out why. A test build of the game does not cause this issue fortunately, but it makes working within the editor to test aspects of the generated dungeon extremely difficult. I have tried disabling any lighting assets, disabled generate lighting, dungeon flow is for a small dungeon, removed 1 tile at a time from the tileset. Besides the slowdown, everything works perfect. Is there some setting or an asset from 3DForge Interiors causing this issue?

    PC specs:
    Titan X
    i7-4770k
    16gb ram
    Unity and project on SSD

    Using Unity 2018.3.3f1
     
  8. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    I can't think of anything that DunGen does that would cause this. You'd have to use the profiler to see where the problem is. Since it only happens in the editor, you might need to enable 'Profile Editor' as well.
     
  9. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Does it support unity 5.6?
     
  10. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    I had to check to make sure everything still works with 5.6 (specifically, I tested 5.6.6f2). Everything seems to be working properly.

    With that said, I develop DunGen on Unity 2017.1 and can't guarantee that it will continue to work on older versions in the future. If any issues arise, I'll try to fix them to support Unity 5 but officially only 2017.1 and higher are supported.
     
  11. IsntCo

    IsntCo

    Joined:
    Apr 12, 2014
    Posts:
    141
    @Aegon-Games The Sectr Vis culling issue is back with the latest version of DunGen:

    https://gyazo.com/e392f9bfaadc802a9df2b7be83b49204

    It was working fine before I upgraded to the latest DunGen.
    When I open a door, it doesn't stop culling the connected portal. If I cast a light in that direction, it stops culling. If I walk into that room/portal, it stops culling. But if I am standing back away from the open door, culling still happens.

    The door uses the DunGen Door script to manage isOpen correctly.
    I have tried various Extra Bounds values as well.

    What's the issue?
     
  12. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    Hi how do I know that the basic room culling works? When I go to scene view while in play mode it doesn't display the culled areas like when I use the occlusion culling in unity
     
  13. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    There's no real way to visualise the basic room culling in the current version outside of maybe forcing your scene to render in wireframe mode. I've added the option to visualise culling in the scene view in the newest beta build.


    Version 2.11.7b3 - Now Available on the Asset Store
    Be sure to backup your project before updating to a beta version of DunGen
    Available on the Asset Store as of 23 April 2019


    Features
    • [New in Beta 3] Added a 'Branch Mode' option to the dungeon flow allowing users to optionally specify the number of branches that should appear globally across the entire dungeon, rather than locally per-tile
    • A more comprehensive validation tool has been added to help find any errors when setting up a dungeon. This can be accessed using the "Validate" button in the DungeonFlow asset inspector. More validation rules could be added over time, here's what it currently validates:
      • DungeonFlow is assigned
      • At least one line segment
      • At least two nodes
      • Every line segment has at least one archetype assigned
      • All archetypes assigned to line segments are non-null
      • Every node has at least one tileset assigned
      • All tilesets assigned to a node are non-null
      • Every archetype has at least one tileset assigned
      • No tilesets assigned to an archetype are null
      • Every tile in a tileset is non-null
      • No tile has a weight set up in such a way that the tile would never appear in the dungeon
      • Every tile has at least two doorway (except those that appear only as a start node, goal node, or branch cap)
      • Every doorway has the same axis-aligned up vector
      • Every doorway is facing outwards from the tile

    Enhancements
    • [New in Beta 3] Creating a new DunGen asset will now allow the user to specify a file name
    • [New in Beta 3] Some improvements for the DungeonFlow inspector
    • BasicRoomCullingCamera now has an option to also cull in the editor scene view
    • Improved performance of BasicRoomCullingCamera in scenes with a lot of renderers
    • Foldout labels can now be clicked to expand the foldout
    • The old dungeon validation is now only run inside the editor for a minor performance improvement in packaged builds
    • Doorways now also draw their expected up-vector to make it clearer which way they should be facing
    • Adapters (such as integration for SECTR VIS and Unity's NavMesh) will no longer fail silently if attached to a GameObject without a RuntimeDungeon component
    Bugfixes
    • [New in Beta 3] Fixed an issue that caused dungeons with a single line segment to generate a different layout using the same seed
     
    Last edited: Apr 28, 2019
    matteumayo and camta005 like this.
  14. dinaloraven234

    dinaloraven234

    Joined:
    Dec 20, 2018
    Posts:
    141
    When I download the beta build it says invalid request
     
  15. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Seems to be working for me. Could you try it again please? If it still doesn't work, send me an email with your invoice number to support@aegongames.com and I'll send you the package manually.
     
  16. danbusuttil

    danbusuttil

    Joined:
    Oct 12, 2017
    Posts:
    3
    Hey Aegon Games, I am currently working with Dungen. At runtime what is the best way of having a new dungeon generation spawn with the start room connecting to a previous dungeon already in the scene without the two dungeons overlapping?
    Big fan of you're Dungen system
    Thanks
     
  17. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    There's no way to do that out of the box, but if you're okay with changing the source code, it should be possible. Here are a few areas in DungeonGenerator.cs to look into:

    • GenerateMainPath() - Around line 439 we choose a room to attach to. This is usually null for the first room in the main path. Theoretically, you should be able to use the last room of the previous dungeon, but I haven't tested this.
    • IsCollidingWithAnyTile() - Right now this checks for collisions against every room in the current dungeon, but it could be adapted to instead check every room across multiple dungeons.
     
  18. danbusuttil

    danbusuttil

    Joined:
    Oct 12, 2017
    Posts:
    3
    Perfect, that's exactly what i needed!
     
  19. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    664
    Last edited: Mar 7, 2019
    Aegon-Games likes this.
  20. BDFgames

    BDFgames

    Joined:
    Apr 17, 2015
    Posts:
    26
    Hi there. Like Griffo above, I'm revisiting DunGen. When I last looked at it, your asset would only reliably create dungeons with a single path. Multiple paths would occur on occasion, but there was no reliable way to ensure it.

    For my new project, I'm looking at DunGen again, but the project requires dungeons that always have multiple paths from end to end. Is that possible with DunGen now?

    Thanks for your time. :)
     
  21. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Multiple looping paths is by far the most requested feature. Unfortunately, DunGen still doesn't support deliberately making looping paths and I don't think it ever will.


    I've touched on this a few times but never really explained why it's such a huge problem, so here's my understanding of the issue. Maybe someone else can suggest a solution:

    An attempt to explain the problem with supporting looping paths for anyone who's interested
    Looping paths present a technical challenge that I'm not sure is solvable due to the way DunGen works. You can have any number of arbitrarily sized/shaped rooms with 2+ doorways that can also be placed almost anywhere. That works fine when just building a dungeon out into space since it doesn't really matter where the last room in a path ends up; but for looping paths, DunGen needs to somehow use these rooms to bridge the gap between two or more existing points (while adhering to a set of user-defined constraints no less).

    It's almost like inverse kinematics, but with a variable number of bones that can all be swapped out with different settings and each only has a few possible arrangements to try to reach their target rather than having a full range of motion.

    The only possible solution I've come up with is to connect doorways with procedural corridors so it doesn't really matter if a room doesn't connect where it needs to, I can just make a corridor to finish the job. But that would be difficult without first restricting rooms to a set grid size, and I can't just add a huge restriction like that to a new version of DunGen.
     
    Dwight_Everhart likes this.
  22. BDFgames

    BDFgames

    Joined:
    Apr 17, 2015
    Posts:
    26
    Thank you. I appreciate the detailed response. :)
     
  23. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    664
    Hi,

    Can someone please tell me when and where I can get a callback to say DunGen has finished generating the dungeon, thanks.
     
  24. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Here's a snippet showing how to get a callback when the dungeon is finished generating: link
     
    hopeful and Griffo like this.
  25. nhancaosi

    nhancaosi

    Joined:
    Apr 29, 2018
    Posts:
    4
    Hi,

    I am not very good at designing. Are there places where I can buy premade tile and add them to the dungen?
    Anybody experienced with the Multistory Dungeons from Mana Station?
     
  26. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    664
    Hi,

    Anyone know why my NavMesh does this when using BuildNavMesh()

    EDIT : It was caused by a script that bakes light textures into prefabs.

    Pic_00.png Pic_01.png Pic_02.png
     
    Last edited: Mar 14, 2019
  27. rrahim

    rrahim

    Joined:
    Nov 30, 2015
    Posts:
    182
    Regarding this issue, is it possible to allow the user to enable a "multiple paths" option, which in turn *requires a hub room, which is a room with multiple doors (always the amount required for the specified multiples of paths). This hub room will basically allow all branching paths to eventually meet at a specified point.
    Further to that, possibly add the ability to add multiple hub rooms, from which the system can choose (if the developer requires randomly different hub room).
     
  28. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    664
    Hi @Aegon-Games

    When I build levels normally I add a volume around areas and in them volumes I generate random waypoint for the enemy to patrol, wha I'd like to ask is it possible to do the same on a random generate dungeon like in the pictures below?

    I noticed you have red bounding boxes around the prefabs, so could I split the dungeon say into 4 sectors by dividing the total sections by 4 then adding each sections bounds together to get on big bounds of that section? Can I save the prefab to a List from 1st to last? I'd appreciate it if you could point me in the right direction.

    Thanks.

    Pic_00.png Pic_01.png Pic_02.png
     
    Last edited: Mar 14, 2019
  29. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    88
    So, absolutely love the asset. Though i got a few questions i can't find the answers to.

    First off, how do you save a spawned dungeon? The documentation doesn't have anything on saving a dungeon once you create it. Is there a component? An Easy Save component that everyone uses? Some serializer somewhere?

    Second, assuming i want to randomly generate multiple floors using the default dungeon flow (start, miniboss, boss, goal), with an option to reroll the dungeon or save it. Should i be making a scene for each floor, or is it easier to 1 scene, and just store the seeds and recoil them? Or just create a giant 10k room dungeon with multiple boss's and mini-boss's along a single path, with random goal rooms along the way?
     
  30. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,108
    I think all you save is the seed ... the random number that generates that dungeon. The idea is that it should regenerate the same dungeon each time.
     
  31. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    88
    That would effectively re spawn everything in that dungeon. I'm hopeful for a solution that preserves the actual dungeon gameobject and everything in it, as revisting a dungeon the way you left it is fairly important to what i got in my current design.
     
  32. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,108
    Oh, I see what you mean. Saving the state of an in-play dungeon. I suppose that in addition to the seed, each dynamic object prefab that instantiates would have to save its state to a "current dungeon" file when a "save game event" occurs.

    I haven't used Easy Save, but I imagine this would be a typical usage ...?
     
  33. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    I don't really have any experience using Multistory Dungeons, but I know it has some first-person and some top-down room prefabs already set up for use with DunGen.


    Supporting multiple paths isn't too difficult in itself. It would require a fairly major overhaul to the way the dungeon generator works, but it's definitely solvable. However, having these paths be able to reconverge back into a single path at some point is a real challenge.


    The Dungeon class contains all the information about a completed dungeon layout. After DunGen is finished generating, you can access the "CurrentDungeon" property inside the DungeonGenerator class.

    Something like this:

    Code (CSharp):
    1.  
    2. private void OnDungeonGenerationStatusChanged(DungeonGenerator generator, GenerationStatus status)
    3. {
    4.    if (status != GenerationStatus.Complete)
    5.        return;
    6.  
    7.    const int sectionCount = 4;
    8.  
    9.    var dungeon = generator.CurrentDungeon;
    10.    var tiles = dungeon.MainPathTiles;
    11.  
    12.    int tilesPerSection = Mathf.CeilToInt(tiles.Count / sectionCount);
    13.    var sectionBounds = new List<Bounds>();
    14.  
    15.    var currentSectionBounds = new Bounds();
    16.    int tilesInCurrentSection = 0;
    17.  
    18.    for (int i = 0; i < tiles.Count; i++)
    19.    {
    20.        if (tilesInCurrentSection == 0)
    21.            currentSectionBounds = tiles[i].Bounds;
    22.        else
    23.            currentSectionBounds.Encapsulate(tiles[i].Bounds);
    24.  
    25.        tilesInCurrentSection++;
    26.  
    27.        if(tilesInCurrentSection >= tilesPerSection)
    28.        {
    29.            sectionBounds.Add(currentSectionBounds);
    30.            tilesInCurrentSection = 0;
    31.        }
    32.    }
    33.  
    34.    // Just create some boxes around the sections, you'd do something more useful here
    35.    foreach(var section in sectionBounds)
    36.    {
    37.        var obj = GameObject.CreatePrimitive(PrimitiveType.Cube);
    38.        obj.transform.localScale = section.extents * 2f;
    39.        obj.transform.position = section.center;
    40.    }
    41. }
    42.  
    Alternatively, the Tile class has a property called "Placement" which keeps track of used doorways and which adjacent tile they are linked to. That information could be used to determine which rooms are contained within a given neighbourhood.


    There's no built-in solution for saving the state of a generated dungeon. Saving the seed gets you most of the way there, but anything that changes during the course of gameplay (enemies, treasure chests, etc) would need a method of serializing their state to a file. When loading, you can re-generate the dungeon using the saved seed, then load the saved state back into any gameplay objects that need it.

    Unfortunately, I'm not familiar with any saving/loading assets. The one game we made using DunGen doesn't require persistence and for the game we're working on now (not using DunGen), I'm writing my own save/load system built on top of Json.NET

    For your second question, personally I'd just use the one scene and re-use a single dungeon generator.
     
    Griffo likes this.
  34. RealMTG

    RealMTG

    Joined:
    Jul 27, 2013
    Posts:
    318
    Hello!

    Here is a random thing for you.
    I just started using DunGen for a prototype and quickly grew frustrated with the Doorway inspector and the lack of being able to click the label on the foldouts to make it expand, and that it doesn't stay open. So I went in and fixed it. Here's how I did it if you're interested. It's a small thing but it makes my experience a lot better, and maybe will do so for others too!

    In DoorwayInspector, starting on line 109, I replaced
    Code (CSharp):
    1. showConnectors = EditorGUILayout.Foldout(showConnectors, connectorsLabel);
    2. if (showConnectors)
    with
    Code (CSharp):
    1. #if UNITY_5_5_OR_NEWER
    2. priorityProp.isExpanded = EditorGUILayout.Foldout(priorityProp.isExpanded, connectorsLabel, true);
    3. #else
    4. priorityProp.isExpanded = EditorGUILayout.Foldout(priorityProp.isExpanded, connectorsLabel);
    5. #endif
    6. if (priorityProp.isExpanded)
    I then did a similar thing with blockers but used "avoidBlockerPrefabRotationProp.isExpanded" instead.

    The #if UNITY_5_5_OR_NEWER is to keep compatibility because I believe that in 5.5 they added the "toggleOnLabelClick" overload for Foldouts. And then I use the .isExpanded property on some random serialized property because all of the serialized properties have it and it gets saved. It doesn't even matter if the serialized property is a foldout, a boolean, or anything else.

    Maybe there are more of these around. I haven't had much of a look around yet.
    Just thought I would share this. :)

    EDIT: I have more editor workflow improvements if you're interested. Especially related to the ScriptableObjects and their creation. And I'm all for backwards compatibility so I even include it in my project.
     
    Last edited: Mar 22, 2019
  35. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    88
    [QUOTE="Aegon-Games,

    There's no built-in solution for saving the state of a generated dungeon. Saving the seed gets you most of the way there, but anything that changes during the course of gameplay (enemies, treasure chests, etc) would need a method of serializing their state to a file. When loading, you can re-generate the dungeon using the saved seed, then load the saved state back into any gameplay objects that need it.

    Unfortunately, I'm not familiar with any saving/loading assets. The one game we made using DunGen doesn't require persistence and for the game we're working on now (not using DunGen), I'm writing my own save/load system built on top of Json.NET

    For your second question, personally I'd just use the one scene and re-use a single dungeon generator.[/QUOTE]

    Thanks for the reply. I'll look see if i can get easy save to save it then. At worst i'll just shove the dungeon in a new scene and disable it when in other scenes. Not a big deal. I saved more time then i thought with this asset anyways.

    One slight request that others may find helpful, and you ever revisit the local props code.... just a simple enable after time feature would be really helpful. I've been using delayed enabling scripts. It currently runs any scripted attached, on each attempt at creating the dungeon. That means if something spawns in world space, you have 100's of prefabs. If you have a bunch of enemy AI, it slows to a crawl till they are removed.If you have all the local props with scripts start disabled, and enable it after the dungeon is created, it saves a lot of time.
     
    camta005 likes this.
  36. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    New Beta Build: 2.11.7b2


    Thanks, I had no idea that foldout overload existed; that's much better. I've made the change to the newest beta build. There are a few more foldouts in the code and I've made the labels clickable on all of them too, though the expanded state won't be saved on those ones as they're in inspectors that I haven't yet updated to use serialized properties.

    Honestly, a lot of the code needs a serious clean-up. Some of it is still the same as it was in 2014 when I knew a lot less about the Unity editor.

    I'm always open to more suggestions.


    Thanks for the reply. I'll look see if i can get easy save to save it then. At worst i'll just shove the dungeon in a new scene and disable it when in other scenes. Not a big deal. I saved more time then i thought with this asset anyways.

    One slight request that others may find helpful, and you ever revisit the local props code.... just a simple enable after time feature would be really helpful. I've been using delayed enabling scripts. It currently runs any scripted attached, on each attempt at creating the dungeon. That means if something spawns in world space, you have 100's of prefabs. If you have a bunch of enemy AI, it slows to a crawl till they are removed.If you have all the local props with scripts start disabled, and enable it after the dungeon is created, it saves a lot of time.[/QUOTE]

    Sounds like a good idea. I was hoping I could just suppress Awake(), OnEnable() and Start() until the dungeon is complete, but it seems the only way to do that is to instantiate them from an inactive prefab.

    Ideally, DunGen wouldn't even instantiate prefabs until it's done generating the dungeon. I'd like to do that but I think that's a longer term project.

    The other option is for me to make an "ActivateOnDungeonComplete" component that could be attached to your props. I'll look into all of these options further.
     
    RealMTG, camta005 and hopeful like this.
  37. RealMTG

    RealMTG

    Joined:
    Jul 27, 2013
    Posts:
    318
    Well here are some other improvements that could be made! I'm just happy to help the asset improve!

    Instead of manually creating scriptable objects like you're doing, allow Unity to do it for you, at least in newer versions. In your MenuOptions.cs class, you can put a big version dependent compilation define that deactivates on Unity 5.1, 5.2 and 5.3 or newer (OR_NEWER defines were added in 5.3) and then for your ScriptableObjects use the CreateAssetMenu attribute, which was added in 5.1. Again, use a define that only activates the attribute on 5.1, 5.2 and 5.3 or newer. The positive from using the attribute is that it allows users to name the file wherever it was created. When using your way, it creates a file, always named "New Whatever" and, for some reason, sends you back to the assets root folder.

    I also noticed a few editor scripts that used EditorUtility.SetDirty. I mean, it works. But it might be better for the future, or even present, to make those also use serializedObject.Update() and serializedObject.ApplyModifiedProperties(). Even if you're using other editors where just PropertyField can't make it, remember that all serializedProperties have a stringProperty, intProperty, floatProperty, etc which functions just as well.

    I hope this helps you a bit! :) Also sorry for no code snippets this time, but I think you can figure it out!
     
  38. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Yeah, I've been using the CreateAssetMenu attribute on newer projects since Unity 5. It looks like that file was last updated for DunGen version 2.0 in April 2014 though o_O. I'll get that updated soon; it definitely provides a better experience.

    I transitioned all of the most important inspectors over to use the SerializedProperty approach a little while ago but there are still a few that I haven't gotten around to replacing yet. Most of them use various draw methods from EditorUtil which should really all be replaced with custom drawers as well. They'll all be replaced at some point, it's just hard to justify replacing something that works instead of spending my time on something else.
     
    RealMTG likes this.
  39. Chrisad

    Chrisad

    Joined:
    Mar 12, 2013
    Posts:
    50
    Hello Aegon,

    I have a weird problem with Dungen. In my game, I save the chosen Seed generate after the creation of dungeons.
    If I exit the game and reload them one after another, dungeons are correctly regenerated. But if I reload the exact same dungeon using the seed WITHOUT quitting the game (exiting Unity), the seed will generate a different dungeon.

    I am using the Dungen 2.11.6 on Window 64 bit
     
    Last edited: Mar 30, 2019
  40. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    I haven't been able to reproduce the issue on my end. Does it happen for you on the demo scene (just disable "Randomize Seed" in the dungeon generator options and keep hitting R to regenerate the same dungeon)?
     
  41. Chrisad

    Chrisad

    Joined:
    Mar 12, 2013
    Posts:
    50
    The problem doesnt appear on the demo scene. Only on my scene. I have several things running after the loading of a dungeon (like unloading a scene or calling the garbabe collector) so it is probably due of my code.
     
    Last edited: Apr 2, 2019
  42. Chrisad

    Chrisad

    Joined:
    Mar 12, 2013
    Posts:
    50
    What things can impact the generation of the dungeon if they change between each generation of a dungeon (like the number of doorways of a tile etc) ? Maybe I am changing something without noticing it.
     
  43. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    New Beta Build: 2.11.7b3
    You can now optionally specify the number of branches across the entire dungeon, rather than on a per-tile basis. Full details in the linked post.


    Basically any changes to the tiles or any DunGen assets can cause a seed to generate a different dungeon:
    • Tile - The bounding box. The number of doorways, as well as their positions and sockets
    • Tile Sets - Adding or removing tiles, or changing their weights
    • Archetypes - Any settings, including adding or removing tile sets
    • Any settings in the DungeonFlow

    I've also noticed that the DungeonGenerator class exposes its random number generator property (named 'RandomStream'), so if you're using that in your own code it might cause problems. In a future version, I'll change that behaviour so the user gets a copy of the random number generator to avoid inadvertently changing the state.
     
  44. CF-Games

    CF-Games

    Joined:
    Jun 2, 2013
    Posts:
    128
    Hello,

    Thanks for creating DunGen. This is my first time creating levels procedurally and DunGen will save me a lot of time from having to create my own asset.

    I wasn't able to find any information about this in the documentation, but how do you control the player spawn point? In the demo scene, it seems the player always spawns in the same spot, which works for the demo, but when I replace the dungeon with my own, the player sometimes spawns inside walls (unable to move) or outside the start room, or not in a room at all and just falls straight down.

    Is there a way to have the player always spawn in the start room and in a position away from randomly placed props so there won't be clipping issues?
     
  45. RealMTG

    RealMTG

    Joined:
    Jul 27, 2013
    Posts:
    318
    When I need to spawn my player, I place an empty GameObject with the tag "Respawn" inside the start room and then have my player spawner script find the GameObject by tag and spawn my player there. I hope that helps! :)
     
    Aegon-Games and camta005 like this.
  46. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    218
    I just today downloaded Unity 2019.1 and the DunGen quit working correctly. I have no doors.
     
  47. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    452
    Which version of DunGen are you using? And which Unity version did you upgrade from?

    I tested upgrading from Unity 2018.3 using DunGen versions 2.11.5, 2.11.6, and 2.11.7b3 and everything worked fine
     
  48. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    218
    I upgraded from Unity 2018.3.12f. Yea it really weirded me out. I have the latest from the store 2.11.6? It would be nice or maybe there is a way to tell what version without looking at the store.
     
  49. flipwon

    flipwon

    Joined:
    Dec 29, 2016
    Posts:
    93
    I believe hallways is the answer.
     
    camta005 likes this.
  50. Candy-Bomber

    Candy-Bomber

    Joined:
    May 21, 2015
    Posts:
    63
    Curious about this asset. Is this up to date with Unity 2019.1.1f1? Would this work to create top-down 2D rogue-like dungeons using the default Unity tilemapper? Similar to the Binding of Isaac or Necrodancer perhaps.

    Cheers
     
    Last edited: May 5, 2019
unityunity