Search Unity

DunGen - Procedural Dungeon Generation

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

  1. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    77
    Hi, question about the navmesh generator. I have it working, no errors but I am wondering if its working right. It navmeshes each room individually, then creates links. Should it navmesh the whole dungeon since it all touches? I only ask because when the AI goes between rooms its like it dashes through, like a leap forward. I assume it does that because the gap is larger. If I manually bake it will back it all, is there a way to bake it after its created?
     
  2. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    405
    DunGen 2.11.9 Beta 3 Released

    I didn't even know the old SECTR VIS package had been deprecated. It looks like the new version still uses all the same components so I'd have thought it would still work.

    I'll have to take some time at some point to upgrade to the new version myself and see what's up. For now, I'll remove any mention of the integration from DunGen's asset store page.

    As for the built-in culling solution, it has a very narrow use-case. It works best when you have closing doors on the entrance to every room so the player will only ever see two rooms at any time. It's not very useful if the player should be able to see through multiple rooms in a line; for that, you'd need an external culling solution like SECTR.


    For some reason, Unity's default AI behaviour for traversing off-mesh links is to go through it at 2x the agent's speed. It's possible to use a custom script to override this behaviour.

    There isn't a way to bake the entire dungeon after it is created in the current version, but I've now added this as an option in the new beta build.
     
    hopeful and Vincent13122 like this.
  3. Vincent13122

    Vincent13122

    Joined:
    Oct 26, 2014
    Posts:
    42
    Are there any downsides to baking the entire dungeon rather than creating off-mesh links?
     
  4. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    405
    I think it would mostly be an issue of performance.

    While I've found Unity's runtime NavMesh generation to be really fast, if you have a large or complex enough dungeon it might start to slow down. Pre-baking each room into the prefab will always be the fastest. If you're not using the pre-baked mode, there shouldn't be a difference (generating the entire dungeon's NavMesh at once might even be a little faster).

    The biggest difference is that doors would need to be handled differently. Off-mesh links can be enabled and disabled at runtime to allow agents to pass through doors only when they're open. Without them, you'd need to add a NavMesh Obstacle to the door. The obstacles would need "carving" enabled so they actually cut a hole in the NavMesh - which is a lot more expensive than just toggling an off-mesh link.


    It's probably something that needs to be evaluated on a case-by-case basis. The performance hits might be completely unnoticeable in your particular project.
     
    Vincent13122 likes this.
  5. Darrkbeast

    Darrkbeast

    Joined:
    Mar 26, 2013
    Posts:
    77
    I see, for my dungeons they are relatively small so doing it once would be good. I will look at making a script too for now since I have most of my game complete. Thanks for the info.
     
  6. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    418
    Makes sense. I will mention that I own several dungeon building assets, and the main reason I immediately came to this one over anything else was because I expect it to be easier to achieve decent frame rates using Sectr. It worked out that I actually really like where this has gone, and I think I can manage anyway ... but the easy of Sectr integration is something that really made this product stand out for me, even when I know I can accomplish my dungeon in different ways using a variety of different products. I can just focus on building my rooms, and not worry about how to optimize it.

    So ... if there is something wrong, it would be great to fix it :). Im still assuming the problem is me, but feel free to check.
     
  7. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    59
    Question, does this support 2.5D and side scrollers ? And are there any demo videos or themes to showcase how it looks or works ?

    Something like INSIDE or MARIO kind of stuff OR a game created using 3d assets but in 2d/side view
     
  8. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    405
    Yes, DunGen supports 2D, 2.5D and 3D. Side-scrollers are also not a problem. I don't have any videos showcasing these use-cases yet unfortunately.

    Ultimately, DunGen works the same way regardless of what type of project you're working on: you just hand-make some rooms, mark the doorway positions/orientations, save the rooms as prefabs, and let DunGen piece them all together.
     
  9. Lokiare

    Lokiare

    Joined:
    Nov 2, 2014
    Posts:
    3
    I'm having problems. When I generate my dungeon, some of the doorways are not blocked and end up opening the player to an endless drop. What are things that can cause this and how do I fix it?
     
  10. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    405
    Make sure that all of your doorways have got at least one entry in either the "Random Prefab" or "Scene Objects" list in the Blockers section. Prefabs are automatically placed at the location of the doorway; scene objects must be inside the tile prefab and need to be positioned manually to block the doorway.