Search Unity

World Building [RELEASED] Dungeon Architect

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

  1. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    @AliAkbar or anyone else, is there a way to copy and paste the spatial constraint rules in the Dungeon Theme editor?
    Having to add them all by hand is sooo many more clicks its going to take a huge amount of extra time for me.

    edit: When I say copy/paste I mean keep the spacial constraint settings when I copy an GameObject node.
     
    Last edited: Oct 17, 2019
  2. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    I know that DA can make platform areas in 2d Mario style, but is it possible to create something in 2d Metroidvania style using DA?
     
    Last edited: Oct 11, 2019
  3. Darren-R

    Darren-R

    Joined:
    Feb 11, 2014
    Posts:
    66
    @AliAkbar
    Hello! I am getting an error when trying to copy a node in the spacial constraints editor. It is when you add a removal rule to the node.
    Easy to replicate. Just try to copy/paste a node with a removal rule.

    ArgumentException: Destination array was not long enough. Check destIndex and length, and the array's lower bounds

    Cheers.
     
  4. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    Hey, I am trying to add some exits to my room and i used the FloorPlanRoomMarkers.cs as a base. currently it looks like this:

    upload_2019-10-23_10-48-50.png
    as you can see, the exits are a) a bit off and b) also in the middle of the rom. here is the code, maybe you can spot what i did wrong


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using DungeonArchitect;
    5. using DungeonArchitect.Builders.FloorPlan;
    6.  
    7. public class FloorPlanRoomMarkers : DungeonMarkerEmitter {
    8.  
    9.     public override void EmitMarkers(DungeonBuilder builder)
    10.     {
    11.         var floorModel = builder.Model as FloorPlanModel;
    12.         if (floorModel == null)
    13.         {
    14.             return;
    15.         }
    16.  
    17.         var roomChunks = new List<FloorChunk>();
    18.         foreach (var chunk in floorModel.Chunks)
    19.         {
    20.             if (chunk.ChunkType == FloorChunkType.Room)
    21.             {
    22.                 roomChunks.Add(chunk);
    23.             }
    24.  
    25.         }
    26.  
    27.         var hallChunks = new List<FloorChunk>();
    28.         foreach (var chunk in floorModel.Chunks)
    29.         {
    30.             if (chunk.ChunkType == FloorChunkType.Hall)
    31.             {
    32.                 hallChunks.Add(chunk);
    33.             }
    34.  
    35.         }
    36.  
    37.         var gridSize = floorModel.Config.GridSize;
    38.         foreach (var roomChunk in roomChunks)
    39.         {
    40.             DecorateRoom(builder, roomChunk, gridSize);
    41.         }
    42.         foreach (var hallChunk in hallChunks)
    43.         {
    44.             DecorateHall(builder, hallChunk, gridSize);
    45.         }
    46.     }
    47.  
    48.     void DecorateRoom(DungeonBuilder builder, FloorChunk roomChunk, Vector3 gridSize)
    49.     {
    50.         var bounds = roomChunk.Bounds;
    51.         var x0 = bounds.Location.x;
    52.         var x1 = bounds.Location.x + bounds.Size.x;
    53.         var y = bounds.Location.y;
    54.         var z0 = bounds.Location.z;
    55.         var z1 = bounds.Location.z + bounds.Size.z;
    56.  
    57.         EmitChunkMarker(builder, "RoomCorner", new Vector3(x0, y, z0), 0, gridSize, roomChunk.Id);
    58.         EmitChunkMarker(builder, "RoomCorner", new Vector3(x1, y, z0), -90, gridSize, roomChunk.Id);
    59.         EmitChunkMarker(builder, "RoomCorner", new Vector3(x1, y, z1), 180, gridSize, roomChunk.Id);
    60.         EmitChunkMarker(builder, "RoomCorner", new Vector3(x0, y, z1), 90, gridSize, roomChunk.Id);
    61.  
    62.         EmitChunkMarker(builder, "RoomCenter", new Vector3(x0 + x1, y + y, z0 + z1) / 2.0f, 270, gridSize, roomChunk.Id);
    63.     }
    64.  
    65.     void DecorateHall(DungeonBuilder builder, FloorChunk roomChunk, Vector3 gridSize)
    66.     {
    67.         var bounds = roomChunk.Bounds;
    68.         var x0 = bounds.Location.x;
    69.         var x1 = bounds.Location.x + bounds.Size.x;
    70.         var y = bounds.Location.y;
    71.         var z0 = bounds.Location.z;
    72.         var z1 = bounds.Location.z + bounds.Size.z;
    73.  
    74.         EmitChunkMarker(builder, "Elevator", new Vector3(x0, y, z0), 0, gridSize, roomChunk.Id);
    75.         //EmitChunkMarker(builder, "Elevator", new Vector3(x1, y, z0), -90, gridSize, roomChunk.Id);
    76.         //EmitChunkMarker(builder, "Elevator", new Vector3(x1, y, z1), 180, gridSize, roomChunk.Id);
    77.         //EmitChunkMarker(builder, "Elevator", new Vector3(x0, y, z1), 90, gridSize, roomChunk.Id);
    78.  
    79.         //EmitChunkMarker(builder, "Elevator", new Vector3(x0 + x1, y + y, z0 + z1) / 1.0f, 270, gridSize, roomChunk.Id);
    80.     }
    81.  
    82.     void EmitChunkMarker(DungeonBuilder builder, string markerName, Vector3 gridPositionF, float angle, Vector3 gridSize, int cellId)
    83.     {
    84.         var worldPosition = Vector3.Scale(gridPositionF, gridSize);
    85.         var matrix = Matrix4x4.TRS(worldPosition, Quaternion.Euler(0, angle, 0), Vector3.one);
    86.         var gridPosition = new IntVector(gridPositionF);
    87.         builder.EmitMarker(markerName, matrix, gridPosition, cellId);
    88.     }
    89. }
    90.  
     
  5. Der_Kevin

    Der_Kevin

    Joined:
    Jan 2, 2013
    Posts:
    517
    is there any better place/contact to get an answer for this?
     
  6. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    102
  7. DropNodes

    DropNodes

    Joined:
    Jun 11, 2019
    Posts:
    39
    hey @AliAkbar any updates on the new release? last time you posted that an update is coming was 2 months ago
     
  8. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    He also has a discord
     
  9. DropNodes

    DropNodes

    Joined:
    Jun 11, 2019
    Posts:
    39
    Can you post an invite link please?
     
  10. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    319
    Rahd likes this.
  11. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hello friends, I've been working hard on a major new update that takes DA to a whole new level. I'll need a week or so to polish it up. I'll post more details and a video soon

    Check this out:
    2019-11-12 10_12_59-Window.png

    This was inspired by Joris Dormans' talk on cyclic dungeons:
     
    Recon03, Sehee26 and hopeful like this.
  12. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Yeah I mentioned it earlier, glad you look it up! You'll soon be the most sophisticated pcg level editor out there :cool:

    Also thanks for the video I wasn't' aware he made a talk.
     
    AliAkbar likes this.
  13. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Lava, water etc as background overlays

    lava.png lava2.png
    lava.png
    lava2.png
     
  14. TTG-Quintessential

    TTG-Quintessential

    Joined:
    Dec 5, 2017
    Posts:
    7
    @AliAkbar
    Hi I have an issue using PlatformVolumes.
    I'm using the GridDungeon and 2 PlatformVolumes, highlighted below in BLUE, but this particular seed ran and the Dungeon is no connected, I'm hoping that this isn't a bu I need to track down, I thought that the PlatformVolumes would guarantee a connection, can anybody help with this, what to look at? is there a proximity thing that's failing? I have not delved int othe code yet to try to find out what's going on, kind of hoped that DA would be pretty stable and I don't mind it being a black box if it works.. but this means my Entrance Volume (bottom Left) is now a broken dungeon :(

    Cheers

    upload_2019-11-13_16-11-55.png
     
  15. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @unity_Lb2lDqR5J9MXZw could you confirm if that platform volume is set to a room and not corridor? Only rooms will connect to the main dungeon and not corridors by design
     
  16. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Added an elevation map
    da_elevation.png
     
    Sehee26 likes this.
  17. TTG-Quintessential

    TTG-Quintessential

    Joined:
    Dec 5, 2017
    Posts:
    7
    @AliAkbar Yes both volume are set to Room.

    I am using Fast Cell Distribution, becuase I need to conatin my dungeon within 40x40 Units (Unity). I tried using a Negation Volume, but the problem is that the actual dungeon can generate a loop outside the volume and therefor hav cut off areas, I need a fully "secure" dungeon within 40x40 units with a Entrance Volume and Exit volume, here are the settings I'm using on the GridDungeonConfig - this is the seed: 549846781

    The small pink box in the bottom left of my initial image is a MarkerReplace volume where I swap the ground (using Spatial contstraints) to an entrance door

    Would you have any advice on where to debug, I need to get this sorted as it's integral to the game, so willing to delve into the code and provide info where need be.

    Cheers

    upload_2019-11-14_10-16-39.png
     
    Last edited: Nov 14, 2019
  18. TTG-Quintessential

    TTG-Quintessential

    Joined:
    Dec 5, 2017
    Posts:
    7
    Last edited: Nov 14, 2019
  19. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
  20. farazk86

    farazk86

    Joined:
    May 31, 2017
    Posts:
    195
    Hi @AliAkbar,

    I bought your awesome asset quite some time ago (last year i guess) and wanted to make a great game with it but life got in the way and I had to put my plans on break.

    I'm back now and want to start on that game I planned last year but I read the review mentioning that a lot of your used functions are deprecated now. Do you have any plan on updating this and fix the deprecated functions?

    Also if I am to start a new game now, which Unity version would be best to use. Can I use the latest version 2019.2 ?

    Thanks
     
  21. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hey @farazk86 Thank you for using DA. I'll be releasing a major update soon (5-10 days). I also suggest you have a look at the new Grid Flow builder I posted above as it opens up lots of possibilities
     
    farazk86 and Mohamed-Anis like this.
  22. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    is this a purely 2D update or will we get to see it's effect on 3D dungeons eventually?
     
  23. farazk86

    farazk86

    Joined:
    May 31, 2017
    Posts:
    195
    Thank you. Thats great to know :)

    I'm following the documentation here: http://coderespawn.github.io/dungeon-architect-user-guide-unity/stage/html/user_guide_1.4.0.html

    is this still up to date? Will you be adding the new grid flow cyclic generators to the documentation?

    Thanks :)
     
  24. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @farazk86 Sure, I'll be making detailed docs and video tutorials for this
     
    farazk86 likes this.
  25. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Nevercallmebyname It works on both 3D and 2D
     
  26. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Added lots of usability improvements in the editor. You can see the execution state of each node and errors if any

    2019-11-19 18_54_07-Window.png

    I've added support for overlays, They can be useful for overlaying stuff on top of your dungeon layouts (like trees, rocks etc)
    The following dungeon layout has trees (green dots) and rocks (red dots). These overlays do not block the main path and the level is always playable (i.e. key/locks/enemies and other items are placed in accessible locations that are not blocked by these overlays)

    You generate these overlays using noise or specify your own script and generate them as you like

    2019-11-19 18_55_08-Window.png
     
  27. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @unity_Lb2lDqR5J9MXZw I've check and I couldn't reproduce this with the seed.
    It looks like an issue with fast distribution combined with "Walls as Tile Blocks" (the doors won't be placed correctly). Could you try disabling the experimental fast cell distribution method?

    The new Grid Flow builder will allow for a lot of flexibility and is also constrained within a certain bounds
     
  28. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    I'm just waiting to see a preview of it used in 3D then
     
  29. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I've fixed the issue with the grid builder which @unity_Lb2lDqR5J9MXZw reported where in some rare cases, some rooms would not be included as part of the dungeon. It will be available in the next update.

    Note: Generated dungeon layouts will not be the same as they were in the previous version (for a particular seed), since the fix causes the layout generation algorithm to slightly change
     
  30. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    859
    You probably hate these questions but when do you think this update will be available? It has features I'd love to use right away. :) Also, will you be doing a video demonstrating the changes?
     
    AliAkbar likes this.
  31. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @StevenPicard I'm work on releasing this soon. I'll create full documentation for it with different game samples
     
    StevenPicard likes this.
  32. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I created a bunch of low poly assets for the sample game that will ship with the next update

    floors.jpg trees.jpg b1.jpg b3.jpg
    b4.jpg
     
  33. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Some wip screens of the demo theme. This level was generated using the new GridFlow builder. I've overlaid trees, different types of rocks (red, black grey etc)

    u1.jpg u2.jpg
     

    Attached Files:

    • u3.jpg
      u3.jpg
      File size:
      263.2 KB
      Views:
      480
    Arkade and farazk86 like this.
  34. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I added a new node called "Optimize tilemap" It removes tiles that are more than the specified distance away from the playable level. This way you won't spawn meshes that the player wont wont see
    x1.jpg

    cul.jpg
     
    TextusGames, farazk86 and Neviah like this.
  35. bmmshayan

    bmmshayan

    Joined:
    May 20, 2014
    Posts:
    21
    Hello!
    I want to buy your asset, the question is: If I buy an asset today, will I receive your major update for free, or is it worth the wait for an update?
    Thanks.
     
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @bmmshayan Thank you for your interest. All future updates, both minor and major, will be free. I've added lots of new stuff since release 4 years ago and I have a lot more new features planned
     
  37. bmmshayan

    bmmshayan

    Joined:
    May 20, 2014
    Posts:
    21
    Thanks! I bought it! :)
     
  38. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @bmmshayan Thank you :)

    Key Locks assets for the sample demo

    2019-11-25 14_55_44-Window.png doors.png
     
  39. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    In the node where you create a key-lock, you also specify the marker names for the key and locks.

    key_lock.png

    Then in the theme file you create those marker nodes and place your key-lock assets

    key_theme1.jpg

    I've added a bunch of other key-lock assets in the sample (for alternate path exit, main treasure room and alternate path treasure room)

    key_theme2.jpg


    2019-11-25 16_39_22-Window.jpg
    bonus.jpg
     
    RafaelMartin likes this.
  40. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    One-way doors can be traversed only from one direction. This makes sure the player doesn't go around locked doors. In this demo, I've created a ramp on the door so they player can go only one way. You can have your own gameplay specific logic (e.g. have the door unlocked only from one side, and them keep it open afterwards)

    oneway1.jpg oneway2.jpg
     
    Neviah likes this.
  41. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Added a layer of foliage with the overlay node

    grass1.jpg grass2.jpg
     
    Arkade and RafaelMartin like this.
  42. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    DA will place a key or a lock component in your spawned object with references to the other object (e.g. keys will have references to all the spawned lock game objects that work with this key and vice versa)

    key_config.png

    This makes it easy to checking if the key can open a certain door

    Also added a editor key-lock link visualization when you click on an key or a lock

    key_lock_link.jpg
     
    Neviah and RafaelMartin like this.
  43. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Treasure Chest

    chest.jpg chest2.jpg
     
  44. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Overview of the new Grid Flow tool

     
  45. Nevercallmebyname

    Nevercallmebyname

    Joined:
    Nov 18, 2013
    Posts:
    120
    This is awesome.

    uh, on the subject of the keys, can we do like a more modern game and put the key in an enemy's inventory so you have to kill the enemy to get the key? I mean I realise this is all about level gen not gameplay but bit of an issue if trying that would break the Dungeon Architect doors.

    Also, about the doors, do I HAVE to have doors between every two sections of the level or is there a way to make a more open area like a long hallway or exterior courtyard?
     
  46. pocketpair

    pocketpair

    Joined:
    Jul 7, 2015
    Posts:
    72
    Hi, I'm newbie of Dungeon Architect.
    I'd like to create the mabinogi like dungeon with

    - There are Start and Goal.
    - Before goal, there is a boss room(large size).
    - Almost single route dungeon like below.
    - 1 corridor connects only 1(dead end corridor) or 2 rooms (normal corridor).

    Simple Example
    S is Start
    G is Goal
    The large room is boss room.



    More complicated one
    upload_2019-11-26_20-57-30.jpeg

    Can I create the dungeon with default grid model? Or should I fork something from?
    Or @AliAkbar, are you developing something new functions related with what I want?

    Thank you for your help!
     
  47. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @pocketpair Try the snap builder I release a while ago. I has a powerful graph grammar system that allows you to specify these kind of paths.

    DungeonArchitect_Samples\DemoBuilder_Snap\DungeonFlow\GameDungeonFlow

    snap.png snap_level.jpg
     
  48. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You can specify your own logic on how you want to deal with keys, For e.g., you could spawn a regular NPC instead of the key. This NPC will have the key info component attached to it by DA and it could add that game specific key to its inventory after reading it in the Awake() function


    As for merging similar adjacent rooms together into a larger room, it can be done. I'll explore that in the future builds
     
  49. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I made a major rewrite of the UI library. You can now resize the graph panels you see in the Snap Flow editor and Grid Flow editors

    When I initially started work on DA, I ended up creating a custom UI library for the graph editor and other widgets to get more control (instead of relying Unity's editor UI system for the graph editor).

    Last few weeks I worked on moving most of the UI code over to the runtime module. This means in the future we can have the theme editor in your game itself and you can let your players theme their own worlds
     
    Arkade likes this.
  50. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    I'm sooo looking forward to Grid Flow! Tempted to entirely pause level design work just to wait for it!
    One question: If we already have systems (code etc) for locks, breakable chests that reveal keys etc, how will we integrate these? (e.g. my system uses ScriptableObject as the 'keycode' to identify which key opens which lock. Can I add code to have it correctly placed and maybe even visualised?)

    Wow. But.... (and this is just an idle question) just 'theme' and not 're-structure' ? (i.e. runtime graph editing ... assuming we don't mind them super-breaking our levels ;-) )

    Thanks. Looking awesome as always!