Search Unity

World Building [RELEASED] Dungeon Architect

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

  1. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    Can I trouble you for this Theme file? I'd like to use it as a baseline for my own work. :D
     
    Hans, AliAkbar and SecretStudio like this.
  2. SecretStudio

    SecretStudio

    Joined:
    Feb 5, 2014
    Posts:
    50
    Been waiting for this one, so I just purchased it. I already own TD Interiors, Multilevel Dungeons, and TAD SewerKit, so I was able to create dungeons using those themes straight away ;-)

    I also own TD Scifi kit from Michaelo - any chance of putting together a theme for that too

    A procedural dungeon generator that uses assetstore kits has been a long-time coming, and I think you will have a lot of success with this!
     
    S4G4N and AliAkbar like this.
  3. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Sure, you can grab it from here

    The demo scene uses the Character controller from the Standard Assets along with 3DForge's Village Interior and DA
     
    S4G4N likes this.
  4. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You mean this one? I made this theme in the UE4 version. Will create for Unity too when I get time
     
  5. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    132
    Another question:
    I read on the guide that "Multiple themes can also be used within the same dungeon to create variations".

    but there's no sample.. on how to do it.

    what do you mean?

    is it possible to have a section of a dungeon with a theme (interior example).. and then it blend to another section with a second theme (exterior..) ?
     
  6. SecretStudio

    SecretStudio

    Joined:
    Feb 5, 2014
    Posts:
    50
    Fantastic! - thats the one.
     
  7. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You do this with Theme Override volumes

    Skip to 1:15


    Later on in the guide, there is more info on Theme Override Volumes: Link

    I'll add a demo scene for this and other types of volumes in the next update
     
  8. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    It work on mobile? I mean "Generate at runtime"
     
  9. Sabathius

    Sabathius

    Joined:
    Jul 13, 2013
    Posts:
    55
    If there was a grand champion of grand champions, you would be the grand champion of that grand champion.
     
    S4G4N likes this.
  10. cascaid

    cascaid

    Joined:
    Nov 3, 2012
    Posts:
    12
    This looks great, looking forward to trying it out!
    A few questions:
    • How does it cope if I have different sized prefabs, say I have one building set with floor tiles and walls 3m wide, and another with pieces 1m wide.
    • Is there any support for having specific corner meshes, I see wall joiners, would I be able to configure this to use a certain joiner while omitting the walls in a corner?
    • If we manually paint parts of a dungeon, can the layout of that dungeon then be saved to file to be generated at run-time later?
    • With the procedural terrain, is it possible to place multiple dungeons on the same terrain, or will each one overwrite the terrain texture created by the last one?
    • Is there any logic to handle theme transitions? from the look of the editor I don't see how it would be setup, but is is possible to tell in the rule logic, if a marker is next to a marker of a different theme?
    • With the NavMesh that's generated, can it cope with adding/removing navmeshObstacles (say if I wanted to be able to destroy furniture, thus opening up a path where an unfortunate wardrobe used to be), or if not, can you regenerate specific parts of the navmesh to avoid doing a full navmesh regeneration of the dungeon upon destruction?
     
  11. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Yes it does. I'm running this in my 2 year old Samsung Note 3



    The mobile demo creates a dynamic dungeon, generates a dynamic navigation meshes and the agents move around on the nav mesh all at a good speed
     
  12. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    :)
     
    S4G4N likes this.
  13. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729

    1. DA can work with any sized modular assets. However, if you are using multiple themes within the same dungeon, they need to obey the grid size set in the dungeon configuration. You can however, have 2 or more dungeons with different sized configurations in the same map
    2. I have a marker emitter script that you can drop into your dungeon and it will create markers for corners (inward/outward), edges, T-shapes, X-intersections etc and you can add your meshes on these markers. The Interior Cathedral demo I posted above uses this. Notice the decorative small stairs attached to the walls that blend nicely with edges and corners
    3. The painted data is stored in the paint game object and will be part of the dungeon when it is recreated. So it is saved along with the level, but not as an asset.
    4. That's a good question. It does overwrite it and supports only one dungeon for now. I'll be working on supporting Adam's awesome Gaia landscape generator and will be re-writing this soon with more features
    5. Could you give a use case? You override themes using an ThemeOverrideVolume. You could have a third theme for transition and place a new volume in the middle ThemeVol1 > ThemeVolTransition > ThemeVol2
    6. It doesn't support dynamic obstacles. However, I'm using a modified version of SharpNav (with many bugfixes and optimizations). SharpNav is based on the amazing Recast Navigation, which everyone uses (Unreal Engine 4 and I believe even Unity for their offline nav mesh generator) and it supports it. Not sure if SharpNav had that ported over. I'll have a look
     
    AdamGoodrich likes this.
  14. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,782
    I am really looking forward to getting an integration going between Gaia and DA - two very powerful procedural systems. I think the results of us working together will result in people being able to easily create some truly amazing environments. Heck I am looking forward to playing with DA just by itself. Whats not to like about a good old fashioned dungeon romp :)
     
    Tinjaw, Sabathius, Hans and 4 others like this.
  15. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    Wow great.. this is beginning of legendary asset
     
    AliAkbar and S4G4N like this.
  16. xDavidLeon

    xDavidLeon

    Joined:
    Jun 9, 2014
    Posts:
    123
    Hi Ali! Your asset is looking amazing, I'll be grabbing it this weekend to start prototyping a roguelike.

    Some questions:
    1. I've only seen footage of Dungeon Architect working with realtime games and navmeshes. How difficult do you think is to use your dungeons to create a turn-based tile-based traditional roguelike?
    2. The paint tool looks really impressive. Is there any way to design 'hand-made' rooms that can later be inserted in the procedural algorithm? The main example would be designing a Boss room or a Store room, something like that, where you want some specific dimensions/layout and specific monsters/npcs/items.
    3. One feature I liked about DunGen is the ability to set spawn chance of each monster/item and also create a spawn chance 'ramp' directly related to the 'depth' of the dungeon. For example, you could say that the player must cross a 'mini-boss' room before being able to get to the 'Boss' room, or the capability of place locked rooms/doors and the algorithm would take care of placing the key in an 'open' part of the dungeon. Is there something similar in Dungeon Architect (or are there plans for implementing it)?
    Even without some of those features, this asset is a game changer for me, so congratulations!
     
    AliAkbar and S4G4N like this.
  17. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Thanks Adam! I'm looking forward to this too
     
    Tinjaw likes this.
  18. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Thanks David!
    1. It should be possible since it works on a grid based system
    2. Yes you can. Save the hand-made setups as a prefab and insert them in the room's center. I've done this for the cathedral demo using 3DForge's Interior Village assets. Instead of designing them myself, I opened each of the scenes Cobus created and saved the room's decorative props as a prefabs and inserted them from the theme

      Here I saved 6 hand made setups from the demo scenes created by 3DForge into prefabs and then dropped those prefabs into the theme editor.

      End Result, those prefabs show up in rooms:

    3. That should be possible. The dungeon layout is a graph in memory and these constraints can be added to the graph. I'll provide an editor window to define these rules in the coming weeks.
     
    Hans likes this.
  19. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I've updated the theme archive that are linked from the Quick Start guide with the Cathedral Interior Demo. Please redownload this version. The old archive had issues with the theme files (were not upgraded to latest version) and were causing generation issues and has been fixed
     
  20. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    I'm just wondering

    In the future...

    Is this possible that create a random map of Clancy of Clancy games like?

    and Side Scroll(Super Mario) games like
     
  21. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    This asset looks really cool. I have a few questions regarding its use with endless map generation at run-time and was wondering if you could provide some information.
    1. Map streaming: as the player moves, we stream map sections in and out. As each section is streamed in, a map would need to be generated on the fly for that section and linked to previously generated map sections (e.g., linking a room or region in a previous map to a room in a new map by a corridor). Is this possible at run-time? Your answer above about only one dungeon at a time makes me think this is not supported at this time but that you are fixing this?
    2. Endless scrolling: for endless scrolling, we keep the Player (and camera) relatively fixed and scroll a World root game object (which is parent to all the map sections) instead. Would this present a problem? We don't use Unity's physics or navigation (it's tile-based movement). Also, the World root object's position is reset when it goes beyond a certain distance to prevent floating point errors from accumulating.
    3. Memory allocations: because of the endless nature of the game, memory garbage generation is a concern. It looks like we could listen to the post-map generation event and use our own custom pooling/spawning but does the Theme system allow custom game object pool spawners?
    Here's more details of what we are trying to achieve.

    Thank you.
     
    Last edited: Feb 20, 2016
  22. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,419
    any chance you include the demo game (3d)(with only your freeassets) ?!
     
  23. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    I am playing your web demo game..

    WOW.. demo game is great

    please make Add on asset

    I'll buy your web demo game asset
    It is helpful to each products
     
    pushingpandas likes this.
  24. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Just dropping by to tell that your plugin look awesome!
    Good job man!
     
  25. RuinsOfFeyrin

    RuinsOfFeyrin

    Joined:
    Feb 22, 2014
    Posts:
    785
    Hey, very cool looking. Ive looked over this WIP page a couple of times...

    I have a question thought, and i apologize if it was already answered.

    Are we able to use our own models in this? I think I read that we can but I'm not sure.

    If we can that would be splendiferous as I've had a dream of combining this with Archimatix being created by @roryo.

    Someone it seems to me that these two things if able to work together would be a level designers wet dreams.
    I feel if this is not possible you two should talk and make this happen.
     
  26. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    I just bought the ProCore bundle myself, and I had the same thought as you: What a great pair they make. Build your tiles in ProBuilder, generate them into a dungeon with DA.
     
    Kasko likes this.
  27. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Question: Does the same seed determine every aspect of the level, including which nodes get randomly selected at each node emitter? Or does that only affect the generation of the basic map?
     
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    @AliAkbar - Let's say you have street and building models. Would it then be possible to use DA to build a city?
     
  29. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    DA was designed so the dungeon algorithm can be easily swapped




    I googled Clancy of Clancy and couldn't find anything :p

    The UE4 community wants a builder for making maps like Binding of Isaac and I think it will look awesome in Unity with art asset like these

    What builder layout algorithm would you folks like to see next?
     
  30. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    1. I'll investigate the linking of two dungeons together seamlessly further and get back to you. As for streaming, you can build / destroy dungeons at runtime
    2. Dungeon objects can be optionally instantiated under a root game object, so the whole dungeon resides under this object. Moving this game object would move your dungeon for endless scrolling
    3. Sure, you can grab all the dungeon instantiated objects using
      Code (csharp):
      1. GameObject.FindObjectsOfType<DungeonSceneProviderData>()
      and pool them anyway you like. This component has a Dungeon reference, to find which dungeon this game object (mesh, particle system, light etc) belongs to, if you are using multiple dungeons
    Feel free to ask away if you have further queries
     
  31. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Devision4, @thedreamer You already get most of that gameplay functionality in the demo that ships with DA (SurvivalShooter) ;)

    I've stripped out the code that was art specific. (animation syncing code, attack animations, weapon system, melee etc)

    If you're interested, I can provide you with the list of all the assets I used for the 3D tech demo
     
    pushingpandas likes this.
  32. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Thank you @nuverian. Your node based tools are awesome! I love blueprints in UE4 and I'm gonna try out your FlowCanvas soon
     
  33. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Yes, you can use your own art assets and DA is not tied to any particular art asset.
    Archimatix looks amazing. Thanks for letting me know. I'll get in touch with the author
     
  34. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Yes it does. The seed configuration is used as a master for all randomness in the dungeon, including theme spawned props. This is done so that generating the map again would guarantee the same dungeon every time, e.g. for multi-player games (as long as the config structure is also the same, like room size, height variation etc). This is why clicking build the second time doesn't change anything in the dungeon.
     
    syscrusher likes this.
  35. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You'll need a more specialized builder for city generation. I'm already working on that for my next project ;) Its called City Architect. I'll bring to Unity when it's done.



    In the mean time, I'm exploring this in DA by building a theme with an outdoor scene using 3DForge's awesome Exterior Kit and Gaia. I'll keep you folks posted
     
    syscrusher and hopeful like this.
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Posted a new version for review. Change Log:

    Version 1.0.2
    • Added Indoor demos and Volumes demo for the Candy Theme
    • Added notification in the 2D demo game to disable anti-aliasing to get rid of sprite dark edge artifacts
    • Fixed System.IO class name clash issues with beta preview version of Unity 5.3.x
    • Removed dependecies on custom tags from the 2D and 3D game demos to avoid import issues due to missing tags that might occur sometimes on a re-import. The sample games work without tags now

    Also updated the graphics of the key images in the product page
     
  37. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    Thanks for the answers and for looking into the multiple dungeon stitching.

    For #3, this means that Theme system has already instantiated the GameObjects and each new dungeon would do the same? Is it possible to hook into the Theme system to provide it with an interface that provides a GameObject that I instantiate myself? (If not, no worries, I think I should be able to use the post-dungeon generation event to control my own spawning/pooling.)
     
  38. DRhodes

    DRhodes

    Joined:
    Mar 26, 2015
    Posts:
    4
    Would it be possible to make a more modular dungeon builder? Ideally this is something that could be done via composition. Want stairs? Add the stairs component. Want corridors (rather than just rooms)? Add the corridor component. These could then be plugged into the larger system for placement.

    Great plugin. I'm very excited to see where it goes next! Thanks!
     
  39. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    I am going to watch all the videos tomorrow, see if I can wrap my head around it. If so, I plan to purchase the kit. i think it will save me a lot of time with levels. Thanks!
     
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Remember to include highways (and maybe railroad / light rail tracks). I can see where maybe this might be an important initial part of a city layout (or city-to-city).
     
  41. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    My mistake .. I mean Clash of Clans

    and Do you support "A* Pathfinding Project Pro" and "Apex Path" ?
     
  42. cascaid

    cascaid

    Joined:
    Nov 3, 2012
    Posts:
    12
    Had a lot of fun with this over the weekend, very powerful once you start adding your own emitters and rules.
    A couple of thoughts/issues:
    • In paint mode, I was only able to extend corridors, but could not connect corridors to rooms/place doors, is this intended?
    • Would love to be able to have inheritance in themes: "This is my main theme, this theme implements my main theme but overwrites the window and curtain marker, etc."
    • As for which kind of generators I'd like next, a BinarySpacePartition generator, to give more "compact" dungeons could be fun: http://grabilla.com/02418-eab66c9e-2e3b-402a-89df-fcb6ff589c6c.png
    • It would be nice for the cells to have some concept of which "room" they are in within the cell info class, this would allow my emitters to apply specific behavior to different rooms.
    • A way to interact with the dungeons at runtime would be amazing, if there was a way to tell the dungeon to, for example: "Place Corridor at address x,z, reevaluate all markers within 3 cells in each direction, and update visuals". Especially useful for dungeon building games, or for example cutting down trees in the 2D example.
     
  43. cascaid

    cascaid

    Joined:
    Nov 3, 2012
    Posts:
    12
    Also, being able to paint "negatively" would be useful, often I'd get a corridor generate a bunch of redundant space, like a 3x3 area half way along a 1width wide corridor.
    The negative volume would just remove the entire corridor, but something more akin to the painting brush would be useful here for fine detail corridor-trimming.
     
  44. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    That seems useful and looks like it would be useful to others as well. I could add a Spawn Script node (like the Game Object & Sprite node) that executes a user-defined script which you can add to your theme files. It gets executed, just like the Game Object node, but instead of spawning the prefab, it executes the script.

    I'll add it to my todo list
     
    danien likes this.
  45. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @DRhodes Thanks for the feedback. You can control the stairs from the HeightVariationProbability variable. Setting it to 0 would not create stairs. Corridors will always be needed to connect the rooms. Is there anything else in mind you think can be taken out of the builder and made pluggable?
     
  46. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Good point. I have high population clusters (cities) connected through highways. I'll post more info in another thread as the product matures :)
     
  47. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    DA comes with dynamic navigation mesh support (based on the awesome Recast Navigation library). However, if you want to integrate with more advanced solutions, it believe it should work seamlessly, as the projects you mentioned above don't have any special requirements and work on the existing world geometry (e.g. like the levels created by DA)

    "A* Pathfinding Project Pro" is also based on Recast, so it should work (haven't tried it though)

    If you face issues with these tools, please let me know.
     
    Sabathius likes this.
  48. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @Teila, Thanks for your support since the start of this project. If you have any questions, please feel free to ask
     
    Teila likes this.
  49. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @cascaid Thanks for using DA!
    1. Yes it is intentionally as the builder algorithm doesn't automatically connect doors to every adjacent corridor cells (will have too many doors then). I could provide a tool to explicitly define a door in the room boundary
    2. This is possible in a limited way. It's easy to extend to make it inheritable. You can have multiple themes assigned to the dungeon object. Create and emit a Curtain marker from the main theme file and leave the marker blank. Create another Curtain marker in your second theme and add curtain game objects. If you want curtains, add this second theme file (or remove / replace it with another variation) to the dungeon game object. It will pick up the marker from the next theme file only if the previous theme files don't have any nodes defined underneath it.
      This can be a good example for the indoor theme. The roof, ceiling lights etc can reside in another theme file and the master them file emits an empty "Ceiling" marker. If you want ceiling, just add the second theme file that contains indoor stuff
    3. If you'd like more compact dungeons with the current builder, try reducing the RoomAreaThreshold value. It will start promoting more cells to rooms (instead of corridors)
    4. In the default builder, an entire room is always a single cell. You can use Cell.Id to identify if they are in another room.
    5. Its something I've been thinking of and would be very useful. I'll explore this further when I get time and let you know
     
  50. cascaid

    cascaid

    Joined:
    Nov 3, 2012
    Posts:
    12
    1) That does sound useful, and so would the inverse actually, In a couple of cases I have ended up with a corridor of doors, where it would have been very nice to just "undoor" a few of them.
    2) Thanks for the tip on multiple themes, that definitely sounds handy!
    When I use a theme volume to overwrite an area, will it then fallback to the default themes for any markers not included in the overwrite theme?
    3-4-5) Sounds good, thanks a lot for the response!