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. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    For the arbitrary degrees, isn't it feasible though to create a set of new markers, and then some rules that somehow know those markers were used and then adjust the placement of the following markers / cells? Assuming the arbitrary model used is following the conventions of the grid settings eg 4x4.
     
    AliAkbar likes this.
  2. LeeJiHoon

    LeeJiHoon

    Joined:
    Aug 4, 2016
    Posts:
    14
    This bug has not been fixed
     

    Attached Files:

    • 1122.jpg
      1122.jpg
      File size:
      157.2 KB
      Views:
      1,028
    AliAkbar likes this.
  3. bigbrainz

    bigbrainz

    Joined:
    Jul 21, 2015
    Posts:
    177
    Hey, I wasn't able to read through all the different pages, so maybe you've already answered this, but I'm curious if there's an update on the cave builder option--this would be a critical feature for us. Great tool regardless--keep it up!!

    Cheers
     
    AliAkbar likes this.
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I would like to generate a trigger to each room that has been generated. Is there any post generation call back that I can tag to create such trigger that is size of the room that is created ? Or in general , is there any post creation callback or data structure that I can peep in to create such setup after the dungeon has been generated?
     
    AliAkbar likes this.
  5. DrHeinous

    DrHeinous

    Joined:
    Jun 25, 2013
    Posts:
    19
    @castor76 that ought to be pretty easy (I just did something similar). If you look at SpecialRoomFinder.cs in the survival shooter it is pretty close. It finds two rooms that are the furthest away.

    I used it as a base to find rooms to generate enemy spawn points. In OnPostDungeonBuild it gets the dungeon model then the grid model, then, in my case, I just did this to put down spawn points in each room:
    Code (csharp):
    1.  
    2.            foreach (Cell c in gridModel.Cells)
    3.                     {
    4.                     if (c.CellType == CellType.Room)
    5.                         {
    6.                         //...bit of stuff snipped to avoid enemy spawn points in start or end rooms...
    7.  
    8.                         //This just creates a spawn point game object in the cell/room
    9.                         AddNPCSpawnArea(gridModel, c);
    10.                         }
    11.                     }
    12.  

    Thus you can iterate over the cells and when they are rooms, do whatever you want.
     
    AliAkbar likes this.
  6. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Thanks. But it only let you know if the cell is within the room or not. There is no information about particular room as overall, so it is not possible to find the overall size boundary of a room. But I will take a look at the SpecialRoomFinder.cs to see if it contains what I need.
     
    AliAkbar likes this.
  7. DrHeinous

    DrHeinous

    Joined:
    Jun 25, 2013
    Posts:
    19
    True, and I'd thought about that too, and wondered about the exact bounds. Though it did just occur to me that there is another example that highlights the connected rooms and corridors. Since that example outlines the rooms and corridors, there ought to be code in there that illustrates how to find the bounds of a room. Heh. Thanks, I might not have thought to look there if not for your comment.

    RoomMidEmitter looks like it shows how to do this. It would seem to be as simple as getting 'cell.Bounds'.

    Another edit:
    cell.Bounds * model.Config.GridCellSize
     
    Last edited: Apr 25, 2017
  8. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    any think's to do for configure snap start module ?
     
    AliAkbar likes this.
  9. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Hi this tool looks pretty amazing, not sure how I never seen it before, anyways, does this work well for all platforms?

    Does this have its own built in culling? If not Has anyone used World Streamer with it? I know the other tool like this supports Sector, I do not use that. If it don't support either that is fine, I can do it myself, but has anyone successful done so?

    I plan to add my own assets as many others I assume do, is there any limitations? I use Substances a lot.

    Thanks, like to know before I decide on which tool I want to buy. For a future game, we are designing as we speak, about to finish another.
     
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I don't own this one yet, so if my impressions are wrong I hope someone will correct me. But this is an excellent random generator that with minimal setup will take the art assets you give it and assemble them into interconnected rooms with doors, ceilings, floors, and walls ... and - using the right rules - it can make a fairly realistic building or even a city, or assemble an outdoors environment.

    However, what it doesn't do is manage play flow from a start room to an end room. Also, I think each object that is placed is a separate object, with no mesh combining. Probably users benefit a ton from using a dynamic OC solution, but I don't think one is included. (There are a few in the store.)
     
    AliAkbar and recon0303 like this.
  11. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I like both tools as they seem to be different, but i like both for different kind of games to. Thanks for the info.
     
  12. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @wolfen231 Recently I was looking at all the modules diablo uses for their game and I'm experimenting with a high level block editor where you would design your abstract room blocks with tools and also support angular and curved boundaries. You can then apply your different themes and decorate it. These rooms can then be pieced together with the snap builder. Here is a very early WIP. I'll keep you all posted on the progress.

     
    Weblox and wolfen231 like this.
  13. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    It looks like an issue with the offset of the walls / fence in the theme. I'll have a look
     
  14. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I have that planned in the near future. I'm working on a spline asset (which I'll probably release for free) and use with DA. I'll have more info on this soon
     
  15. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Sure, just subclass from DungeonEventListener and drop that script to the dungeon game object and it will notify you of the events. Have a look at this sample for more info:
    DungeonArchitect_Samples\Misc_Examples\Scenes\DynamicVolumeSpawning

    Script:
    DungeonArchitect\Scripts\Core\Dungeon\DungeonEventListener

    Edit: @DrHeinous Thanks for the update
     
  16. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @castor76 You can have a look at the above example (DynamicVolumeSpawning) on how to do this. (The example spawns a volume, finds the room size and wraps it around the room)


    Code (csharp):
    1.  
    2.         Vector3 position = cell.Bounds.Location * gridSize;
    3.         Vector3 size = cell.Bounds.Size * gridSize;
    4.         var center = position + size / 2.0f;
    5.         var scale = size;
    6.  
     
  17. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @kilik128 I'll implement that in the next update
     
  18. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @hopeful you are right, one of the limitation for now is no flow graph like you have in DunGen

    As for level streaming, it is possible to group the spawned meshes different game objects for rooms and corridor chunks. I'll explore more on level streaming
     
    Arkade, v_James_v and hopeful like this.
  19. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Fixed a few edge cases where the dungeon was not creating doors properly in some cases. (Thank you Studio Pixellore for the bug reports)
     
  20. wolfen231

    wolfen231

    Joined:
    Apr 22, 2014
    Posts:
    402
    Will obviously achieve what I am talking about. Though I would suspect with enough know how rules could be made that would allow for angled walls and such in the normal dungeon builder too. I am just not that smart to do it haha.
     
  21. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    how do u bake lightmaps in DA?
     
  22. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You'd bake your lights like any other level from the lighting panel. Runtime baking is not supported
     
  23. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    I created a script to group the rooms and corridor meshes after they are generated (you attach it in the dungeon game object)

    I was looking into level streaming and it seems straightforward. I'll have more in a few days
     
  24. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Is there any way for the volume affector to overlap and effectively work as boolean additive mode?

    I can understand that theme overriding volume can't work like this because it has conflicting purposes, but for the platform volume override volume this is very useful because we can then almost sculpt the shape of the corridoor or room etc.

    If room shape can't be anything either than a rect shape.. well that is too bad, but at least for corridoor I think this should work..

    So for instance, I create two platform volume maked as corridoor and then overlap them to create more interesting shape. Right now, if they are overlapping for some amount, one of them is ignored.
     
    Last edited: May 4, 2017
  25. FlyTrollStudio

    FlyTrollStudio

    Joined:
    Mar 5, 2017
    Posts:
    4
    Hi
    How I can change NumCells field at runtime ? Thanks
     
  26. sakataharumi

    sakataharumi

    Joined:
    May 8, 2017
    Posts:
    2
    This is ChandyDungeonTheme created by [DungeonGrid's Build Dungeon].
    I have Colider in StairRail to prevent falling.
    However, this Stairs does not have StairRail.

    Please tell me how to not fall to me.
     

    Attached Files:

  27. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @castor76 Overlapping is not supported as of now. I can make it work for corridors though. I've added it in my todo list
     
  28. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You would cast the config object to GridDungeonConfig and there you have access to set any grid configuration.

    Here is how you'd do it in the RegenerateDungeonLayout script (two lines of code between the //////)

    Code (csharp):
    1.  
    2.             // Build the dungeon
    3.             var config = dungeon.Config;
    4.             if (config != null)
    5.             {
    6.                 config.Seed = (uint)(Random.value * uint.MaxValue);
    7.                 ///////////
    8.                 var gridConfig = config as DungeonArchitect.Builders.Grid.GridDungeonConfig;
    9.                 gridConfig.NumCells = 100;
    10.                 ///////////
    11.                 dungeon.Build();
    12.             }
    13.  
     
  29. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @sakataharumi you can add your railings to the Stair2X marker just like how it is done on the Stair marker. Be sure to uncheck "Consume on Attach" to let the theme engine continue adding the other nodes as well



     
  30. Fragment1

    Fragment1

    Joined:
    Aug 30, 2013
    Posts:
    67
    Good evening! Quick question, I'm really interested in this asset to generate maps for a roguelike-FPS game. (Particularly impressed with the verticality generated)

    My question is, is it possible to generate densely packed meshes?
    All of the online examples show maps with potentially huge stretching corridors, or massive L shapes, whereas I'd like something very densely packed to make it a more believable space from a first person perspective.
    Is there a way to control this directly?

    The end-result maps do not HAVE to be completely procedural as some post editing is expected, but is it technically possible to concentrate as much as possible into a small area?
     
  31. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    For snap building, I would like to make sure that no 2 set types are immediately connected together. For instance, if I have a room type and corridoor type sets, I want the room to always be connected with corridoor only, not another room type. How can we do this?
     
    Fragment1 likes this.
  32. Fragment1

    Fragment1

    Joined:
    Aug 30, 2013
    Posts:
    67

    I would also like to know this!
     
  33. v_James_v

    v_James_v

    Joined:
    Feb 13, 2016
    Posts:
    40
    Hi Ali, I picked up your asset yesterday and it is awesome! Thanks for creating such a polished product :)

    For the moment I am mainly interested in city building. All is going well except for the orientation of the Custom Sized Buildings. The houses are placed alongside roads and facing towards them, but the custom buildings seem to be placed wherever they can fit on the map. Is it possible to treat them the same as the houses and position them alongside/facing the road?

    Thanks!
     

    Attached Files:

  34. DrHeinous

    DrHeinous

    Joined:
    Jun 25, 2013
    Posts:
    19
    For the FloorPlanBuilder, I'd like to emit some custom markers for placing furniture. I've got a few questions about this, though.

    Obviously I need to go through the chunks, but I don't see that they are in the model or anything. It looks like they're hidden inside the ChunkDB which is private to the FloorPlanBuilder. Am I missing something?

    Or is there some better way to look through rooms and hallways for the FloorPlanBuilder? Ideally I'd like to mark rooms as certain types ('bedroom', 'kitchen', etc.) to drop only certain furniture prefabs in the correct sorts of rooms.
     
  35. John3D

    John3D

    Joined:
    Mar 7, 2014
    Posts:
    441
    Amazing 5 stars asset!
     
  36. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Hello @Fyrburn, you can control the density by controlling the minimum room area (it controls how many cells get converted to rooms). Reducing the value creates a more densely packed dungeon with more rooms. Is this what you were asking?

     
  37. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @castor76, @Fyrburn other users have also requested this. I'll add a male-female connector
     
    a_desilva likes this.
  38. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    @v_mace_v Thank you for using Dungeon Architect. I've added that to my todo list and will have in the future builds
     
    v_James_v likes this.
  39. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729

    @DrHeinous I'll fix this in the next build
     
  40. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    Thank you @John3D! I really appreciate it
     
  41. AliAkbar

    AliAkbar

    Joined:
    Jun 30, 2014
    Posts:
    729
    You can now group your dungeon items based on corridors / room clusters.

    This info is also helpful for level streaming. If enabled, I'll send these clusters to different levels and stream them in when the player gets close (wip)

     
    Alverik and Griffo like this.
  42. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Thanks AliAkbar.

    Just to note, while you are doing it, it may be even better if we can define some custom enums and be able to create our own rules on how the connections are made. So for example in Dungen asset, you can define custom enum type for each connectors and we can define our own rules (script) to define which connector can be connected to which other ones. It's more generalized system and flexible than just female-male connector.

    The above grouping and streaming feature should also be applicable to snap builder since the rooms already has that grouping. I am not saying DA is worse than Dungen since it does so much more than just current snap building but as far as snap building goes Dungen is bit better on how the rooms that spawns are organized. You should definitely check it out.

    What I am really hoping is that eventually, DA can match Dungen for snap builder and exceed it by ability to mix in snap builder with current grid builder theme system so that we can use both features. I love how the theme editor works and how it spawns things based on the markers. So it would be super awesome when we can build dungeon using snap builder with the template made with markers and use theme to decorate the room itself. If we can use the current theme editor and snap builder together, it is going to be much better than Dungen as far as how the spawned assets are organised and randomized.
     
    a_desilva and Dwight_Everhart like this.
  43. Borunor

    Borunor

    Joined:
    Nov 11, 2016
    Posts:
    21
    Good morning everyone, I was looking for a great asset for a procedural Dungeon generator on a runtime that allowed me to generate room, corridor and let me spawn enemies who can chase the player using a navmesh system.
    I saw this asset on the market that cover all of this aspect and it's look like a well documented and not so hard to set up. Related to this asset I saw DunGen that, basically can do the same thing.
    Can someone on this forum tell me the difference between this cool asset and DunGen? Why is this better than the other one?
    Many thanks beforehand
     
  44. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Dungen is basically what this asset calls a snap builder, where you create your own rooms and then snap together to build a dungeon layout. This asset (DA) has this option too, but it is at its early stage of the development so if you are looking for Dungen style snap building, Dungen is probably a better option.

    However, if you are looking for more of open world style dungeon or some other types of dungeon generation DA has excellent theme editor which is very good at organizing how things are being made. I think they both are good asset.
     
    Borunor and Alverik like this.
  45. Borunor

    Borunor

    Joined:
    Nov 11, 2016
    Posts:
    21
    Ok thanks! And even if I still have Unity 5.5.3 (so I don't have a runtime navmesh generator) I will able to use a runtime generator fully working with an enemy that can track you down and follow you? So basically, this asset have a runtime navMesh generator built inside that can bake a navmesh every time I generate a level when I'm in runtime?
    Many thanks beforehand
     
  46. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I highly recommend that you should consider upgrading to 5.6 if you are coming fro 5.5 and use Unity's native solution instead.
     
  47. Borunor

    Borunor

    Joined:
    Nov 11, 2016
    Posts:
    21
    Because the solution provided in the asset isn't good for the runtime generation of the navMesh?
    I have a project already started in 5.5 so I would like to (if it possible) finish it on the same version.
     
  48. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    It is just that using unity one is much cleaner faster and less buggy likely than third party one. Not saying everything in unity is .. but for nav mesh i feel unity did a good job. Navmesh generation included in the asset is not a unity native one.. you will have to work harder to get things done.
     
    Borunor, AliAkbar and Alverik like this.
  49. Borunor

    Borunor

    Joined:
    Nov 11, 2016
    Posts:
    21
    Thanks for your support!
     
  50. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    I have to remind the author that for grid builder, there is bug where two wall separators can spawn at the same spot. I have sent email about it a while ago, but I wonder if it is being addressed..