Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

DunGen - Procedural Dungeon Generation

Discussion in 'Assets and Asset Store' started by Aegon-Games, Mar 7, 2014.

  1. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    Sorry for the late reply.

    I said I'd take a look at the lock & key code last week; I did (and fixed it), but then forgot to upload it :oops:. So here's the new version:

    Version 2.5.4 (Beta) - Download
    - DunGen is using a new method for socketing doorways together which is more robust. Doorways can now be aligned vertically (for stairwells, for example)
    - The DungeonGenerator class now has a DetachDungeon method allowing you to "tear-off" the dungeon from the generator so that it is not overwritten next time Generate() is called
    - Experimental: The DungeonGenerator class now has a GenerateAppended method which will generate a new dungeon appended to a previous dungeon that you specify. NOTE: This is entirely experimental and NOT supported functionality; dungeons generated in this manner will likely overlap or fail depending on whether allowIntersection is set. You'll have to decide how/if this is handled when it occurs. This is mostly in place as a starting point for those of you who want to implement infinite dungeons - but it needs additional logic (likely game-specific) to work as a complete solution.
    - Doorway components now have a ConnectedDoorway variable
    - Tiles now have some methods of getting/checking adjacent Tiles
    - Tiles now contain a BoxCollider trigger component. There's a new DungenCharacter component which handles information about which Tile it's currently in (with events fired when switching tiles)
    - [NEW] The Lock & Key system will correctly also place locks on doorways that don't have a prefab applied to them


    I should have fixed all of the overlapping issues since 2.5.2. The only thing I'm doing differently in 2.5.3 is generating the dungeon in the root object's local space. When you select your dungeon in the hierarchy, do the red bounding-boxes for each room appear in the correct places?


    I've just bought that asset and can confirm that it does fix the nested prefab problem. It's nice to be able to update a prefab and have all instances of it in your Tiles update as well.


    For the boss door, you could use the lock & key system, but not actually implement any locking logic, that would allow you to guarantee your boss door appears on the entrance to your boss room (and nowhere else).

    There isn't a nice way to know which doors are entrances/exits. You could check which room a doorway connects to and compare it's PathDepth (Tile.Placement.PathDepth) against the current room to determine if it should be considered an entrance or an exit.


    The DungeonGenerator class has an OnGenerationStatusChanged event that you can hook into and check for when the status == GenerationStatus.Complete.


    The only difference between indoor and outdoor scenes should be how the tile boundaries are handled. You'd want your tiles to be fairly large (otherwise the corridor-like nature of DunGen would make an outdoor scene look a little weird), and you'd want some way of completely blocking access to an edge if it's doorway is not in use (such as using a cliff mesh). I'll see if I can put a demo together at some point but I can't make any promises, I'm a little snowed under at the moment.

    Honestly, DunGen isn't a great choice for outdoor scenes due to the way the algorithm works. Then again, I don't think there are any other assets that handle this any better. Ideally, I'd like to provide a separate method for generating outdoor dungeons - one that's more fitting; but again, that takes time that I don't really have.
     
    hopeful likes this.
  2. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    286
    For what it is worth, we used a collider on the doorways themselves, rather then the tile volume. This allowed us to determine enter-exit points for our characters, per tile. The downside is that you may have different sized doorways, so this can't be (easily generically) auto-generated, like a box-collider for the whole tile.

    Excited about the new work however! More meta-data about a characters/npc's location in the dungeon is useful!

    Question/Feature Request - one use-case that we have come to is how to control "how much" of a specific archetype is used in a Flow. I think the width/size of a section of the "line segment" determines the amount of that Archetype used in the flow. I'd like more specific control over that... I'm not sure how that might manifest. % for each section, rather then just determined by where the line is? Ability to move the lines in the "Line Segment" rather then having to create/delete segments to affect the size (assuming the size determines how much that archetype is used).

    Anyway, generally, more control over the use/amount of tiles used for an archetype in a Flow would be helpful.

    Thanks for all your work,
    Jos
     
    Last edited: May 1, 2015
  3. RealMTG

    RealMTG

    Joined:
    Jul 27, 2013
    Posts:
    376
    Thanks for the reply but I can't really figure out how I should do this. Could you give me a hand?
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,394
    I'm pleased with the changes that have been coming to DunGen. I especially appreciate the ability to create a dungeon that is offset from 0,0,0, and the new (beta) DetachDungeon method.

    Eventually I'd like to get the enemy AI to navigate from wherever they are to a specific room. Examples would include: "if attacked, head to hardened room," or "secure lab," or "protect boss (head to boss room)," and so on.
     
  5. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    Yes, the number of Tiles in an line segment is determined by the length of that segment in relation to the rest of the graph (then modified by the length in the DungeonFlow asset itself). I was ready to jump in and say it'd be trivial to add a sort of "length multiplier" to each archetype in the graph, but then my expression changed to one of pure horror when I checked how I was actually doing it in code. It's a simple request and definitely something I'd like to do, but it turns out it would take some reworking to implement. Still, I'll put it on my to-do list.


    Something like this:
    Code (CSharp):
    1.     private void Awake()
    2.     {
    3.         // Get a reference to the DungeonGenerator somehow
    4.         RuntimeDungeon dungeon = Component.FindObjectOfType<RuntimeDungeon>();
    5.         DungeonGenerator generator = dungeon.Generator;
    6.  
    7.         generator.OnGenerationStatusChanged += StatusChangedHandler;
    8.     }
    9.  
    10.     private void StatusChangedHandler(DungeonGenerator generator, GenerationStatus status)
    11.     {
    12.         if (status == GenerationStatus.Complete)
    13.             DoSomething();
    14.     }
     
  6. Jos-Yule

    Jos-Yule

    Joined:
    Sep 17, 2012
    Posts:
    286
    Ok, just knowing that the size is related to how much of an Archetype's tiles are added is helpful. Hopefully without changing how it works, having more precise control over the width (%) of the segment, or info about the width/size/% of a line segment, would be a big help. Just trying to think of easy improvements ;).

    Thanks!
     
  7. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
    Thanks For Reply!

    I'm gonna give it a go but, Outdoor Generation as Built-In Feature will rock!
    Thanks for the great work!

    Keep it up!
     
  8. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    The newest version is now out of beta and is available on the Asset Store. This is the first release in which I've uploaded a package for both 4.3 & 5.0 (they're identical though, just needed a 5.0 package to request a sale), so please let me know if there are any problems.

    Version 2.5.4
    - DunGen is using a new method for socketing doorways together which is more robust. Doorways can now be aligned vertically (for stairwells, for example)
    - The DungeonGenerator class now has a DetachDungeon method allowing you to "tear-off" the dungeon from the generator so that it is not overwritten next time Generate() is called
    - Experimental: The DungeonGenerator class now has a GenerateAppended method which will generate a new dungeon appended to a previous dungeon that you specify. NOTE: This is entirely experimental and NOT supported functionality; dungeons generated in this manner will likely overlap or fail depending on whether allowIntersection is set. You'll have to decide how/if this is handled when it occurs. This is mostly in place as a starting point for those of you who want to implement infinite dungeons - but it needs additional logic (likely game-specific) to work as a complete solution.
    - Doorway components now have a ConnectedDoorway variable
    - Tiles now have some methods of getting/checking adjacent Tiles
    - Tiles now contain a BoxCollider trigger component. There's a new DungenCharacter component which handles information about which Tile it's currently in (with events fired when switching tiles)
    - The Lock & Key system will correctly also place locks on doorways that don't have a prefab applied to them
     
    hopeful likes this.
  9. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
    Hello,

    I figured out most parts of outdoor scenes, and want to get an opinion about something;

    I have a scenerio that 2 teams 6vs6 begins at the further corner of the map.

    Is there any way generate that dungeon symmetric?
     
  10. jasonMcintosh

    jasonMcintosh

    Joined:
    Jul 4, 2012
    Posts:
    71
    This is by far the best feature on your list. :) There are already good pathing solutions and portals would be nice, but lock/key fits the nature of this package perfectly, which makes the asset a better value!

    Edit: I see from a couple of posts above that I was late to the party! But it seems like fast service to me, so WIN! :)
     
  11. nitoh

    nitoh

    Joined:
    Mar 20, 2014
    Posts:
    30
    Hi Everyone!

    I have a problem, i dont know if it has been asked, i scrolled through the pages and tried to find the answer, but i couldnt find it.
    My problem is that i had big tiles. their scale is: 100x100 and it takes very long time to generate a dungeon. 20 room in 6 minutes. when i work with smaller tiles like 10x10. it takes less then 5 seconds to generate a 40+ room dungeon.
    So im sure that the problem is with the size of the tile.
    Is there a solution to reduce the generating time?

    +info: when i use these 100x100 tiles, all of the tiles are in this same size (100x100).
     
  12. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    No, there's no way for DunGen to generate dungeons symmetrically.


    I'm not seeing this when just using a 100x100 tile with nothing but a ground plane; 30+ rooms take ~15ms. I'd expect that number to rise with fully-furnished rooms, but not by 6 minutes. Can you try running the demo scene and checking the generation times for that (and also run the demo scene with your dungeon swapped in to see the times for that as well)? It should give a break-down of the time taken for each step, so we can see where the problem is:

    DunGenTimeTaken.png
     
  13. nitoh

    nitoh

    Joined:
    Mar 20, 2014
    Posts:
    30
    Thank you for your answer!
    I figured out the problem, and its not dungen's mistake.
    For some reason it takes long time to load my terrain mesh. and its causing the long loading time...
    When i removed the terrain mesh from the tile, it was generated in 1 sec...
     
  14. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
    Oh, how about tile restriction? I want to restrict a tile to be placeable only two in a dungeon?

    2 teams starting point.
     
  15. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    If you're OK with having the two starting areas at opposite sides of the dungeon, you could make the starting point as the only tile in a TileSet that's only used on the start & goal nodes in the flow graph.
     
  16. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
    Yeah thats exactly what i am looking for, thanks. For the final boss room i think i can add a tile that in the center and make it the same like start and end points..

    Thanks for reply!
     
  17. RealMTG

    RealMTG

    Joined:
    Jul 27, 2013
    Posts:
    376
    Hi again! Once again I have another question.

    Is there a way to implement a way so the dungeon builds over multiple frames instead of building the whole dungeon building in one frame? This would be great to be able to have some feedback to the player. How it is now freezes the game for some time but if you spread it out over different frames it would be possible to have a progress bar to show how much the dungeon has been built.

    I hope this made sense.
     
  18. Sehlor

    Sehlor

    Joined:
    Feb 10, 2012
    Posts:
    199
  19. RealMTG

    RealMTG

    Joined:
    Jul 27, 2013
    Posts:
    376
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,394
    Maybe that new branch of code in DunGen - where it appends to an existing dungeon - could be modified with the idea of building dungeons in smaller chunks at a time. (I have no problem making dungeons instantly on a PC, but maybe it is a lot slower on mobile.)
     
  21. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    125
    I am having a major issue and need help.

    Attached are the 2 screen shots. One is taking in iphone 6 plus (NotWorkingIOS.png) in which the wall is placed on the join and there is no way player can move to the next area. The same code ran in Unity 5 editor which works perfectly and I am using platform = IOS. Whats going on why the same code when compiled into the actual device is blocking the entrance with a wall ?.Please advice.
     

    Attached Files:

  22. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    I can't test DunGen on mobile so I'm not sure how much help I can provide.

    I'm not doing any conditional compilation so the DunGen code is definitely identical on both platforms. Is that the same dungeon in each screenshot (generated with the same seed)? Are you using the latest version of DunGen (2.5.4)?
     
  23. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    125
    That's what surprising to me is that it is the same code same dungeon and same dungeon flow diagram I am using here. I have been working for a quite a long time to come up with all these dungeons and now I move it to ios device and it breaks. Supposedly, whatever works and compile in Unity editor with platform set to ios should work on ios device. I never thought that you have to do separate coding when put it on the device. It seems like where it detects the join and put a wall based on whether it is the end or not is having some issue in ios device. Do you have any suggestion ? Yes I am using 2.5.4.
     
  24. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    When it comes to mobile issues, I'm mostly just guessing.

    Are all of the doors blocked on iOS or just some of them? If it's just some of them, could you try generating a dungeon using the same seed on PC and see if it gives different results?
     
  25. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    125
    I can't see if all doors are blocked because I can't go pass that particular are. I created with dungeon with same seed as what I am using in PC same result.

    Look at the screen short, It seems like both areas are joined correctly except in iphone the walls are not removed ??
     

    Attached Files:

  26. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    125
    I ran the same code on android and the walls are not blocked and it is running fine. I am confused, how Can it make it work on both ios and android ?
     
  27. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey there, great looking tool, im interested in perhaps an unconventional use for a dungeon generator which is for creating a fairly unconventional idea for a procedural 'dungeon' game, in which the layout ideally conforms to some basic convention, and a specfic space, or area - specifically office layouts, shopping center layouts, prison, hospital or other amenities, where the space that constrains the generation is believably filled, even if spaces here and there are kind of 'cludges' - arbitrarily small rooms to fill out spare space, but other rooms filling a traditional 'designed' pattern, like corridors with equally sized rooms placed along them, either side (typical of offices, cells, wards and do on, but later on maybe buildings entirely

    The reason i ask is while i find your methodology for creating the areas absolutely what suits me (premaking rooms with random elements added), i looking for a wider context where i can fill interiors of buildings created by something like BuildR (http://support.jasperstocker.com/buildr/) and it seem natural - one specific thing to modern buildings maybe, especially large ones, that there be a 'core' which forms both and entrance and an exit via stairs or somesuch placed in the center of the area, and the 'flow' akin to a wheel with axis rather than a linear path

    If this isnt possible on finely granular level would the correct approach to be to premodel all the tiles that you wish to conform as a whole (I.e an entire row of offices) befoehand and dungen connect them based around door placement?

    Thanks for your time
     
  28. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    That doesn't make any sense to me. I've looked into the limitations of iOS to see if there's any problems that might arise from those, but it seems it mostly just forbids anything "dynamic" that doesn't work when compiled ahead-of-time. I'm not using any of those features (and DunGen wouldn't even run on iOS if I were). I don't know what else to do other than wait and see if someone with experience using DunGen on iOS comes into the thread to help, sorry.


    DunGen doesn't handle strict structures or constraints well I'm afraid, so you wouldn't be able to have it generate believable building layouts. Your idea about building tiles from multiple tightly-packed rooms and have DunGen connect them together would absolutely work and I'd say it's the best (perhaps even the only) way of making this kind of structure with DunGen.

    The biggest issue is that there's no way to restrict a layout to a given area; there's no guarantee that a dungeon layout won't penetrate through the walls of a building if you're trying to generate a layout for the interior of a pre-designed exterior mesh.
     
  29. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    The latter part might not be a problem as the footprint of the building could change, i suppose another question might be, once an area is generated can it be saved as a reusable 'template' and then just have its contents randomised as has been stated? This way multifloor buildings with similar floors can be accomodated (In fact its main layout only generated once), with smaller aspects of the layout like pre-built-space shape changed by treating sections of the space like the randomly chosen props? And is the idea of a 'core', i.e. the entrance and exit be the same place and the rest built around it possible? (This could maybe make most multistory modernish buildings possible even if the layout was a tad bizarre)
     
  30. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    125
    I have Village Interiors Kit. Can you send me the web demo 1 on first page of this forum ? I need to see how you have come up with dungen generator.
     
  31. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    Unfortunately, none of this is really possible out of the box with DunGen. Having a separate seed for layout and props is something that I'd like to do but haven't got around to it yet - this could sort of allow you to swap out rooms if you implement them as props in a larger tile. For the 'core' idea, that's not something that could be done without some fairly major modifications to the source, DunGen was only ever meant to create a single dungeon path with some branch rooms.


    The download link to that demo and instructions on how to use it can be found in this post. There's nothing fancy going on in the dungeon flow though, it's about as simple as it could possibly be.
     
  32. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    125
    I just realized that I was not using the latest version (2.5.4) instead I was using 2.5.0 which causing the wall being blocking the path issue. Once I have updated to 2.5.4, the wall blocking the path issue on iOS devices was resolved.

    I have another issue now. Once I finish a level and go to the next level it crashes. Since crash is only happening on the iOS device not on the editor, its kind a hard to figure, well I am trying to figure out. If you have any idea how to debug let me know, since I am a newbie to the game development.

    Another issue, which is minor is the generated layout is created little higher then what it used to be in the 2.5.0 causing my player to drop into never land. I have moved the player up (y=3) that fixed it. If you have any idea why let me know. Thanks for your help.
     
    hopeful likes this.
  33. MorningtonCrescent

    MorningtonCrescent

    Joined:
    Mar 5, 2014
    Posts:
    1
    Hi,

    Just a general question about DunGen; in the Web Demo 1 there is a real time map implemented, is this part of DunGen or a third party asset?
    If a third party asset, which one?

    Thanks
     
  34. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    Sorry, I can't help with the iOS issue.

    For the player falling through the ground: I'm seeing this in the demo scene too, but the dungeon is actually at the correct height. I'm not entirely sure what's causing it but I think it could be the delay between telling DunGen to generate a layout, and it actually completing the task. It might be best to set the player position after receiving the event from DunGen telling you that the generation is complete.


    It's actually not a third party asset or included in DunGen, it was just something I threw together for that particular demo. If you're interested in the code, you can download the demo here. If you don't own both DunGen and Village Interiors Kit, the demo itself is useless, but you should still be able to inspect the code - it's a little messy (and uncommented) though because I didn't expect to publicly release that demo.
     
  35. Aphelion78

    Aphelion78

    Joined:
    May 8, 2015
    Posts:
    8
    Hello,

    This asset looks like exactly what I've been looking for but I had a couple questions. I'm interested in using this asset along side PlyGame however I noticed that PlyGame uses the Unity navmesh. Since Unity navmesh does not support runtime I was wondering if there is a workaround or an another asset that can make the built in navmesh work with DunGen? I've read that there is a way to get RAIN to generate a runtime navmesh but I really need to dig deeper and find out if RAIN and PlyGame play nice together. Are there any other assets that can handle this that anyone could recommend? Thank you very much for reading and for your time. Cheers!

    [edit] I found an interesting article that answered all my questions. Thank you very much and I'll be purchasing this amazing asset soon.
     
    Last edited: May 29, 2015
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,394
    You should post a link to that article, so that someone else with the same question can find it. :)
     
    Binary42 likes this.
  37. Binary42

    Binary42

    Joined:
    Aug 15, 2013
    Posts:
    184
    Howdy, thanks for the relay easy SCTR Vis set up with DunGen. I have one minor issue while running the analyzer, the portals don't get removed. portals.jpg
     
  38. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    I have just bought the asset and having been playing with it.

    I have few questions :

    1. Is there way to make sure the generated dungeon is with in limit of some bound sizes?
    2. Is there way to make sure that a "special" type of the room that any dungeon must have to be actually be generated? (like room containing exit to the next area , or special room that is mission related etc)
    3. I have read that the grid based idea that is supposed to be developed for version 3.0.. is this actually happening?
    4. Is there way to find out the center of the dungeon generated and its bounding box size?

    I am sure I will have more questions later but these are the ones that I really need to know soon.

    Thanks.
     
  39. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    Thanks, I'll look into this.

    1. There's no way to limit the expansion of the dungeon
    2. The only way to guarantee that a room is used is to place it as a node in the dungeon flow graph (either a custom node, or using the existing start & goal nodes). You can then assign a separate TileSet with just one tile to these nodes.
    3. I don't have any concrete plans for 3.0 right now. I have a lot of ideas for the new version but it's going to need a complete re-write and I don't have the time to do that right now.
    4. After the dungeon is generated, you can use one of the Utility methods included in DunGen to calculate the bounds of the root GameObject:

    Code (CSharp):
    1.  
    2. DungeonGenerator generator = ...; // Get a reference to your dungeon generator here
    3. Bounds dungeonBounds = UnityUtil.CalculateObjectBounds(generator.Root, false, false);
    4.  
     
  40. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    Ok I have been playing with it a bit more and this is issue that I am encountering.

    When two tiles connect together, I believe that at the moment , only one of two door actually gets the door prefab instantiated. This is fine logic and all, but I wanted to control in which room side it gets the door gets instantiated.

    At first I thought I could do this by only adding a door prefab to the tile that I want the door to appear and other (say corridoor tile) doesn't have door prefab set up.

    Unfortunately , even when my corridoor tile didn't have a door prefab set up , it seems like it gets instantiated one by the door that is connected to it. This is clearly the case, because the door prefab is parented under the door of corridoor not the room tile.

    I think it is safe to say that door prefab should only instantiate one , and on the tile that actually has the door prefab setup.
    If both are set up to have door prefab, it may not matter which one. (or be able to set some priority)

    Any ideas?
     
  41. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    Ok, ... I have sort of got that around by making the door prefab spawn in at the spot of door instead of offseted into the room.

    Still.. it would be nicer to have what I have mentioned implemented. It's simple thing but a bit of more control and logical.
     
  42. Dwight_P

    Dwight_P

    Joined:
    Feb 26, 2013
    Posts:
    32
    Hello, I just purchased this asset and for the most part it is working great. However, I am having some complication with rooms overlapping and multiple rooms getting connected to the same door. When I just has square rooms, this never happened, it wasn't until after I started adding hallway pieces.


    Edit: I do have one other question. Is there a way to be able to use a T split for a start room? I can create the T split, but the start room always picks one side or the other, and never branches out from both sides.
     
    Last edited: Jun 8, 2015
  43. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    Somewhere in this forum, I think I saw something that I can use to prevent the same tile to spawn next to each other... Was I just dreaming or where can I find this information?

    --- Edit ---

    Ok found this option :

    [ADDED] an option to reduce the frequency that duplicate rooms are being placed right next to each other. Un-checking "Allow Immediate Repeats" in the dungeon generator settings will enable this behaviour.

    But this isn't that useful, if it can't be controlled by per tile basis. So it would be more useful if we can allow to have specific tile to not repeat next to each other than applying this on all tiles.
     
    Last edited: Jun 9, 2015
  44. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    I was just been able to modify the script and have setting on the tileset to toggle repeatImmediately rather than global one.I would share if anyone is interested.
     
    Dwight_P likes this.
  45. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,394
    If you're willing to share and it's not a ton of code, my suggestion is to post it to this thread and see if it eventually gets taken up into the official code base.

    To me that sounds like the best policy.
     
  46. Dwight_P

    Dwight_P

    Joined:
    Feb 26, 2013
    Posts:
    32
    I would also be interested for you to post it in the thread. It seems like a feature that should have been done per tile and not global in the first place.
     
  47. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    538
    That was the intended use for the door prefab feature, to be centred rather than being on one side or the other. Still, I could restructure it a little so you have the option to choose which side the door is on, I just couldn't think of a time where you'd really want the door to be off-centre.


    Are you using the latest version (2.5.4)? It should say which version you have in the Readme file. There were problems with overlapping rooms in older versions, but I thought I'd fixed them all. If you are already using the newest version, could you select some of the offending rooms in the hierarchy and see if the bounding volume (red box) looks right.

    Sorry, there's no way to have multiple paths coming from the start room. DunGen only supports a single main path with branches coming from it.


    Is there really any situation in which you'd want some rooms to be able to repeat and not others? It'd be trivial to implement, but would add more set up time when making new rooms and I'm not really seeing much of a benefit to allowing rooms to ever repeat back-to-back.

    The only reason there's an option for allowing immediate repeats is that not doing so reduced the chance of a layout being successfully generated back when that was an issue. But if there's a use-case for it then I can absolutely add it - though I'll probably keep the current checkbox as a sort of global override so that people who don't want to change this setting on a room-by-room basis don't have to. I just feel it might not see much use and would just be adding more clutter and complexity to an already bloated codebase.
     
  48. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    This is really a simple example but say you have room that serves as some specific use .. like a bed room. You basically may not want to have that spawn right next to each other, but the other types of rooms such as corridoor , it would be ok to repeat right next to each other.

    Fine control over every aspect of the dungeon design is good thing, if it is needed and every game is different and you never know if a certain feature is needed.

    I can understand that sometimes simple thing is good. In fact that is right way to design UI , but fine control when you need is just anothre side of coin. You need it but not all the time. If the tool give you access to the fine control but hide the complexity, that is where sweet spot lies... I think...

    All I had to do for extra set up is to check on the box that I want it to not repeat immediately next to each other. Others are by default allowed.

    It would be super cool to have this feature implemented by you.

    I found another bug that causes room triggrer bound to be calculated worngly.. the room's bound itself (red box) was fine, but their trigger box collider was not following the rotation of the room.
     
  49. Dwight_P

    Dwight_P

    Joined:
    Feb 26, 2013
    Posts:
    32
    Yes, I am currently using version 2.5.4. I have attached several images below to show some of the weird things I am seeing off and on. Error 1) Just shows all the random pieces being dumped into a random place in the map. Error 2) Shows the over lapping issues. The two bars intersecting the path are not suppose to be there. There is actually 3 of the same exact piece sitting there. Error 3) All of my rooms bound are extremely large. Error 4) All of the rooms are starting at exactly (0,0,0), and are all box shaped with the doors on the edge, it appears the bounds are red on most of my blocks.

    If it helps, I also attached my procedural which contain all template tiles. However, all my template tiles were created using Pro Builder, so the may not load. If they don't, let me know.
     

    Attached Files:

  50. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,256
    Humm.. for some reason, some of my rooms are overlapping even if they look like they have correct bound box. (the red bound box)

    The doorways are all on the edges.. but it does happen.

    I have turned off creating room trigger, is that going to be any problem?
     
unityunity