Search Unity

World Building [RELEASED] Dungeon Architect

Discussion in 'Tools In Progress' started by AliAkbar, Aug 9, 2015.

  1. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
  2. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Glenndroid You could spawn 4-5 (or N) volumes from your own listener script (on the pre-build event) and have the dungeon connect them together. I'll send you a sample by tomorrow.
     
    Glenndroid and antoripa like this.
  3. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Snotface I usually PM the latest build to anyone that asks in between releases. Just send me a PM if you'd like to try out a new developmental feature or a bug fix that I add.
     
    Snotface and antoripa like this.
  4. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I can add an option to avoid this scenario. I've added it to my todo list
     
    antoripa likes this.
  5. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @tcz8 Thanks for the bug report. I'll have a look. Which builder is this? (city, floorplan, grid, snap)
     
    antoripa likes this.
  6. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Thank you @JDuaneJ. I'm looking forward to seeing what you create :)
     
    antoripa likes this.
  7. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hey @Rokkr_0,

    1. From 5.6 onward, DA supports Unity's native navigation system. It also works on runtime and there's a sample game (Survival Shooter) that demos this so you can quickly get started. Unity's nav mesh system doesn't work in 2D, so there's an alternate implementation (using SharpNav) for your 2D games (sample JackRabbit)
    2. Frustum culling works well on your top down games, so your non-visible lights would be culled out and you can have lots of lights on your top-down levels
    3. It works well on mobile as long as the art assets are optimized for it. Here's a demo video I took. The art were not optimized for mobile (they are for PC) but works well on my 4 year old phone (Samsung Note 3)


    Here's the sample survival shooter on mobile (after disabling post processing effects like bloom, motion blur etc)


    As for lighting, if you build your level in the editor, you can bake your lighting like any other level. If you want runtime dungeons that are built on the fly, then you need to use dynamic lights
     
    Rokkr_0 and antoripa like this.
  8. Glenndroid

    Glenndroid

    Joined:
    Sep 13, 2017
    Posts:
    21
    @AliAkbar
    I bought the MOBA asset pack form K4 but i've run into the following problem:

    https://ibb.co/bHPwgG

    It sometimes create a wall on top of the staircase. How can I fix this?

    Also many props are spawning underground.
    NOTE: Nothing is changed in the scene just downloaded the demo and drag and drop it in my asset folder.

    (example seed: 678171712)
     
  9. Rokkr_0

    Rokkr_0

    Joined:
    Jul 29, 2017
    Posts:
    15
    Thanks for the info, I'll be picking this up very soon. I'm looking forward to seeing what I can come up with ^_^
     
  10. Glenndroid

    Glenndroid

    Joined:
    Sep 13, 2017
    Posts:
    21
    Hi Ali could you still send me the sample?
    Thank you in advance. ^_^
     
  11. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @dlevel I've created a new tutorial and sample that shows you how to use the navigation mesh at runtime (sample attached)

     

    Attached Files:

    antoripa, Rokkr_0 and SSL7 like this.
  12. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    this is awesome, thank you.
     
  13. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Glenndroid I've created a script that creates the desired number of rooms by placing platform volumes and then separating them till they no longer intersect. There's also a parameter to create extra spacing between rooms, if you don't want them to be adjacent

    6 room volumes spawned before the dungeon is built. It can be randomized with the seed



    With some forced spacing between the rooms so they don't touch each other




    Volumes spawned before the dungeon is built (with / without spacing)



    I had to make some changes to the DA code (added a pre-build and pre-destroy event to the listener). I'll create a proper build tomorrow. Please PM me if you need the latest build with this sample
     
    antoripa, Glenndroid and Rokkr_0 like this.
  14. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
  15. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
    Hey Ali,

    Can you expand sample theme files to include some of the best sellers in asset store? ^^

    Thanks for the great asset!
     
    AliAkbar likes this.
  16. Rokkr_0

    Rokkr_0

    Joined:
    Jul 29, 2017
    Posts:
    15
    Hi Ali, I picked up DA and have been working with it every chance I get. This post is exactly what I've been trying to do, I would very much like to have this option and I'm looking forward to when it will be available.
     
  17. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    Is it possible to have a first room point? like the level end goal template on specialroomfinder, to also have a prefab for the starting room, so I can spawn my player there. Using the DungeonGrid, is there any system so I can have a key/door system that I can make a full dungeon with find the key and then finish the dungeon? if it exists could you please explain it? thank you.

    edit:

    Another problem I got:

    My walls are sometime facing the wrong side (they are one sided walls so when they are facing the wrong side and not the room, I have an invisible wall).
     
    Last edited: Oct 23, 2017
  18. Glenndroid

    Glenndroid

    Joined:
    Sep 13, 2017
    Posts:
    21
    Hi, @AliAkbar did you already had a chance to look into this? ^_^
     
  19. Snotface

    Snotface

    Joined:
    Jun 3, 2015
    Posts:
    7
    Thanks a lot. I'll keep that in mind.
     
  20. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Hi everyone,

    I am generating house interriors for my game and I am trying to figure out a few things:

    1- how can I make sure each layout has a larger entrance room that is allways located at the bottom of the map and centered on the exterior wall?

    2- How can I make sure only 1 "front door" object is spawned and that its located on the exterior wall of the entrance room/hall created at point 1?

    3- Is there a way to use theme overrides without having to duplicate everything in each themes? ie.: If I have a main theme with roads and houses and whant to create a shopping district, I need to create a theme with shops instead of houses and include all the roads otherwise there will be no roads in that section of the map. Is there a way to do do it so only certain nodes in a theme are overriden? It would make maintenance so much easier. Right Now everytime I update my road layout I have to update all my themes. Seems like a waste of time.

    If you have suggestions that can help please share.

    Thank you for reading!

    Fred.
     
  21. levi777l

    levi777l

    Joined:
    Mar 13, 2014
    Posts:
    17
    Anyone figured out a way to have this run in a coroutine? Trying to avoid load time when generating very large dungeons at runtime? The runtime example uses a coroutine to yield 1 frame to ensure its a clean rebuild. But the dungeon.Build() takes too long to avoid interuption.
     
    Last edited: Oct 14, 2017
  22. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @AliAkbar ,

    If I create a terrain with say Gaia or TC2 with trees etc, if I then generate say a 3d forge village using this Asset, will the area where the village is generated automatically remove obstacles on the terrain within its area like trees and rocks??
     
  23. levi777l

    levi777l

    Joined:
    Mar 13, 2014
    Posts:
    17
    So I got this building at runtime in a background process. But im stuck in one spot. Coroutines don't really like recursive loops =P. Need to figure out how to rewrite ConnectCooridorRecursive, to a non recursive version to do the same thing.....
     
  24. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    There's a new product in the store - Mesh Combine Studio - which is a runtime mesh combine & LOD system. It sounds like it could work with Dungeon Architect to help make DA scenes more efficient (and indeed that is a usage example mentioned on their website).

    Does anyone have any experience with this? I know, the plugin just came out, but possibly someone here has already tried it, or was in on a beta or something. Possibly @AliAkbar? I'm curious, because of course this could be a wonderful solution to making large DA scenes run swiftly, like the city generation scenes.
     
    Rokkr_0 and Arganth like this.
  25. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    277
    hmm that looks highly interesting :)

    oh its by nathaniel :D
    so it should be really good :)

    just bought it and wrote an email to nathaniel
     
    Last edited: Oct 23, 2017
  26. levi777l

    levi777l

    Joined:
    Mar 13, 2014
    Posts:
    17
    I bought it and used it over the weekend. Works just like it says. It doesn't save prefabs since the mesh data is not saved tho. Hoping that gets updated, and I will use it alot.
     
    hopeful and Arganth like this.
  27. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    349
    What if there is doors? how it updates the navmesh when you open them?
     
  28. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @aliakbarhashemirafsanjani , all,

    I'd be v interested in anyone's response on this?
     
  29. eagle555

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,705
    Hi guys,

    Its a runtime and editor automatic cell based mesh combine tool. Yes it works great with Dungeon Architect. Here's a demo showcasing the performance increase:
    https://www.dropbox.com/s/0y0zgnbolbytpbt/MeshCombineStudioTest.rar?dl=0
    I will add some more demo's...

    On my Nvidia 980TI it gives +20x more fps (from 37 to 805) compared to Unity's dynamic batching (Unity static batching gives about 40 fps). Also makes a big difference on medium and low end GPU's and mobile.

    As for saving of meshes I included ObjExporter which can be accessed from Unity Menu -> GameObject -> Export. I will add that it saves meshes as Assets so you can directly create prefabs...

    Nathaniel
     
    Last edited: Oct 24, 2017
  30. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    207
    OT @eagle555
    Wow, D.R.O.N.E looks awesome!
     
    AliAkbar likes this.
  31. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Sure, which asset themes would you like to see?
     
  32. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @dlevel, this video shows you how. You can place any art asset / prefab over the volume, as it would guarantee a room there


    As for the single sided walls, I usually add two mesh nodes for the same walls and rotate the other one by 180 to face the other way (be sure the uncheck consume on attach so both the nodes are executed)
     
    Last edited: Oct 26, 2017
  33. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Glenndroid I recently fixed an issue which was causing stairs to be incorrectly placed on walls. This is a DA issue and will be available in the next version. (It was caused when redundant doors were removed but not their stairs)
     
    Glenndroid likes this.
  34. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    For 1 & 2, You can use platform volumes to setup custom rooms and a marker replacement volume for custom doors at a certain location



    For 3, I'll add this feature where it will override only the nodes that exist in specified theme file or fallback to the base theme
     
  35. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729

    @Duffer123 there's a sample that does this with Gaia and 3DForge's Village Exterior assets

    The landscape transformer script modifies the following in the landscape:
    • Height Data
    • Paint Data - paints the landscape based on the dungeon layout
    • Foliage - Adds / removes stuff (grass, rocks etc) already placed in the terrain

    In the videos below, it paints the path way with a different texture and removes the grass on the corridor walkway



     
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You usually won't put navigation on your doors (Uncheck the "Affects Navigation" flag in the door's theme node)

    The door will open anyway when the player or an NPC is close to it

    There are also examples on dynamically affecting the nav mesh with obstacles (I played with it in the 5.6 beta). Let me know if you need help on that.
     
  37. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hey Nathaniel, thanks for the update and congrats on your new tool and your other amazing assets. I just picked it up.

    DRONE looks amazing, we've been discussing it over at the unreal forums and I can't wait to play it. Keep up the awesome work
     
    antoripa likes this.
  38. Glenndroid

    Glenndroid

    Joined:
    Sep 13, 2017
    Posts:
    21
    @AliAkbar Thank you for the update thought I was going insane lol.
    I had two more questions:
    1.Is it possible to make the final room a custom size?
    2.Enemies are currently spawning only in the hallways not in the actual rooms because of the flag points? Could it be possible to spawn them in the rooms only and let them stay there.
     
  39. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
  40. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
  41. Sehee26

    Sehee26

    Joined:
    Mar 13, 2014
    Posts:
    19
    Hi @AliAkbar ,
    Im trying to create a selection rule for SimpleCity, to generate different buildings in the corners, near to Road_T and Road_X. I read the API, but i cant find a way to get that cell info. Can you, or anyone help me?, Thanks
    (Sorry for my bad english)
     
  42. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    @AliAkbar Hi, I have been trying to access the dungeon's grid size within a transform rule script but I can't figure it out.

    I think it may have to do with the grid setup which is using a city/town builder. The code I have may be trying to get data from a regular grid builder... Tried a few things I found looking at the API but I can't make it work. I keep getting errors about the value being unassigned.

    Can someone push me I the right direction?

    I just need to know the proper way to access the grid's config.

    Thank you.
     
    Last edited: Nov 11, 2017
  43. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    I haven't done it yet, but I think you need to check the type of each surrounding cells and when you have similar types of cells on two adjacent sides while the others sides are different, you've got a corner. Something along those lines.
     
    Sehee26 likes this.
  44. Sehee26

    Sehee26

    Joined:
    Mar 13, 2014
    Posts:
    19
    Thanks, I'm checking the script "Road Beautifier" to see how it works and create the rule.
     
  45. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Awesome! I will take a look at it to since I also need it. If you want we can work out the kinks together.

    Cheers.
     
  46. frankslater

    frankslater

    Joined:
    May 9, 2016
    Posts:
    213
    Wow, this is awesome! I'm speechless.
     
  47. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    hopeful likes this.
  48. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    Check out the spacial constraint demo, he uses spatial constraint to spawn green "arrow like" prefabs in the corners of each rooms.

    I have beent trying to make this work for city block corners but I'm not getting the results im expecting. Maybe you will have better luck.

    The other solution I have been thinking about is attaching buildins to road corners and crossroards directly inlcuding one of the volume script to empty out the area so buildings dont overlap.
     
  49. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    For anyone trying to make that House2X node work in the city builder: It isn't a built in node.

    You need to do the following to make it work:

    1- Create a new custom block dimensions entry

    2- Set its marker name to House2X (must match a node name from the theme), Configure its size in number of cells and set its probability (This is the probability it will be choosen instead of other entries in the array.

    3- Set the "Bigger house probability" which is the probability that the builder will use custom blocks from the array.

    upload_2017-11-14_13-45-41.png

    The only problem is that the code responsible to rotate houses so they face the street doesnt appear to work. From another demo I also found there wre issues with custom blocks spawning inside parks and not being accessible from the street.

    @AliAkbar Are these bugs or working as indented?

    I will update this later if I figure out whats wrong.
     
    Last edited: Nov 14, 2017
    AliAkbar likes this.
  50. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    504
    @AliAkbar here are examples of houses/custom blocks spawning in a park:
    upload_2017-11-14_14-20-46.png

    Here is a larger view, all large houses are facing the same direction. Note that InsertHouse90() has been commented out to generate this layout:
    upload_2017-11-14_14-22-14.png


    With InsetHouse90() untouched (uncommented) we get this:
    upload_2017-11-14_14-25-25.png