Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building [RELEASED] Dungeon Architect

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

  1. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    Hi @AliAkbar loving the new Grid Flow update! Would it be possible in the future to utilize the Snap Builder functionality for pre-created rooms with Grid Flow?
     
    OdderOtter and TextusGames like this.
  2. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    26
    I'm having the same issue. Did you happen to find a work-around yet?
     
  3. wtadlock

    wtadlock

    Joined:
    Aug 1, 2016
    Posts:
    15
  4. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    I am not sure. But it is possible that corridor can't have more than one income and one outcome arrow. And you have 3 outcome arrow from one corridor. You need to drag your arrows from module that can have as many connections as you drug arrows from it. Also you can paste new corridor between any 2 connected modules.
     
  5. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    I tried to move those scripts into editor folder, but they are used in runtime so that did not work out.
    We just need to wait again for Ali to fix this.
     
    sfoust likes this.
  6. wtadlock

    wtadlock

    Joined:
    Aug 1, 2016
    Posts:
    15
    I will have to look at that. The corridor will have an inlet/outlet at each end, but 3 rooms coming off of the side of it. I am using https://assetstore.unity.com/packages/3d/environments/urban/he-abandoned-hospital-v-1-22030 There are some preset rooms in the example scene, and I was trying to make those work for an abandoned hospital level.
     
  7. 17windy

    17windy

    Joined:
    Jun 12, 2015
    Posts:
    7
    I'm having the same issue.
     
    sfoust likes this.
  8. MegaMileyStudios

    MegaMileyStudios

    Joined:
    Aug 19, 2017
    Posts:
    72
    Happy new year and thank you for the new version :D

    I was just about to try it out but I'm getting a NullReferenceException in the console as soon as I open a cloned scene of the new GridFlow sample,

    Code (CSharp):
    1. [Exception] NullReferenceException: Object reference not set to an instance of an object
    2. AmbientOcclusion.IsEnabledAndSupported()    Library/PackageCache/com.unity.postprocessing@2.1.7/PostProcessing/Runtime/Effects/AmbientOcclusion.cs:179
    3. 177:   if (context != null)
    4. 178:   {
    5. -->179:       state &= context.resources.shaders.multiScaleAO
    6. 180:             && context.resources.shaders.multiScaleAO.isSupported
    7. 181:             && context.resources.computeShaders.multiScaleAODownsample1
    8.  
    9. PostProcessLayer.SetLegacyCameraFlags()    Library/PackageCache/com.unity.postprocessing@2.1.7/PostProcessing/Runtime/PostProcessLayer.cs:730
    10. 728:   foreach (var bundle in m_Bundles)
    11. 729:   {
    12. -->730:       if (bundle.Value.settings.IsEnabledAndSupported(context))
    13. 731:           flags |= bundle.Value.renderer.GetCameraFlags();
    14. 732:   }
    15.  
    16. PostProcessLayer.SetupContext()    Library/PackageCache/com.unity.postprocessing@2.1.7/PostProcessing/Runtime/PostProcessLayer.cs:816
    17. 814:   #endif
    18. -->816:               SetLegacyCameraFlags(context);
    19. 818:               // Prepare debug overlay
    20.  
    21. PostProcessLayer.BuildCommandBuffers()    Library/PackageCache/com.unity.postprocessing@2.1.7/PostProcessing/Runtime/PostProcessLayer.cs:502
    22. 500:   m_LegacyCmdBuffer.Clear();
    23. -->502:   SetupContext(context);
    24. 504:   context.command = m_LegacyCmdBufferOpaque;
    25.  
    26. PostProcessLayer.OnPreCull()    Library/PackageCache/com.unity.postprocessing@2.1.7/PostProcessing/Runtime/PostProcessLayer.cs:436
    27. 434:       }
    28. -->436:       BuildCommandBuffers();
    29. 437:   }
    30.  
    It seems like the shader might be null. In case this has anything to do with the new URP or HDRP, neither of those are installed in my project. I'm using 2019.2.15f1 on Windows 10

    If I missed something please let me know

    Edit

    After some researching it appears that there are 2 audio listeners and the post processing on the main camera is causing these shader issues. The odd thing is that there is only 1 camera and I don't see any other object with an Audio Listener so I'm not sure what is going on there..
     
    Last edited: Jan 4, 2020
  9. MegaMileyStudios

    MegaMileyStudios

    Joined:
    Aug 19, 2017
    Posts:
    72
    Also a bug report, when I select the DungeonGridFlow object in the hierarchy the CPU usage of Unity shoots up to 100% on the main core and it lags my editor to nearly a halt. There seems to be something happening in the background when the object is simply selected. As soon as I deselect it it's gone and the performance is back to normal
     
  10. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    There is a real-time update button in right corner of theme editor. And possibly some there else I don't remember. Disabling this can fix slowleness. If it is so performance heavy it should not be enabled by default..
     
    AliAkbar and MegaMileyStudios like this.
  11. 17windy

    17windy

    Joined:
    Jun 12, 2015
    Posts:
    7

    Same errors .......
     
  12. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Boaike Glad you like the new feature. Are your walls tile based (take up a full tile) or edge based (like an ordinary wall). This builder treats walls as tiles. I'ts easy to support both tile and edge walls (I'll give this as an option in the next update). Could you post a screen with the theme node config. It would also be helpful to have a screen of the pivot of the wall prefab so I can test it locally
     
  13. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Stairs won't be supported like in the grid builder. However, in the future, I have plans to extend this builder to support that. The abstract graph (the NxN node grid) where you build your initial level layout can be turned into a 3D grid (NxNxN) where we layer different floors on top of each other (NxN x floors). The "Find Path" nodes will then find a path in this 3D grid, moving up and down the floors. The final level can have strategically placed windows looking at lower rooms, or from the lower room, you can see a bridge above you (connecting the upper rooms). It will make for some interesting dungeons

    I'll add variation to the path size if EndOnPath is left empty
     
    TextusGames likes this.
  14. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Apologies for the error. I'll submit a fix for this soon
     
    Last edited: Jan 6, 2020
    sfoust likes this.
  15. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729

    Please have a look at how to do this properly here: DungeonArchitect_Samples\Support\Scripts\Demo\RegenerateDungeonLayout.cs

    The sample demos use this
    Code (CSharp):
    1.  
    2. public class RegenerateDungeonLayout : MonoBehaviour {
    3.     public Dungeon dungeon;
    4.  
    5.     /// <summary>
    6.     /// If we have static geometry already in the level created during design time, then the pooled scene
    7.     /// provider cannot re-use it because the editor would have performed optimizations on it and might not be able to move it
    8.     /// This flag clears out any design time static geometry before rebuilding to avoid movement issues of static objects
    9.     /// </summary>
    10.     bool performCleanRebuild = true;
    11.  
    12.     // Use this for initialization
    13.     void Start () {
    14.         StartCoroutine(RebuildDungeon());
    15.     }
    16.    
    17.     // Update is called once per frame
    18.     void Update () {
    19.         if (Input.GetKeyDown(KeyCode.Space))
    20.         {
    21.             StartCoroutine(RebuildDungeon());
    22.         }
    23.     }
    24.  
    25.     IEnumerator RebuildDungeon()
    26.     {
    27.         if (dungeon != null)
    28.         {
    29.             if (performCleanRebuild)
    30.             {
    31.                 // We want to remove design time data with a clean destroy since editor would allow modification of optimized static game objects
    32.                 // We want to do this only for the first time
    33.                 dungeon.DestroyDungeon();
    34.                 performCleanRebuild = false;
    35.  
    36.                 // Wait for 1 frame to make sure our design time objects were destroyed
    37.                 yield return 0;
    38.             }
    39.  
    40.             // Build the dungeon
    41.             var config = dungeon.Config;
    42.             if (config != null)
    43.             {
    44.                 config.Seed = (uint)(Random.value * uint.MaxValue);
    45.                 dungeon.Build();
    46.             }
    47.         }
    48.     }
    49. }
    50.  
     
    TextusGames likes this.
  16. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    This feature is planned. You'll be able to use the snap feature with a few constraints
     
    TextusGames likes this.
  17. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Please make sure the Corridor has enough doors to grow (at least 4 in this case). I'll also be adding a debug mode in the editor so you can walk through the build process and see where it fails. Something like this (ue4)
     
    ArturoPP and slimshader like this.
  18. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729

    Happy New Year :)

    Could you try installing PostProcessing v2 from the package manager? More info in the setup guide (DungeonArchitect/Docs/Setup/00 Setup Guide - Dungeon Architect)
     
  19. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    Predesigned rooms for grid flow builder is my number one missing feature. It is the most important one for me, I can not really create dungeons that I want without this.
    Example. I need to have something like a challenge room somewhere in a dungeon maybe before key(ability). I would like to create a path node that will take a random module with say name "Challenge". and after creating dungeon on that path will be created predesigned challenge rooms.


    The second is built-in support for theming in pre-designed modules. (I mean you place marked gameobjects for ground, walls, or any other markers in predesigned module prefab and after building dungeon those marked gameobjects will be replaced by gameobjects from the theme)
    Although I think it is possible to make by myself it would be great to have just 1 built-in component that has marker name variable that you can add to module prefabs and change marker name and these objects will be automatically replaced by theme engine upon dungeon build.

    Looking forward to these features.:cool:
     
  20. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I've fixed the errors while creating standalone builds. I'll upload a new version shortly
     
  21. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I've submitted a new version to the asset store for review. I'll let you know when it shows up

    Version 1.10.1
    • Fix: Fixed a critical error what was causing standalone build creation to fail
    • Fix: Removed 'unused variable warnings' from a sample while creating standalone builds
     
    ArturoPP, TextusGames and hopeful like this.
  22. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hello @AliAkbar

    I didn't yet try the new Dungeon systems from the update but I've read from a user that there are no emitters for half-walls in the new grid flow. Is it true or is it a bug?

    Also just a suggestion: There are no 3 folders in the package:
    Dungeon Architect
    Launch pad
    Samples

    Would be nice if it would be in a root folder to avoid cluttering the project view for people who have lots of things in their assets folder already :)

    Something like
    Dungeon Architect
    --/Core
    --/Launchpad
    --/Samples

    Just more organized :) I did it myself though, not a big deal
     
    TextusGames likes this.
  23. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hey @Necka_ HalfWalls are not present as stairs are not part of the grid flow builder.

    I've placed them in separate root folders to make a clear distinction between them as they are independent. (For e.g., you can wipe out the DungeonArchitect_Samples and DungeonArchitect_LaunchPad folders if you don't need them in your game project without any issues)
     
  24. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    in that case
    upload_2020-1-8_20-51-24.png

    Why there is no Fence, FenceSeparator nodes in the new grid flow builder?
    Why there is no edge-like Wall and WallSeparator nodes?

    You could have supported those 4 nodes for compatibility reason and make new marker SquareWall( in places where someone need full cell wall).
    I personally expected a new grid flow builder to support fence and edge like walls like an old one does.

    Please bring support for these 4 nodes for new grid flow builder(possibly you will need to introduce(rename) SquareWall marker):rolleyes:.

    And if you do not intend to do that please explain your reasons.
    And describe how to bring support for them via script or via spatial constrains.
     
  25. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    You should make it as other developers do (most ones do).
    • CodeRespawn
      • DungeonArchitect
      • DungeonArchitect_LaunchPad
      • DungeonArchitect_Samples

    Also you need to add assembly definition file/files for your product.
    (There is no need for users to recompile your scripts tthen any script is changed in assets folder.)
     
  26. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Oh, Fences aren't supported either? that's a bummer
     
  27. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    It's easy to add that. I'll including it in the next update
     
    Necka_ and TextusGames like this.
  28. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    Thanks. (I assume fence separators are included too)
    Could you also add edge-like walls and wall separators, like in old grid builder? (possibly with preserving of old names "Wall" and "WallSeparator" and renaming the wall marker of new grid flow builder to something like "FullWall"/"CellWall"/"GridWall"/"SquareWall". Overwise people will expect the wall marker to behave like in old builder(as edge) but in fact it occupies full cell.)
     
    Last edited: Jan 9, 2020
  29. DevelopGamer

    DevelopGamer

    Joined:
    Nov 22, 2014
    Posts:
    24
    Hi, thanks for a great asset. I've been trying out the grid flow and was wondering is it possible to have a square border instead of caves/rocks around the edge? I'm trying to make an indoor dungeon but it seems caves around the edge is a setting that cant be changed. I started editing GridFlowExecNodeHandler to make the border more square but couldnt get it working.

    Also I don't see how to make stairs in conjunction with the new grid flow.

    It would be very helpful to see more examples of grid flow, if possible including both of the above features. If anyone else can help I'd also appreciate any advice.
     
  30. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    See:

     
  31. DevelopGamer

    DevelopGamer

    Joined:
    Nov 22, 2014
    Posts:
    24
    I actually did see that post, and I've already tried replacing those but I still end up with organic looking border tiles instead of square corridors. Also the caves still render as random height, so either I'm missing something or that post doesn't fully explain how to solve what I'm trying to achieve.

    Edit: I only just saw that it was your post. If possible can you explain in more detail how you used 4 sided prefabs, I don't see how that avoids the height variation, or how it helps with square map borders?
     
    Last edited: Jan 11, 2020
  32. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    There is an elevation node in grid layout. Skip that node and and rocks will not be elevated.

    stairs is not supporter and will not be supported in the way that original grid builder does.
     
    AliAkbar and Neviah like this.
  33. Yunori

    Yunori

    Joined:
    Nov 12, 2019
    Posts:
    2
    Hello hello :)

    I'm trying to use the infinity Cave template, but I noticed that the generated map is not random.
    The builder only uses the chunk size and position to generate the map, no random seed (InfinityCaveChunkBuilder.cs):

    Code (CSharp):
    1. var baseChunkCoord = MathUtils.ToIntVector(MathUtils.Divide(chunkConfig.chunkPosition, chunkConfig.chunkSize));
    2.                     var chunkCoord = baseChunkCoord + new IntVector(cdx, 0, cdz);
    3.                     var chunkSeed = chunkCoord.GetHashCode();
    4.                     var random = new System.Random(chunkSeed);
    5. ...
    6. world[x, z] = random.NextFloat() < 0.5f;
    If I remove the "chunkSeed" variable, the map becomes random, but some places without exits are created on it.

    Is there a way to make it random without breaking the map?
     
  34. eechungiap

    eechungiap

    Joined:
    Sep 9, 2018
    Posts:
    3
    Hi Ali,
    After the update of 1.10, the FindFurthestRoom function seems to not find the furthest room, this problem can be reproduced by using the included SurvivalShooter sample in the package. Can anyone confirm this? Thanks.
     
  35. gammaker

    gammaker

    Joined:
    Feb 8, 2014
    Posts:
    12
    Hello.

    Can I use Floor Planner in DA with spawning Mission Objects and Enemies Randomly?
    I can't found any documents about this.

    Can I do this?
     
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hello @DevelopGamer, it should be easy to add that and I'm working on implementing this in the next update. You'll have the following options for walls:
    • Treat Walls as tiles (current system)
    • Treat Walls as Edges (similar to the grid builder)

    I'll also add all the good stuff from the Grid builder so the themes you guys designed for the Grid builder should translate well to this builder as well. I'm experimenting with adding stairs. I'll also add fence to the side of the caves and have an option insert fence on also corridor room types
     
    meanme, Neviah, Necka_ and 1 other person like this.
  37. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I'll also add an option to disable caves, so you get a blocky level
     
    meanme, Neviah and TextusGames like this.
  38. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    The floorplanner doesn't support that. I'm planning to rewrite this system with more advanced toolset in the future (using treemaps)
     
    hopeful likes this.
  39. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @eechungiap could you give more info, I'm not able to reproduce this issue in my end. In the shooter sample, it found the furthest room and place the level goal green particle. (unity version number, sample scene etc)

    start_end.jpg
     
  40. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Yunori I'll look into this and fix it in the next build
     
  41. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    Thank you.
    That is a smart desigion.
     
    Neviah likes this.
  42. eechungiap

    eechungiap

    Joined:
    Sep 9, 2018
    Posts:
    3
    Um please correct me if I am wrong, the function is for finding 2 furthest room from each other through room connections after the dungeon is built. Then special room finder from the script is to assign the start and end room. In the screenshot given, the rooms found aren't furthest from each other, check the starting location of player and level goal.
    start_end.png
    Regarding the Dungeon Architect version I am using, it is 1.10.1, I don't have the 1.9 version of this survival shooter scene to do the comparison. Perhaps you can pm the download link for 1.9 because it can't be download from the asset store anymore. I am using Unity 2019.2.13f1 for all comparisons. StartEndProblem2.png
    ---
    But here's what I get from before and after update (1.9 > 1.10) using my own scene, with the same dungeon setting and all. I can't figure out where is the problem as it is getting slightly different results while using the same dungeon setting. (left vers.1.10.1; right vers.1.9)
    startend_After.png startend_Before.png
    Thank you for taking notice in kind.
     
  43. Miguelfanclub

    Miguelfanclub

    Joined:
    Jun 14, 2015
    Posts:
    64
    Question: can you do procedural dungeons based on premade prefab rooms? That means, applying creation rules to rooms rather than individual pieces.
     
  44. TextusGames

    TextusGames

    Joined:
    Dec 8, 2016
    Posts:
    429
    Look at snap flow builder. There you create flow of dungeon and it will be than constructed out of pre made modules (prefab rooms).
     
  45. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    Hi guys, im trining to use some typs of dungeon with my own model (from syntic studio in assetstore) but i see there are a gap between wall and ground cells

    upload_2020-2-1_20-34-57.png
     
  46. Neviah

    Neviah

    Joined:
    Dec 1, 2016
    Posts:
    235
    Turn on blueprint to see the way the layout is supposed to look, and then find the size of your walls and make sure your cell sizes match, x, y, and z.
     
    SarhanSoft likes this.
  47. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    hopeful and SarhanSoft like this.
  48. SarhanSoft

    SarhanSoft

    Joined:
    Apr 15, 2015
    Posts:
    65
    @AliAkbar @Neviah thanks for answer.
    It good with grid example. but it not working on (FlowGrid)
    * the debug draw if checkon nothing view in debug.
    * some walls come wrong
    * also "Fence" object dosent created
    it happend in flow grid.
    upload_2020-2-2_18-40-9.png
     
    Last edited: Feb 2, 2020
  49. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Sarhanbh The grid flow builder treats walls as full tiles and not thin edges. An update is planned in the future where this will be supported. Till then you'll need to have blocky walls that take up a tile
     
  50. GiftedMamba

    GiftedMamba

    Joined:
    Feb 25, 2017
    Posts:
    46
    Hi @AliAkbar. Is there easy way to check to know ID of cell where player is now?

    And is unit in room or in corridor at runtime?
     
    Last edited: Feb 5, 2020