Search Unity

[RELEASED] Dungeon Architect

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

  1. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    @AliAkbar there is a bug when using mesh merger, scale of graph objects don't taken in consideration. Also is there a way to have some objects not get merged? So we can have some objects disappear after events etc.Unity 2018.3.1, latest DA
     
    Last edited: Jan 12, 2019
  2. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    102
    @AliAkbar
    I have DA running on 2018.3 ok, but I have created a new project on same Unity Version 2018.3 and the new project runs ok also (It builds the Dungeon on the Dungeon script) BUT I can't open the DA window editor. It's empty and I get this infinite loop error:

    NullReferenceException: Object reference not set to an instance of an object
    DungeonArchitect.Editors.GraphNodeRenderer.DrawNodeTexture (DungeonArchitect.Editors.GraphRendererContext rendererContext, DungeonArchitect.Graphs.GraphNode node, DungeonArchitect.Graphs.GraphCamera camera, System.String textureName) (at Assets/DungeonArchitect/Editor/GraphEditor/Renderers/GraphNodeRenderer.cs:78)
    DungeonArchitect.Editors.MarkerNodeRenderer.Draw (DungeonArchitect.Editors.GraphRendererContext rendererContext, DungeonArchitect.Graphs.GraphNode node, DungeonArchitect.Graphs.GraphCamera camera) (at Assets/DungeonArchitect/Editor/ThemeEditor/NodeEditors/MarkerNodeEditor.cs:44)
    DungeonArchitect.Editors.GraphEditor.Draw (UnityEngine.Rect bounds) (at Assets/DungeonArchitect/Editor/GraphEditor/GraphEditor.cs:748)
    DungeonArchitect.Editors.DungeonThemeEditorWindow.OnGUI () (at Assets/DungeonArchitect/Editor/ThemeEditor/DungeonThemeEditorWindow.cs:220)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <ac823e2bb42b41bda67924a45a0173c3>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:342)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:336)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:310)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean customBorder, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:363)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:322)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:266)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:438)
    UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent () (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:412)
    UnityEngine.Experimental.UIElements.ImmediateStylePainter.DrawImmediate (System.Action callback) (at C:/buildslave/unity/build/Modules/UIElements/ImmediateStylePainter.cs:113)
    UnityEngine.Experimental.UIElements.IMGUIContainer.DoRepaint (UnityEngine.Experimental.UIElements.IStylePainter painter) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:98)
    UnityEngine.Experimental.UIElements.VisualElement.Repaint (UnityEngine.Experimental.UIElements.IStylePainter painter) (at C:/buildslave/unity/build/Modules/UIElements/VisualElement.cs:845)
    UnityEngine.Experimental.UIElements.VisualTreeRepaintUpdater.PaintSubTree (UnityEngine.Experimental.UIElements.VisualElement root, UnityEngine.Matrix4x4 offset, System.Boolean shouldClip, System.Boolean shouldCache, UnityEngine.Rect currentGlobalClip) (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeRepaintUpdater.cs:310)
    UnityEngine.Experimental.UIElements.VisualTreeRepaintUpdater.PaintSubTreeChildren (UnityEngine.Experimental.UIElements.VisualElement root, UnityEngine.Matrix4x4 offset, System.Boolean shouldClip, System.Boolean shouldCache, UnityEngine.Rect textureClip) (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeRepaintUpdater.cs:3
     
  3. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    Completely redesigned the way rooms connect to corridors. It produces a higher quality result and can handle different constraints. We can now have thick walls that take up a full tile (in addition to the previously supported thin walls that take up the edge). This requires a completely different layout connection strategy (since the doors cannot be placed on the corners of the room due to thick wall tiles) and the new system handles it well (notice the placement of the green doors)

    This is also required for proper 2D level generation as wall sprites take up a tile. I'm working on a 2D game to ship with the next update



    This system can also be extended to have doors more than one tile wide in the future

    You can switch between the two from the configuration (your theme has to accommodate for this of course)

     
  4. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
  5. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    197
    @AliAkbar that's great news! I have DA 1.4.0 on my project (U552) and do not wish to totally upgrade DA (since I have much of custom code extending DA). Could you tell me whether it is possible to make this mesh merger work with 1.4 (if so, where to look in code?)
     
  6. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    197
    Ok replying my own quesiton - it's pretty simple and works like a charm - just need to copy MeshMerger.cs and IntVector2.cs - in case someone needs it to work backwards.
     
    AliAkbar likes this.
  7. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    197
    @AliAkbar there is a bug with MeshMerger. It works on samples scenes, but not on mine dungeon. SplitPerVertexLimit() returns null reference exception (I am not sure but maybe it is related to the scale of source meshes or the fact they reside deeper in object hierarchy). This is the message I get:


    Also I need selective merging, preferably by layer or tag (I don't want by doors merged) - where do I modify the code for that? Thanks!
     
    SSL7 likes this.
  8. growling_egg

    growling_egg

    Joined:
    Sep 2, 2012
    Posts:
    58
    Hello,

    I'm struggling a little with DA. I'm still working through the videos but I've read the docs and I have a couple questions.

    I still don't quite understand how DA knows how different markers relate to one another, or more specifically how they know where to render the game objects in relation to other game objects.

    For instance, I am looking at the SimpleShapes example scene. It's pretty slick how the fence and the underground supports are all defined modularly in the theme file, but I don't quite see how DA knows that the support pillars go underneath the ground platforms, or that they should go along the perimeter and not right in the middle of each tile.

    When I try to make my own theme files, it seems like I can get the ground to work, but I'm not clear on how to change the theme to fine-tune the relative placement of things.

    Also, does DA add every marker that you create in a theme? Sometimes it seems like I'll add a new marker to a theme file and I won't notice any changes in my scene.

    Thanks for any help.


    EDIT: I should clarify, I know how to change things like probability and offset for individual nodes, but how can I make a new marker for, say, an archway, and have it know that these archways go where there are big openings the player can go through? Is all that done through the selection rules?
     
    Last edited: Jan 18, 2019
  9. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    I second this for scale of source meshes and selective merging
     
  10. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    Hello! Thank you for your continued work on this. I know last May you teased a mission generator, has this been integrated yet? Or do you have an expected release date? I have a need for lock and key mechanics. Thank you!
     
  11. ryanflees

    ryanflees

    Joined:
    Nov 15, 2014
    Posts:
    24
    Hi, I haven't bought Dungeon Architect the asset yet as I'm still evaluating if it's suitable for me.

    I've seen some documents and videos about it, it's super good for a random generated dungeon/city at runtime.
    But I don't see it supports different styles of environment in a single scene at the same time.

    I might need something like Heroes 3 map like below(in 3D), generated maps will have partially different kinds of environment put together. See the picture has grassland, desert, and rusted land, they are aparted from each other(not mixed),and the edges are randomly placed in between.
    And some towns, some mountains.

    I don't konw if Dungeon Architect could achieve similar generation(in 3D of course), or maybe with some code to extend by myself.
    Thanks for reading this. :)

    maxresdefault.jpg
     
  12. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    You have the capability of mixing themes using theme volumes. These will apple different themes to different areas. You also have the capability of having multiple dungeons in the same scene. These can be connected via a more tailored custom made connector piece to bridge the gap for a smoother look. This connector isn’t something Dungeon Wrchitect provides out of the box with its creation.
     
    AliAkbar and ryanflees like this.
  13. ArkadiuszR

    ArkadiuszR

    Joined:
    Jan 21, 2016
    Posts:
    20
    @AliAkbar Hello, could you help me with my case please?
    I need something what allow me detect if marker was not assign in radius.
    When i put name of this same martker in Spatial consstaint = all markers disapear. But I only want to check(for example: method CanSelect) if other marker is not in range. I create graph but it need one more empty marker. I'm sure you know better way to do this.
    Here is my solution:
     

    Attached Files:

  14. ArkadiuszR

    ArkadiuszR

    Joined:
    Jan 21, 2016
    Posts:
    20
    @AliAkbar
    How to avoid this situation? (ground 4x4 and stairs 4x4)
     
  15. scranley

    scranley

    Joined:
    Dec 1, 2013
    Posts:
    7
    @Darren-R

    I liked your post on having the user drawing the dungeon layout..How did you make it so the user can draw the dungeon? I wish there was an example? All I want to do is make it so the user can place 4 basic tiles. The user gets a random 1 of 4 tiles and clicks the empty ground tile and the dungeon tile is placed.

    Seamus
     
  16. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    Any ETA on the new update with story/missions creation?
     
    maxaud likes this.
  17. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    742
    Does it work in unity 2018? Cuz I found a lot of missing scripts on camera in sample scenes, and nothing happens after I click the build dungeon button!
     
  18. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    102
    It works even in 2018.3, I use it on this version.
     
  19. arturmandas

    arturmandas

    Joined:
    Sep 29, 2012
    Posts:
    197
    @AliAkbar is it possible to merge adjoining box colliders into 1 box collider for efficiency?
     
  20. growling_egg

    growling_egg

    Joined:
    Sep 2, 2012
    Posts:
    58
    @AliAkbar

    Looking forward to the new update very much. Will it have bug fixes for the existing Dungeon builders? The DungeonGrid and DungeonFloorPlanner both cause Unity to crash due to what seems to be a memory-consuming loop that never exits somewhere when I try to build my dungeon. With DungeonGrid specifically I know that building a dungeon with min room size: 3 and max room size: 4 will cause a crash, and with DungeonFloorPlanner, a min room size: 3 and max room size: 6 will cause a crash.

    It has been this way for a few months now, but this was being looked into back in October or November. If there's anything I can do to avoid these crashes (even if it's just some ugly error that says it failed) that would be fine, but the time it takes to force quit Unity and reopen it again just to try another value is really difficult to work around. Thanks for any help!
     
  21. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    19
    Hello, I've downloaded the 'Unity Dungeon Architect Samples Thridparty v1.6.0' file, copied it to my assets folder, and am getting this compile error:

    Assets/DungeonArchitect_Samples_Thridparty/Demos/Theme_3DF_VillageExterior_Gaia/Scripts/StrongholdLandscapeModifier.cs(87,32): error CS0246: The type or namespace name `SimpleCityDungeonModel' could not be found. Are you missing `DungeonArchitect.Builders.SimpleCity' using directive?

    It's odd because it was working fine yesterday yet is giving this error this morning. Anyone aware of a solution for this? Thanks in advance.
     
  22. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    19
    I deleted the folder, removed the error. Odd one there.
     
  23. rlhalh

    rlhalh

    Joined:
    Jun 3, 2018
    Posts:
    19
    Hello, I'm having trouble with the Corner Beautifier Marker Emitter as used in 3d scenes. I've added the script to my DungeonGrid, added a Marker Emitter into the Dungeon Theme (named Corner_1), added a game object to the emitter (a white cube), yet it is not appear in the scene (BasicShapeDemo scene).

    I've studied the use of this emitter in the supplied demos (Game2D_JackRabbit) to see the functionality of this emitter and am no closer to getting it working in a 3d scene.

    Is there any resource/tutorial that can clearly outline the use of this emitter? For example, the SpatialConstraints demos do a good job of clearly outlining how it functions in DA. Thanks in advance.
     
  24. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    Does anyone know if there is a way to scale everything at once? I have quiet a few nodes but would like to experiment with scale to find a good fit and it would be nice if I can do it during generation.
     
  25. maxaud

    maxaud

    Joined:
    Feb 12, 2016
    Posts:
    162
    Additionally, any way to use the snap dungeon builder so that it doesn't overlap and put a room above another room?

    EDIT: I found out out to cheat this by adding a tall cube/collider below my snapped rooms. It takes this tall piece in to account when determining if it can be placed.
     
    Last edited: Feb 3, 2019
  26. KungFuBrad

    KungFuBrad

    Joined:
    Apr 12, 2018
    Posts:
    9
    Greetings Ali!

    Any update/ETA on when the platforming update will be available?

    Thanks!
     
  27. Fyrburn

    Fyrburn

    Joined:
    Aug 30, 2013
    Posts:
    6
    Might be quite an obscure question.

    Is it possible somehow to paint a manual dungeon, save that layout, and then Build() it at runtime swapping out themes? Saving/loading a prefab seems to wipe all the paint data. And unity's new highly unintuitive prefab system I can't roll back from doesn't like me trying to modify the prefab geometry holder.

    For example, I want to hand-build 10 unique room layout patterns, then my "Caves" and "Scifi base" themes will apply their own rules onto that painted set of tiles. I'll decide as I load the level which it should be.
     
  28. DragonFist22

    DragonFist22

    Joined:
    Mar 28, 2018
    Posts:
    9
    It seems to me that in 2018.3, SpatialContraints are no longer working. Am I missing something?
     
  29. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    Hey everyone, I'm working on bringing the Dungeon Flow feature to Unity and will have an update by the end of the week. This will open up tons of possibilities and allow you to design complex layouts (complex key/lock system, shops, boss behind keys etc)

    I'll have more info soon



    I'll also fix all the other issues in the next update
     
    Weblox, sfoust, Sehee26 and 5 others like this.
  30. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    THANK YOU! This is awesome!
     
  31. sfoust

    sfoust

    Joined:
    May 18, 2011
    Posts:
    25
    I bought DA a while back, cause it looks like an AWESOME tool, but just starting to play with it.

    Got a noob question/problem: In all the Game3D_SurvivalShooter demo game scenes the player spawns outside of the generated game world most of the time.

    I'm using Unity 2018.2.7 and the only console messages i'm getting is a warning for a missing script for the Main Camera gameobject.

    Thanks for any thoughts on how to fix this issue?

    Update: I also tried a fresh install of DA in Unity 2018.3.5 and got the same results (player spawns outside generated level).
     
    Last edited: Feb 13, 2019
  32. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,097
    Is it possible to use Dungeon Architect to create a single medieval style house? (or multiple houses) maybe with mutliple floors?
     
  33. ArkadiuszR

    ArkadiuszR

    Joined:
    Jan 21, 2016
    Posts:
    20
    Maybe not house but somthing like tower yes. I saw theme for that somewhere.
     
    protopop likes this.
  34. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,097
    Interesting. Thank you. I guess at least a single building - a tower - is possible. I think i would have to figure out if i can do multi story, and also just set it to generate a single room.
     
  35. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    301
    Yes, with platform volumes and theme overrides it is possible. I am making a three story school with multiple room types. Its kind of wonky since I have to use a separate dungeon for each floor, but you have control over room locations (I would wish for a little more layout hand design support in DA). And since placement of everything inside the rooms and corridors is procedural once you set up your graphs its easy to change stuff if you change your mind on anything.
    Not sure what the runtime cost would be for having a large number of dungeons, but if you want the houses to be made during design time, and just make a bunch of houses without having to hand place everything and then save those, then I would recommend DA.
     
    AliAkbar and protopop like this.
  36. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,097
    Thanks:) Your school sounds cool. Ill check out platform volumes and theme overrides. I guess you can create mutiple rooms on each story? and then as you say each story has to be a seperate Dungeon Architect instance. YEah i am looking for solutions for procedural medieval buildings so this info helps.
     
  37. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    301
    Yes, something like this:
    Screenshot (234).png
    And then copy the same layout and move it above.
    And have 1 master theme and an override theme for each room type.
    You would have the base theme for walls, and then override for the kitchen, the living room, the stairs, …
    There is a RoomBuilder generator in DA (for rooms/houses), but it's output is very crude. Using the grid dungeon generator this way instead, you get exact control over the layout.
     
    AliAkbar likes this.
  38. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    97
    Dungeon Flow is a great new feature. But, please don't forget the 2D tools.
     
    AliAkbar likes this.
  39. Tsilliev

    Tsilliev

    Joined:
    Jan 21, 2014
    Posts:
    30
    Hello, I consider buying but have a few questions:
    1) Can the generator populate the whole room with random objects? I am speaking around the center of the room? For an example - long table with chairs around it, or warehouse racks, crates, not only near the walls?

    2) I see that different style/architecture/biome is possible, but can it be done randomly? The volume box being placed randomly X times, with X different biomes?

    3) I see that Ali, the creator is active and that there will be support if any errors/crashes occur?
    I don't see any recent reports of crashes, so the asset is stable, and you can regenerate a dungeon like 20 times without problems with different objects in it?
     
  40. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    @Nevercallmebyname It should be possible to create vertical levels with the new system, including multi-level dungeons
     
  41. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    It is compatible with 2018.3. There is a depricated warning on the landscape transformer as they've added some new features to landscape. I've updated the code in the 2018.3+ branch so the warnings won't show up
     
  42. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    @GorkaChampion try dropping in a new dungeon prefab for each dungeon. Here's an example:

     
  43. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    You'd want to use the Snap builder. It stitches pre-built rooms together. The next update will let you define your own layout using a new dungeon flow editor
     
  44. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    Is it still planned to release the new version this week?
     
    AliAkbar likes this.
  45. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    @Neurolog could you give more info? I've added a demo with city landscape transformer

    All of these landscapes were painted at runtime:
     
  46. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    Yes, I completed the flow editor and integrated it to the snap builder. I'll need a few more days for the demos
     
  47. SSL7

    SSL7

    Joined:
    Mar 23, 2016
    Posts:
    296
    Can I get my hands on the beta without the demos? :) Also will it only work with snapbuilder?
     
  48. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    @growling_egg I've fixed the issue
     
  49. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    @chaenator you can do that with the new system using the dungeon flow graphs. I'll add samples on how to do this
     
  50. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    595
    From the Theme editor window, choose Tools > Refresh thumbnail