Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Dungeon Architect

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

  1. ephemeral-life

    ephemeral-life

    Joined:
    Sep 12, 2015
    Posts:
    488
    Looks really good. Any chance we could get a circular minimap option too? Dunno how complicated it would be to implement though.
     
  2. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    That should be possible. Just position the mini map camera right above the minimap player to get a 2D look on your mini map. Then apply a circular texture mask to remove content outside the circle
     
    ephemeral-life likes this.
  3. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Created another video showcasing the tech demo

     
  4. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    Ok, I'm pretty much at the "shut up and take my money" point right now. Will you please, for the love of all that is holy, release this? I just pulled out my credit card so fast it caught on fire.
     
    AliAkbar likes this.
  5. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    :D
     
  6. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    I have a couple of questions, actually...

    - I wish to use this for a first-person game, can I get your system to put roofs on, like the floor? It seems all of the videos are using third-person controllers.
    - Can I create a dungeon within a dungeon? (well, a generated outdoor area with a generated temple complex inside of it) Maybe I have to create the dungeons separately and load the one into the other?

    Thanks for your time!
     
    AliAkbar likes this.
  7. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    @Sabathius you can add ceilings by attaching it to the ground node and moving it up. You can also have multiple dungeons in the same map. Each dungeons layout is built relative to the position of the Dungeon gameobject.
     
    Sabathius likes this.
  8. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    I've submitted DA to the asset store for review. Will keep you folks posted :)
     
  9. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
     
    JamesArndt, Griffo and AliAkbar like this.
  10. Mana-Station

    Mana-Station

    Joined:
    Apr 27, 2015
    Posts:
    165
    Great news! :) Good luck!
     
    S4G4N and AliAkbar like this.
  11. Invector

    Invector

    Joined:
    Jun 23, 2015
    Posts:
    926
    This looks absolutely amazing!
    Excelent job, I'm sure that will be a great asset to have at the Store :D
     
    AliAkbar likes this.
  12. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Great :)

    Can we decide for each assets type or wall types, the probability to be placed in the level for each one individually ?
    For example i want a low probability for gems and a high probability for rocks.
     
    AliAkbar likes this.
  13. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    @Invector Thanks!

    @zenGarden Yes, you can define a probability for any visual node in the graph (visual nodes spawn your game objects)
     
    zenGarden likes this.
  14. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    I added some 2D love

    Here's is a sample 2D game that is bundled with DA. This will help you immediately get started with your 2D game.

    Play Now: 2D Tech Demo



    It shows you various concepts:
    • Dynamic navigation Support for 2D (in the XY plane). Unity 5 doesn't support it out of the box.
    • Navigation Agent 2D to move your 2D bots using the nav mesh
    • AI for the bots to move around in the nav mesh. The bots have various states implemented (patrol, persuit, search) with vision cone sensors. This is the same as the 3D AI demo slightly modifed for 2D. It will give you a good base to start building your awesome games on
    • Procedural level creation during runtime
    • Spawning NPCs in the procedural level
    • Spawning Pickups (mana, health etc) in the procedural level
    • Advanced theming using marker emitters to beautify the 2D map with contextual based tiles

    The level was created using the following theme file:


    I resubmitted the package to asset store with this demo.
     
    LoDx and RonnyDance like this.
  15. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Awesome. I am also a more FPS / Third Person fan (3D).
    Would be great if you also could show a demo using for example Cobus Tile A Dungeon Set like you did with the 2D Demo one post before. The best would be with roofs in it ;)

    I am really looking forward using this asset. It seems so pretty and well organized for creating procedural dungeons pretty fast.

    Cheers
    Ronny
     
  16. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Great.

    If i have a dungeon floor with one or more mid bosses and one final boss , is the generator able to place somzwherz in the middle of the level some semi boss or somewhere far from entrance and final boss ?
    It is possible to define an item spawned one time only in the level like some rare treasure chest ?
    Can we define a rule like some chest objects would always have one ore more type of a specific ennemie around it ?

    There is a graphic bug, it is ude to 2D tiles ?
     
    Last edited: Feb 6, 2016
  17. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    And to add to zenGarden's question:

    What about some singleton nodes:
    - place one player spawn point, and one player exit (or, multiple exits?), and some rules governing their placement (don't allow them to be within x units of each other).
     
  18. Paylo

    Paylo

    Joined:
    Jun 14, 2014
    Posts:
    2
    Looking forward for the release.
    Looks great so far.
     
  19. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    @zenGarden You can attach a listener script to the dungeon game object and hook into the post build event. This function gives you access the dungeon model.

    You have access to two types of graphs:
    High level Graph: This graph contains the interconnection of rooms in the map (red lines)
    Detailed Graph: This contains the connection to all adjacent cells (green lines)

    You can traverse through this graph and spawn anything you like within a cell (room / corridor) after querying it's bounds

    @Sabathius The demo games that come with DA samples have this example. It finds the farthest two rooms by querying the high level graph and places a spawn point and an exit. I provide a few utility functions to traverse the graph. I'll add more as community requests it

    It's because the I didn't assign a sprite in the theme file to handle that case. I think this tileset comes with a sprite for this. I'll add that.
     
    BackwoodsGaming and Sabathius like this.
  20. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    2D Toolset of Dungeon Architect

     
    LoDx and BackwoodsGaming like this.
  21. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Paint your own 2D layouts

     
    BackwoodsGaming and zenGarden like this.
  22. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Added more sprites in the theme file to handle other cases


     
    BackwoodsGaming and zenGarden like this.
  23. DRE10110

    DRE10110

    Joined:
    Jan 16, 2015
    Posts:
    2
    Excuse me but I have a question.Great product by the way, can't wait to buy it. I curious on whether or not we will be able to run our other scripts on these static meshes once they are procedural generated. Is it possible to have other enactments done to these prefabs after there generated.

    Great work,

    Andre
     
  24. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    @DRE10110 Thanks! Yes you can. You can create a listener to hook into the dungeon events and on the post build event function, you can grab all the items the dungeon spawned like this

    Code (csharp):
    1.  
    2. public class MyDungeonProcessor : DungeonEventListener {
    3.    ///<summary>
    4.    ///Called after the dungeon is completely built
    5.    ///</summary>
    6.     public virtual void OnPostDungeonBuild(Dungeon dungeon, DungeonModel model) {
    7.         var myObjs = GameObject.FindObjectsOfType<DungeonSceneProviderData>();
    8.         foreach (var obj in myObjs) {
    9.             // your processing here
    10.         }
    11.     }
    12. }
    13.  
    Drop this script into the dungeon object and it will call the function whenever a dungeon is created (both design time and runtime)

    (The component DungeonSceneProviderData is attached to all the spawned objects by DA)
     
  25. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55

    Respectfully, can't you just create a script on the prefab object and add your code in an Awake() or Start() block? Or does that not work in this context?
     
  26. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    I think @DRE10110 wanted to manipulate the object in design time after the dungeon is built in the editor
     
    Sabathius likes this.
  27. DRE10110

    DRE10110

    Joined:
    Jan 16, 2015
    Posts:
    2
    AliAkbar I have in mind exactly what method to use.Thanks your the best.Hey by the way Dungeon Architect should be out by now whats the deal.I'm very anxious to use it right now.
     
    Sabathius likes this.
  28. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    RELEASED! :D

    Dungeon Architect is now available in the Asset Store. I'd like to thank everyone for your enthusiasm and support since the start of this project

    You can grab it from here
     
    Mana-Station and Sabathius like this.
  29. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,205
    Is it safe to assume it works for all game types and not just top down? Seems like all the demo videos/screenshots I've seen posted were top down style. I would assume it would be good for designing first/third person as well, right?
     
    S4G4N likes this.
  30. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,817
    My question as well. I notice you say we can do ceilings, but what about roofs? Could we add any roof shape to the nodes and place those on the floor and move them up? What if the roof is wider than the floor? I need to make a city and this would be perfect but it is 3rd person.
     
    S4G4N and BackwoodsGaming like this.
  31. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I asked the same some posts above...
    Anyway gz to the Release!
     
    S4G4N likes this.
  32. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,817
    Ceilings are not the same as a roof though. :)
     
  33. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    @Shawn67 Yes it's possible. It also handles the stair elevations well if you have indoor rooms with lower height clearance for stairs. This is a small modification of the candy theme that comes with the samples. I'll add this demo in the next update



    @Teila you can add interesting roofs with marker emitters. Here's an implementation I have in the UE4 version (similar functionality to unity version). I'll add a similar example in the samples tomorrow

    Skip to 5:20


    I didn't get around creating a proper indoor demo yet. I'll create one tomorrow with 3DForge awesome interior village kit
     
    BackwoodsGaming likes this.
  34. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,817
    That is really cool..but...what if I just want a normal peaked roof with gables? Is that possible?
     
  35. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    Yeeeeeeeeeeessssssssssssssss! Now my evil plans to take over the world can begin. Wait...that was my outside voice, wasn't it?

    @Teila I know you can add any gameobject with a marker emitter. All you need to do is use the prefab for your peaked roof at the same time the floor is emitted, then use a Y offset to push it up into place. (if that makes sense)
     
    Last edited: Feb 18, 2016
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    @Teila yes that's possible too with marker emitters. Here's a simple example I quickly put together. Will make a proper one tomorrow



    This was created with a marker emitter script:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using DungeonArchitect;
    5. using DungeonArchitect.Utils;
    6.  
    7. public class RoofGabelEmitter : DungeonMarkerEmitter
    8. {
    9.     public float elevation = 1;
    10.     public string markerName = "Gable";
    11.     public override void EmitMarkers(DungeonBuilder builder)
    12.     {
    13.         if (!(builder is GridDungeonBuilder))
    14.         {
    15.             Debug.LogWarning("Unsupported builder type used with marker emitter MarkerEmitterFindLowestPoint. Expected GridDungeonBuilder. Received:" + (builder != null ? builder.GetType().ToString() : "null"));
    16.             return;
    17.         }
    18.         var gridModel = builder.Model as GridDungeonModel;
    19.         var gridSize = gridModel.Config.GridCellSize;
    20.  
    21.         foreach (var cell in gridModel.Cells)
    22.         {
    23.             if (cell.CellType != CellType.Room) continue;
    24.             var location = cell.Bounds.Location * gridSize;
    25.             var y = cell.Bounds.Location.y;
    26.             var isize = cell.Bounds.Size;
    27.             for (float x = 0; x <= isize.x + 0.001f; x += 0.5f)
    28.             {
    29.                 var mult = (float)x / isize.x;
    30.                 var angle = 0;
    31.                 if (mult > 0.5f)
    32.                 {
    33.                     mult = 1 - mult;
    34.                     angle = 180;
    35.                 }
    36.                 var height = mult * elevation;
    37.                 for (float z = 0; z <= isize.z + 0.001f; z += 0.5f)
    38.                 {
    39.                     var position = location + Vector3.Scale(new Vector3(x, y + height, z), gridSize);
    40.                     var rotation = Quaternion.Euler(0, angle, 0);
    41.                     var transform = Matrix4x4.TRS(position, rotation, Vector3.one);
    42.                     builder.EmitMarker(markerName, transform, new IntVector((int)x, (int)y, (int)z), 0);
    43.                 }
    44.             }
    45.         }
    46.     }
    47. }
    48.  
    49.  
    I also added a small random Y rotation transformer rule to give a nice random look on each tile of the roof
     
    Sabathius and BackwoodsGaming like this.
  37. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,817
    Nice! And to close the gable, I can just put a wall with an attached gable in a node that can be used for the ends of the buildings, right?

    So..is this asset going to require a lot of coding to make things work? I am sure I can deal with the visual nodes and everything, but I am not a coder. I am trying to use tools like this to avoid giving more jobs to my programmers who are already both busy with other aspects of the game.

    I really do like it! It is awesome. :)
     
  38. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    You'll design your theme mostly using the visual theme graph editor

    It won't require programing unless you want to do something advanced, in which case the tool has various extension points to attach your own behaviours easily. These scripts become reusable so in this e.g. you can drop in the gable roof script emitter from the fps demo for your other themes
     
  39. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Indoor Theme created using @3DForge 's Village Interior kit











     
  40. S4G4N

    S4G4N

    Joined:
    Mar 13, 2013
    Posts:
    2,868
    WOW,

    This is awesome, Thanks for showing it.
    With just a few small tweaks, everything will be perfect.
    Your lighting is looking very good man ;):)

    The Village Interiors Kit ended up being quit a bit more then what the name states
    The contents you see here was just one of the FREE updates it received:)

    Cheers
    Cobus
     
    Last edited: Feb 18, 2016
    BackwoodsGaming and AliAkbar like this.
  41. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    Now THAT's what I'm talkin' about!
     
    BackwoodsGaming, AliAkbar and S4G4N like this.
  42. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Thanks! Your awesome asset's magic. I took the lighting inspiration from your demo levels ;) Loved creating themes with it.

    Indeed, there's tons of stuff in Village Interior Kit. This theme is for the Cathedral update. I'll add more later. Looking forward to seeing what more artistic folks like yourself and others create
     
    BackwoodsGaming and S4G4N like this.
  43. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Yay! DA is featured in Asset store's front page :D
     
  44. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,817
    I would love to see you build something with the exterior kits as well. :)
     
    AliAkbar and S4G4N like this.
  45. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,043
    Holy crap, this asset looks amazing! I read the documentation end-to-end. My project isn't ready for level creation yet, but this is definitely added to my Asset Store wish list to acquire when I'm ready to use it.

    I do have a little bit of constructive feedback for the documentation. While it is extremely well-written, there are some grammar and spelling errors that could easily be corrected. In particular, the word "it's" (with the apostrophe) is incorrectly used throughout as a possessive, when it should be "its". I wouldn't bother mentioning the spelling, but the documentation is so extremely good otherwise that it is a shame to spoil perfection with something so easily corrected. :)

    I'm really looking forward to giving this a try, after I finish assimilating some other tools I've recently added and when my design is further along. I'm very impressed with the code design and the level of documentation that covers not only how to use the tool, but also the theory behind how it works.
     
    AliAkbar and S4G4N like this.
  46. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    Thank you @syscrusher. I really appreciate your feedback. I'll have that fixed by tomorrow
     
    S4G4N likes this.
  47. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    *whispers* It deserves it.
     
    AliAkbar, hopeful and S4G4N like this.
  48. Kasko

    Kasko

    Joined:
    Mar 21, 2014
    Posts:
    72
    Just saw it popping up on the asset store frontpage and I'm really impressed. Seems like a must-have asset like ProBuilder & co. I took a quick look at the documentation and it has great clarity (the node system is well-thought). Really great job ;)
     
    syscrusher, S4G4N and AliAkbar like this.
  49. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    703
    S4G4N likes this.
  50. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    97
    Great Asset... but I've a question:

    is there a "seed" which can be used in order to have the same procedural map generation ?

    I'm thinking about a multiplayer game, and in this case I want to Exchange only the generator seed between clients instead the entire scene :)

    So, same seed = same map

    Edit:
    Ok, just read the quick guide.. there's a seed :p
     
    Last edited: Feb 19, 2016
    Tinjaw, S4G4N and AliAkbar like this.
unityunity