Search Unity

World Building [RELEASED] Dungeon Architect

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

  1. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @HeathC Thank you for using DA. You can grab it from the quick start guide for the mentioned theme and other themes. As for dungeons going only down, that is not currently supported
     
  2. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @HayLo02 Your multi-story level and cluster themes are looking great. Thank you for the heads up regarding the zero bounds issue. I'm not able to reproduce it locally, I'll look into this further
     
  3. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Do you want your grid dungeons enclosed inside a bound (like a building)? Very early on in the development, I did some experiment with this by stitching together multiple dungeon actors and using various volumes

    If this is something you want, I can create a script for you (skip to 1:00 to get an idea of how its generated inside the building bounds)

     
  4. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @unity_Lb2lDqR5J9MXZw You can try any of the following to fix this:
    1. Reduce the slope (cube rotation of your stair). It looks like it is 45 degrees, try 30 or 35. The character cannot steps up in such a steep slope. You might also want to reduce the GridCellSize's Y value if the stairs don't have much space after the slope is reduced
    2. Increase the Step Height parameter Navigation window's Agent tab and rebuild the navigation. You'll also want to update your character controller to allow stepping up on steeper heights
     
  5. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @HayLo02 You're awesome. Thank you. I'll push this change in the next update soon
     
  6. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @bradbecker The nodes with "None" written on it are by design and they serve as placeholders for other marker emitters beneath it. The nodes with a white box are unloaded thumbnails (because Unity hasn't provided a thumb for the prefab when requested). In this case, navigate to the Dungeon theme editor's Tool menu and choose Reload thumbnails

    unity_reload_thumb.png
     
  7. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Please ensure the following:
    • There is a mapping in the Modules array in the DungeonSnap prefab for the corridor node (the name is case sensitive)
    • The corridor has enough doors as the graph expects. For e.g. If you have on arrow coming into the corridor node and 2 arrows leaving the corridor node, then we at-least need one corridor module prefab with 3 or more doors
    • Make sure the module connections are pointing outwards as mentioned in the docs

    I'll provide detailed diagnostics for determining why the level is not generated in the coming builds
     
  8. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    @AliAkbar:

    Im trying to use DA with Terrain Composer 2. I need the DA generated dungeon to sit on a terrain already generated by TC2, but DA resets all the height values. It should only change the height values where the dungeon actually is, and surrounding it (for blending). The rest of the terrain should remain as is. Is there any way to do that?
     
  9. ivanmotta

    ivanmotta

    Joined:
    Jun 19, 2013
    Posts:
    23
    This would be awesome! Please do it!!
     
  10. RikiKlein

    RikiKlein

    Joined:
    Dec 14, 2018
    Posts:
    17
    I too would love this!
     
  11. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    Thanks for the response. I tried Reloading thumbnails but it didn't work because all the prefabs are missing their meshes in the DA 3rd party download for Dungeon Architect. My guess was that the Multistory Dungeon updated it's objects/prefabs/meshes and the DA download is targeting the old ones?
     
  12. bradbecker

    bradbecker

    Joined:
    Dec 26, 2014
    Posts:
    130
    For future posterity, I mentioned on the DA Discord that Multistory Dungeons now has 4 versions broken down by PC and mobile with Linear and Gamma versions each. I'm using PC Linear which was the original version but perhaps the GUIDs still changed when they added the new versions? Either way, the Theme files and icons are all accurate. It's the prefab modules that are all missing their meshes.
     
    AliAkbar likes this.
  13. Subaro

    Subaro

    Joined:
    Jun 28, 2015
    Posts:
    2
    Hi
    it's currently not possible to assign a selector rule to an element. For example I created the flollowing selector rule as shown in the user guide:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using DungeonArchitect;
    4.  
    5. public class MySelectionRule : SelectorRule
    6. {
    7.     public override bool CanSelect(PropSocket socket, Matrix4x4 propTransform, DungeonModel model, System.Random random)
    8.     {
    9.         return (socket.gridPosition.x + socket.gridPosition.z) % 2 == 0;
    10.     }
    11. }
    Now, when I drag the selection rule into the selection rule field for any theme element then the script is not assigned. The field just shows None (MonoScript). Selecting the script via dialog is also not possible.

    The transformation rules just work fine.
     
  14. Subaro

    Subaro

    Joined:
    Jun 28, 2015
    Posts:
    2
    Hello, when using dungeon snap and the flow editor and I set any rule in the execution graph to be iterated multiple times and then click Build Dungeon nothing is generated. There are also no messages in the console or error list of the flow editor. When I set the rules to Run Once the dungeon is generated without any problems.

    I just have the rules:

    Start Rule
    Start => {Spawn - RommGen}

    Grow Rule
    RoomGen => {RoomGen - Room} (alternatives)
    RoomGen => {Room} (alternatives)

    Finish Rule
    RoomGen => {Room}

    Excecution Graph:
    Start => Grow => Finish then Build and Dungeon is generated.
    when
    Start => 2xGrow => Finish then Build and nothing happens.
     
  15. AIGuru

    AIGuru

    Joined:
    Apr 19, 2014
    Posts:
    3
    I'm trying to figure out an issue when I generate a Dungeon and I get room overlaps:

    DA-1.png

    I'm getting this only when I'm using a Probuilder set of assets I made. When using another set of Assets I made, everything is fine (using the exact same DungeonSnap instance, just replacing the assets) :

    DA-2.png

    Any idea what can create this issue?

    Thanks,
     
  16. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Subaro This is strange, I just checked and it should work. Could you double check if the check box next to it is enabled. Also try assigning an existing script (like DungeonArchitect_Samples\Support\Scripts\Rules\AlternateSelectionRule)

    If it still doesn't work, let me know the engine version and I'll test it locally with that version
     
  17. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729

    Does your rooms have enough doors to grow? In this case it should have atleast 2 doors if the end graph is {Spawn - Room - Room} as the middle room needs two doors to connect

    We need better debugging facility and I'll be adding that soon. I've created a model for visually seeing how your level is grown from the final generated graph and all the problem it encountered during growth (like insufficient doors, collisions etc) and this was recently done in UE4 and I'll be bringing it to Unity soon

     
    Subaro and Weblox like this.
  18. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Sajid_farooq This can be done with the terrain modifier script.

    I've experimented with this in the past and realized it's more than just blending. Writing to heightmaps is destructive and the original data (created by terrain composer 2 for e.g.) would be lost when DA blends on top of it. We want to keep this data around so that when you rebuild, the original data is restored and reblended with the new layout

    Since heightmaps take up quite a lot of disk space, we need a better configurable system to manage this data (i.e. keep this temp data only on editor builds and not ship with games) or cache this data at runtime for dynamic builds or both

    I'll explore this further
     
  19. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Could you double check the orientations of your doors. It would be helpful if it's possible to send those prefabs for debugging
     
  20. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    The snap builder sample used ProBuilder and TextMeshPro as dependencies. Since importing these dependencies are problematic in some cases, I've recreated the demo without any deps. They are not pure mesh prefabs and you can grab them from here (the scene was generated in 2019.1)
     

    Attached Files:

    Sajid_farooq likes this.
  21. AIGuru

    AIGuru

    Joined:
    Apr 19, 2014
    Posts:
    3
    After a little bit of investigation, I got more info for my issue.

    I did the simplest use case to repro my issue by creating this DungeonFlow :

    DA - simple DF.png

    Was still getting overlaps.

    After tracing SnapBuilder's generation code, figured that the BoundingBox Intersect tests in the function FindAttachmentConfiguration() is probably not working as expected. I replaced the Intersect test with a simple center position overlap test and everything was working well :

    Code (CSharp):
    1.  if (ContractedModuleWorldBounds.center == OccupiedBound.center)
    I understand that testing the center position wouldn't work when having more Modules, but I think my issue is coming from something related to my assets BoundingBox/Extents and BoundingBox Intersect tests not behaving as expected.

    I've attached my asset if you would like to debug it on your end.

    Thanks
     

    Attached Files:

  22. chaenator

    chaenator

    Joined:
    Jun 29, 2017
    Posts:
    9
    I was testing survival shooter demo on 2018.3 and noticed on dungeon rebuild (press spacebar), the player gets spawned under the dungeon itself (and sometimes under the empty space) - though, i was only playing on candy theme so not sure about the others. Is this happening to anyone else?
     
  23. AIGuru

    AIGuru

    Joined:
    Apr 19, 2014
    Posts:
    3
    Any luck finding what isn't working as expected with my assets?
     
  24. joschemd

    joschemd

    Joined:
    Sep 16, 2015
    Posts:
    13
    I had this issue too, following the flow for traditional themed generation doesn't work. It took me some time to figure out 2 things, first check the overlap value, increase it until you see something generated. Secondly, from the videos I was able to determine that he used basically empty placeholders (roomgraph) through various steps. This fixed two issues for me, getting rooms etc actually placed and overlapping issues.
     
    Subaro likes this.
  25. joschemd

    joschemd

    Joined:
    Sep 16, 2015
    Posts:
    13
    @AliAkbar I see much progress and updates are being done for the UE engine, any roadmap when we will see these enhancements/updates for unity? I'm really looking for these and better documentation especially for the snap/snap streaming etc
     
    Inspeinre, Sajid_farooq and hopeful like this.
  26. Sir_patrickl

    Sir_patrickl

    Joined:
    Jun 24, 2013
    Posts:
    62
    @AliAkbar Is it possible to have elevation changes in the snap builder? I'm currently using the grid builder but want a little more control over some areas so I want to investigate if the snap builder is a better fit but this is a must-have for my levels.

    What about landscape transformer - could this be made to work with the dungeon flow/snap builder result?
     
  27. joschemd

    joschemd

    Joined:
    Sep 16, 2015
    Posts:
    13
    Yes snap does support elevation changes, I tried it with the first person items from a open dungeon pack that had stairs and after figuring out how to get it running, I want able to generate multiple floor layouts. I got it working by having the corridors with the elevation changes and laying out rooms in stages (through the flow logic) A little tricky at first but not too intimidating.


     
  28. Sir_patrickl

    Sir_patrickl

    Joined:
    Jun 24, 2013
    Posts:
    62
    Hi @joschemd, Thanks for the info.

    If I understand you correctly you are explicitly making elevation changes for each level using the flow grammar? That might be workable but not exactly what I was after. I was hoping to have a stair or corridor module that includes hight changes and if one of these is selected it would shift the rooms to match the height of the other doors. I'm not looking for multi-level building just some variation of room height as it is for an outdoor scene (similar to how the grid builder works).
     
  29. rmweston

    rmweston

    Joined:
    Jun 6, 2018
    Posts:
    2
    I'm experiencing inconsistent behavior with the spatial constraints editor and can't find much documentation on it other than the YouTube introductory video and the basic demo scenes. When building more complex sets of rules it would be nice to be able to copy/paste either the entire set of rule nodes or at least an individual rule node so I can reuse the rules for additional nodes on the same object or apply them to the spatial constraints of another object. I find that sometimes I can copy the rule nodes but other times I can't and I don't understand what the trigger is. Also, at some point I managed to create an "Invalid node" which I can't seem to delete. I've also noticed that some of the rule nodes I've created are purple while others are grey, what does the color signify? I can't seem to delete the purple ones.

    I would really appreciate some insight into these features or a link to some more detailed documentation.
     

    Attached Files:

  30. rmweston

    rmweston

    Joined:
    Jun 6, 2018
    Posts:
    2
    I've solved some of this issue through experimenting. The purple node corresponds with the game object node you are creating the rules for and probably wasn't intended to be copy/pasted, which is why I'm guessing there's no easy way to delete additional purple nodes other than deleting the entire game object node and starting over. The copy/paste feature is still inconsistent for me with grey rule nodes, working sometimes but not others, and I haven't figured out an easy way to copy/paste between game object nodes.
     
  31. joschemd

    joschemd

    Joined:
    Sep 16, 2015
    Posts:
    13

    That's exactly what I have, I use stair prefabs to adjust the height then when the rooms are finalized, they place them with the new height variations.

    The placeholders just allow to setup/grow the graph so you don't get physical overlaps when they are being placed during finalization.
     
  32. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    I noticed that there is a custom gridbuilder in the Unreal version. Is there something similar for Unity?
     
  33. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    Custom grid?? do you just mean changing the size of the squares? Or do you mean I might be able to hex tile with this thing?
     
  34. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    No idea. I havent used the Unreal version in ages. I just saw it mentioned somewhere. Cant remember where.
     
  35. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    Bug report: Snap Builder spawns multiple rooms for a single connection in the same place. I know that the Unreal version has a "debug" mode which shows that snap-builder detects overlaps and removes them. The bug still persists in the Unity version.



    Also, is there a debug mode for the Unity version?
     
    joschemd likes this.
  36. KungFuBrad

    KungFuBrad

    Joined:
    Apr 12, 2018
    Posts:
    9
    Greetings!

    I'm looking to get up to speed, I've seen there are some videos mentioned but am having trouble finding them. Can anyone point me in the right direction?

    Thanks!
     
  37. KungFuBrad

    KungFuBrad

    Joined:
    Apr 12, 2018
    Posts:
    9
    OK, so I found it; the series link for others who are looking for it is:
     
  38. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I've improved the landscape transformer
    • It blends with the existing terrain, instead of overwriting everything
    • It saves the original heightmap data before modifying the terrain, so when a new layout is generated, the old layout is removed (by restoring the original heightmap). Only the portion of the heightmap within the dungeon bounds is saved to reduce storage footprint
    • The blending algorithm with the nearby terrain is improved and produces better results than before
     
    Neviah, joschemd and hopeful like this.
  39. joschemd

    joschemd

    Joined:
    Sep 16, 2015
    Posts:
    13

    Thanks for the update and great job!! Was hoping you hadn't left us Unity users in the dark with features and updates!
     
    Sajid_farooq likes this.
  40. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    107
    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
     
  41. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    I definitely need that in my current project (was getting crazy not being able to keep terrain data in the surrounding of the Dungeon)
    When can we expect this update to hit the asset store?
     
  42. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    36
    i was gonna ask this you asked first :)
     
  43. ge01f

    ge01f

    Joined:
    Nov 28, 2014
    Posts:
    121
    What's the status of the Flow/Snap system? It looks like the Flow Editor works, and I see an Experimental DungeonRoom, but there are no DungeonToolData objects available, and it's not mentioned in the docs and the Build Dungeon doesnt produce the rooms your video shows.

    ETA? Looking forward to it.

    Thanks!
     
  44. noobynobody

    noobynobody

    Joined:
    May 9, 2019
    Posts:
    75
    How does this handle lighting while in run-time? Do all lights have to be real-time?

    How is the performance of the run-time generation on mobile devices?
     
    Last edited: Sep 27, 2019
  45. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    @AliAkbar is there a way to copy and paste the spatial constraint rules in the Dungeon Theme editor? I'm doing some theming for my levels and copy paste Node doesn't keep any of the spacial constraint info. Cheers! (I tried saving a unity object preset on the game object node but that broke DA badly!)
     
  46. noobynobody

    noobynobody

    Joined:
    May 9, 2019
    Posts:
    75
    Is there a theme for Synty Studio's POLYGON Dungeon?
     
  47. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    No and Synty assets (walls/floors) pivot point is not in the center, so either you put them as child of an empty to have proper pivot point, or you have to modify the pivot point in a 3D modeling studio such as Blender. Either cases it's a lot of work if you plan to use lots of different walls/floors (I think it's the same for stairs and few others)
     
  48. noobynobody

    noobynobody

    Joined:
    May 9, 2019
    Posts:
    75
    But can't you use the offset in DA, as mentioned here: https://forum.unity.com/threads/released-dungeon-architect.346622/page-26#post-3452601
     
  49. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
  50. Raika01

    Raika01

    Joined:
    Dec 19, 2015
    Posts:
    3
    Is the cave generator fully working? If not, is it somehow possible to use Dungeon Architect with Sebastian Procedural Cave Generation?