Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. We're running great holiday deals on subscriptions, swag and Asset Store packages! Take a peek at this blog for more information!
    Dismiss Notice
  3. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  4. Unity 2017.2 is now released.
    Dismiss Notice
  5. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  6. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  8. Unity 2017.3 beta is now available for download.
    Dismiss Notice

[RELEASED] Dungeon Architect

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

  1. Rokkr_0

    Rokkr_0

    Joined:
    Jul 29, 2017
    Posts:
    4
    Hi Ali, I'm very interested in picking up DA and some of MK4's assets with it. That said, something like this cave generator would be very nice to have.

    DA seems very impressive and I've been reading a lot about it, but I have a few questions before I buy it:

    1. I'm using Unity 2017.1.1f1, does DA support Unity's NavMesh at run-time with the NavMesh Surface?
    2. Would frustum culling work well enough for a top-down game?
    3. I've read mentions of it working on mobile and from what I understand, as long as the material/assets used are good for mobile, it should work. Is this the case?

    Also, are there any decent lighting solutions for mobile?
     
    Last edited: Sep 27, 2017
    AliAkbar likes this.
  2. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    25
  3. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    @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.
  4. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    @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.
  5. AliAkbar

    AliAkbar

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

    AliAkbar

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

    AliAkbar

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

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    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.
  9. Glenndroid

    Glenndroid

    Joined:
    Sep 13, 2017
    Posts:
    16
    @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)
     
  10. Rokkr_0

    Rokkr_0

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

    Glenndroid

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

    AliAkbar

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

     

    Attached Files:

    Rokkr_0 and dlevel like this.
  13. dlevel

    dlevel

    Joined:
    Mar 23, 2016
    Posts:
    158
    this is awesome, thank you.
     
  14. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    @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

    [​IMG]

    With some forced spacing between the rooms so they don't touch each other
    [​IMG]

    [​IMG]

    Volumes spawned before the dungeon is built (with / without spacing)
    [​IMG]
    [​IMG]

    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.
  15. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
  16. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    162
    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.
  17. Rokkr_0

    Rokkr_0

    Joined:
    Jul 29, 2017
    Posts:
    4
    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.
     
  18. dlevel

    dlevel

    Joined:
    Mar 23, 2016
    Posts:
    158
    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
  19. Glenndroid

    Glenndroid

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

    Snotface

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

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    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.
     
  22. levi777l

    levi777l

    Joined:
    Mar 13, 2014
    Posts:
    3
    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
  23. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    760
    @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??
     
  24. levi777l

    levi777l

    Joined:
    Mar 13, 2014
    Posts:
    3
    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.....
     
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    3,878
    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.
  26. Arganth

    Arganth

    Joined:
    Jul 31, 2015
    Posts:
    245
    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
  27. levi777l

    levi777l

    Joined:
    Mar 13, 2014
    Posts:
    3
    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.
  28. dlevel

    dlevel

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

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    760
    @aliakbarhashemirafsanjani , all,

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

    eagle555

    Joined:
    Aug 28, 2011
    Posts:
    2,272
    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
    AliAkbar, Arganth and hopeful like this.
  31. Binary42

    Binary42

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

    AliAkbar

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

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    @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
  34. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    @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.
  35. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    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
     
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446

    @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



     
  37. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    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.
     
  38. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    446
    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
     
  39. Glenndroid

    Glenndroid

    Joined:
    Sep 13, 2017
    Posts:
    16
    @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.
     
  40. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    760
  41. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    162
  42. Sehee26

    Sehee26

    Joined:
    Mar 13, 2014
    Posts:
    11
    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)
     
  43. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    @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
  44. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    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.
  45. Sehee26

    Sehee26

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

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    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.
     
  47. frankslater

    frankslater

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

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    hopeful likes this.
  49. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    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.
     
  50. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    125
    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.