Search Unity

DunGen - Procedural Dungeon Generation

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

  1. Wavinator

    Wavinator

    Joined:
    Dec 24, 2013
    Posts:
    79
    Hi. Is it possible to use DunGen with Probuilder? I'm wondering because I'm following the documentation in creating a tile and tried to create a door blocker but the doorway component won't allow me to add it, even as a prefab. The Probuilder object is basically a mesh with a script and materials, so I'm not sure what I'm doing wrong.
     
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    There's been mention of a problem with using ProBuilder before, but it wasn't explained. My guess is that ProBuilder uses a "meta mesh" and not a plain ol' mesh, and therein lies the conflict. So if you haven't tried it already, you probably need to convert the ProBuilder mesh into a regular mesh. I'm pretty sure PB allows you to do this in a menu option somewhere.
     
  3. Wavinator

    Wavinator

    Joined:
    Dec 24, 2013
    Posts:
    79
    Thanks hopeful, new to both assets and hadn't realized I could do that. Funny enough it accepts a Probuilder tile when saved as a prefab and generates the dungeon fine, but the door blockers (which are .objs) don't get included. Too bad, I'd hoped to be able to generate dungeons and modify them after the fact with Probuilder.
     
  4. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Hmm. I hope someone who knows both DunGen and ProBuilder can point out the cause of the problem and - hopefully - a way around it.

    If your door blockers are objs, though, it sounds like maybe ProBuilder is not the cause of your problem ...?
     
  5. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    I wish run-time lightmapping is possible in Unity for stuffs like this.

    Procedural dungeons and stuff.

    Sadly, Unity does not have the capability, or does it?

    :(
     
  6. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    hopeful likes this.
  7. robert-nally

    robert-nally

    Joined:
    Mar 5, 2014
    Posts:
    76
    Hi all,

    loving DunGen so far. One question though, how are people handling batching or I guess the lack of batching. I'm generating about 20-25 tiles and I'm admittedly using a lot of polygons but I'm seeing a ridiculous number and an insane number of draw calls. I guess because the dungen is generated at runtime static batching is not working ... ? I have my meshes set to static. I'm also using dynamic batching, but that isn't helping nearly enough. Was curious to know how other people are handling this issue. Is SECTR VIS and Occlusion Culling the answer? I'm not familiar with their asset as of yet, has anyone tried it on more of an open world?

    I'm attaching a screenshot as reference. I work for Make or Break Games so here is a preview screenshot of our open world using Dungen.

    dungen18.JPG
     
  8. robert-nally

    robert-nally

    Joined:
    Mar 5, 2014
    Posts:
    76
    @Gekigengar - I know for our situation, because certain cells with varying heights affect other cells and cast shadows that lightmapping would not be possible. If you are just using rooms perhaps you could try baking the individual tiles prior to runtime. Run-time lightmapping would probably be better referred to as dynamic global illumination or real-time global illumination because that is essentially what you are getting with lightmapping that makes it look so good along with some other stuff like baked AO (ambient occlusion). Dynamic GI or dynamic global illumination will be available in Unity 5, whenever that comes out. There is also Spectra GI, which is supposed to come out soon, and that is a dynamic GI solution as well.

    @rocki - We are using Prefab Evolution and it is working fine for us. No real issues at the moment.
     
    hopeful likes this.
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    I would think that InstantOC or SECTR VIS would help you take that down to a tiny fraction of draw calls.
     
  10. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Static batching doesn't work at all for meshes added at runtime as far as I can tell. I'd assume that it needs to be baked at build-time, like lightmaps.

    SECTR VIS will dramatically reduce the number of draw calls for indoor scenes since it will only render objects in tiles you can see into (taking doorways into account). The more open the world, the less effective portal culling will be though.

    The loss of static batching from generating the dungeon at runtime is definitely going to cause a lot more draw calls. While I haven't tried the asset linked above (InstantOC), I agree with hopeful that their dynamic occlusion culling should help a lot as well.
     
    Last edited: Oct 23, 2014
  11. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
  12. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Good to know that this is possible.

    It's unlikely that I'll be able to implement any sort of automated way of doing this into DunGen though. Automatic batching is just incredibly complicated. That and static batching only works in Unity Pro, which I don't have.
     
  13. vincentellis

    vincentellis

    Joined:
    Oct 21, 2013
    Posts:
    100
    • Is it possible to create room "areas"? I wanted to specify some thresholds and variables that specify when a certain type of room should be used.
    • Can we save a seed to generate the level again?
    • Is random prop placement also based on seeds?
    • Can a seed generate exactly the same level or there are caveats?
    • Have you tested this on a networked scene? Like, generating a seed and sending that seed to all clients so they can generate the level?
    • Can we have conditional rooms? E.g: room D and E only appear if room B has been generated with a specific content or if room B is of a specific type/prefab.
    • Can we have non-linear designs? Like circular/diamond shaped architectures, without an actual start/finish?
    • How big can the layouts be?
     
  14. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Is it possible to create room "areas"? I wanted to specify some thresholds and variables that specify when a certain type of room should be used.
    I'm not sure if this is what you're asking for, but there's a flow graph that lets you specify a general layout of the dungeon (e.g. start with a stretch of castle tiles, followed by a mini-boss room, then some crypts tiles, and ending with a boss-room).

    Can we save a seed to generate the level again?
    Yes

    Is random prop placement also based on seeds?
    Every random number is generated from the same seeded random stream, so the dungeon should be exactly the same, given the same seed.

    Can a seed generate exactly the same level or there are caveats?
    See above

    Have you tested this on a networked scene? Like, generating a seed and sending that seed to all clients so they can generate the level?
    While I haven't tested it, I'm pretty sure the random number generator is deterministic across platforms so there should be no discrepancies, the exact same dungeon should be generated for everyone.

    Can we have conditional rooms? E.g: room D and E only appear if room B has been generated with a specific content or if room B is of a specific type/prefab.
    No. Although with the source code available, you may be able to hack it in yourself.

    Can we have non-linear designs? Like circular/diamond shaped architectures, without an actual start/finish?
    With the way DunGen works, non-linear layouts aren't possible.

    How big can the layouts be?
    That's a difficult question to answer. Theoretically? As big as you want. In practice though, it depends a lot on the tiles you make. Since dungeons are generated one tile at a time, it's possible that the layout will block itself (and the longer the dungeon, the more opportunity it has to do so). Your tile shapes and the variety of tiles you use also comes into play here; some tile shapes are particularly good at making the dungeon fold in on itself.
     
    Noctys likes this.
  15. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Can the FlowGraph or its API be used during runtime.
     
  16. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    It was never designed for that, no. It might be possible if Unity lets you create assets at runtime but it wouldn't be pretty.
     
  17. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    i have add sect culling camera and remove // before
    #define USE_SECTR_VIS
    look working i see red box but it's not working i missing somethink's ?
     
  18. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    1. Did you uncomment the #define in all three files? DungeonGenerator.cs, SECTRCulling.cs, and EditorUtil.cs?
    2. Did you make sure that "Enable" is checked in the dungeon settings (under the "SECTR Integration" heading)?
    3. Are you getting any errors?
     
  19. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Hey Aegon Games! Thanks again for making such a great generator. We're trying to use terrains as the floors for our tiles, but they're being generated off-center for some reason (though the meshes/objects in the tiles are all in the right place). Any idea what might be causing this and how to fix it?

    Also, I'm working on getting a mesh batching algorithm working with your tile generation code. I'll let share the results with you if it works since you don't have access to Unity Pro.
     
  20. negativecap

    negativecap

    Joined:
    Jan 27, 2013
    Posts:
    99
    @vvander,

    The only time I had things generating off center was when the coordinates of the prefab weren't zero'd out, or the main prefab that was nested wasn't at zero...

    Also, could you share that mesh batcher when you get it working? I'm using MeshBakerLOD at the moment, and it works fine, but it dynamically batches meshes at runtime, something that batched things in sections at load might be perfect. I'm happy to help with your mesh batching algorithm if I can. PM me if I can help.
     
  21. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    Hey @negativecap, that was the first thing we checked, but it doesn't look like any of our prefabs' transforms are non-zero. Hopefully @AegonGames can shed some light on this... (Also, that linky thing you're doing with the @ is pretty cool. Never knew about that.)

    As for the batching code, I'll actually post the fairly limited code I have so far here for the community to see:
    Code (CSharp):
    1. List<GameObject> objectsToBatch = new List<GameObject>();
    2.  
    3. // first get all children of the tile
    4. foreach (Transform child in root.transform)
    5. {
    6.             // next get all the meshes in the children
    7.             if (child.GetComponent<MeshRenderer>() != null)
    8.                          objectsToBatch.Add(child.gameObject);
    9. }
    10. Debug.Log("About to batch " + objectsToBatch.Count + " objects...");
    11. StaticBatchingUtility.Combine(objectsToBatch.ToArray(), root.gameObject);
    At the moment, it's only batching like 1 or 2 of our objects per tile, but I think that's because it's not grabbing the children all the way down the hierarchy. I haven't had time to look further into it (this is lower priority for me at the moment).

    Right now I have this code placed right after the tile prefab instantiation in the TilePlacementData.cs constructor, but there might be a better spot for it.

    Feel free to use or improve it!
     
  22. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Hi, I'm sorry if I'm repeating questions others have had, but I have two quick inquiries for you:

    1) Does this support SECTR STREAM, e.g. automatic division into streamable chunks connected by portals?

    2) If I have several prefab rooms, is it possible for DunGen to generate a procedural structure connecting those rooms? E.g. "Build something that includes entrances to these four premade laboratories and this one premade garage"?
     
  23. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    I'm not sure but I think it might actually be a bug in Unity. I tested with a terrain component inside one of my rooms in DunGen and couldn't explain the results. It looks like terrains just don't behave as expected when rotating their parent GameObject. If you make a game object and attach a terrain component to it, then parent that gameobject to another and rotate the parent in the editor, you can see the terrain doesn't do what it should (it's easier to see if you also parent some other mesh as well).

    Having a terrain component nested also seems to do something weird to the pivot point of the gameobject - the translate handle is being rendered at the centre of the terrain, not at the gameobject's position.

    1. Not out of the box, no. I still haven't looked into exactly what SECTR STREAM does. If it's what I think and it's just streaming only the relevant chunks of a level in from file, I'm not sure how beneficial it would be in a situation where the content is generated at runtime and is never stored on the hard-drive to begin with.

    2. No, DunGen doesn't do any procedural generation of the rooms at all, it just randomizes the placement of pre-designed rooms.
     
  24. vvander

    vvander

    Joined:
    Jan 18, 2011
    Posts:
    72
    This is exceedingly weird. I was able to easily replicate it myself. Guess I'll have to submit a bug report... Thanks for your help!
     
  25. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    thank's it's look working !!
     
  26. Remer

    Remer

    Joined:
    Mar 24, 2013
    Posts:
    79
    What am I doing wrong? :(

     
  27. DanielSnd

    DanielSnd

    Joined:
    Sep 4, 2013
    Posts:
    382

    With the default everything (Clean project, just imported the package) I'm getting some layouts impossible to solve (intersecting rooms blocking the path). Is it a known issue? How would one go around that problem?

    - Edit -
    Hm, downloaded the beta version and seems to be fine so far, didn't see the problem appearing again, nevermind.
     
    Last edited: Nov 29, 2014
  28. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Sorry for the late response, I got the e-mail notification but then forgot to check the forums. :oops:

    Are you using the beta version? If not, then that tile won't work since it has meshes protruding past the doorways.

    I didn't realize there was such an important bug fix in the beta. I'll release 2.5.0 to the asset store today so nobody else encounters that problem, thanks!
     
  29. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    A few things (besides this is a pretty awesome asset).

    - I was getting some walls where I could see through the doorway but they were actually blocked from the opposite side by the neighboring room by looking in the scene view. This has happened about 3 times in 10 different dungeons. One time it was around the center of the room was actually blocked by a neighboring room overlapping the room I was in. This was in the demo that came with the asset.

    - SECTR really works! Dropped triangles and draw calls to somewhere around half or less, actually triangles on one level went from 54k to around 10-20k depending on direction camera was facing - and very cool to see the rooms turn off in the scene view.

    - For the problem above with the doorways/walls I decided to try the beta download. I deleted the store version and installed the beta, but then got a namespace error about randomprop and missing an assembly reference I think? (should have written it down and have since gone back to the store version) And I think one of the scripts in the >code>editor>utility folder was missing - only one script was present when I was uncommenting the #define SECTR line in the script with the beta version.

    Maybe I can just install the beta over the top of the store version would work?

    ---------------------

    Just out of curiosity because I don't think I saw it mentioned here, but saw someone is making an open world using DunGen - Is there a max size for rooms and is there somewhere to adjust how many rooms are generated?

    Thanks.
     
  30. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Hopefully, your first point shouldn't be a problem in 2.5.0. I haven't encountered any intersecting rooms yet myself at least. I'm uploading the beta version to the asset store right now as the new stable version, it could be a few days before it's approved by Unity though.

    Theoretically, there shouldn't be a maximum room size. You can't control the total number of rooms, but you can choose a desired main path length in the settings of your Dungeon Flow asset.
     
  31. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Also, DunGen is apparently 50% off for Cyber Monday. So, erm.. get it while it's cheap!
     
    c-Row likes this.
  32. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Hello,
    Looked at your trello board and understood that you'd like to give more power to your node system, which is nice :)
    I want to randomly iterate my assets and create levels using a node system. Then would like to use it as a base and manually edit rooms, corridors...etc and while doing that it would be wonderful to automagically generate my sectors and portals :)
    Wanna ask few questions based on an offline usage of Dungen:

    - What options do we have to save/export our generated levels?
    -Since you've got control of doors and corridors + you've added support for SECTR Core and VIS. why not add Stream as well? this would have no use for run-time but is useful for saved dungen.
    - What if I'm happy with rooms but not happy with props.Can I only randomize props?any control on where does a prop can be placed?
    -About the node system; Does it support staircases, ladders and bridges? Does the node placement (inside the editor) effect where the room/area is placed on map?
    -Do you have any overview video of the asset? Wanted to see the node editor closely.

    Thanks in advance for taking the time to answer.
     
  33. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Saved dungeons have taken a bit of a back seat in DunGen so far. It was originally only designed for runtime dungeons, offline generation just gets what it's given from the features added for runtime generation.


    1. Generating a dungeon offline will just dump the dungeon straight into the scene, which you can then save like any other.

    2. I didn't integrate SECTR Stream because, like you said, it has no use for runtime dungeons, I hadn't thought of using it for offline ones. I'll look into adding it.

    3. Right now there's no way to just randomize props (again, since it' not really useful in runtime dungeons). Also, prop placement is completely manual in DunGen - for all types of props, you're effectively placing markers for possible positions for props to go.

    4. Staircases and ladders would just be built into a room with doorways placed at the top, DunGen would just connect other rooms to it. Bridges could be added as a room of its own.

    5. Unfortunately, I actually haven't made a video of DunGen at all. I went fully text-based for the documentation since I don't have the means to record a voice-over (and I don't think anyone likes videos with text overlays).


    Hope that helps.
     
  34. gurayg

    gurayg

    Joined:
    Nov 28, 2013
    Posts:
    269
    Thanks for the swift reply,
    I'm happy that you'll consider adding SECTR Stream and maybe in the future, you might consider separating room-prop seeds as well.
    Do you have other options for manual placing props such as splines or a box area to spawn from a pool of prefabs? For example; A spline might be useful to define an area that spawns foliage or a box would be used for books.
    Is it possible for you to tell about your future plans on the node system a bit?
    Can the node placement can force to effect where the room is positioned and oriented on a map?
    How does Dungen and Unity Terrain work together?

    A short overview video without a voice-over is fine in my book :) just don't use a Justin Bieber song and noone will complain :)

    Sorry for too many questions!
     
  35. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    For now, it's only manual placement, but placing props randomly through splines/volumes is something that I'd like to do. The only problem is that you're not guaranteed to get placement that looks right (which of course doesn't matter if you're generating the dungeon in the editor). It's definitely something that will be coming with randomized tiles (the option to have the contents of tiles randomized, not just their placement), but I can't say when that will be.

    Not much to say on the improved node system really. I indent to completely overhaul it to just be better overall. The big things are that the new system should allow for looped connections and multiple branches in the main path.

    Node placement effects the room's position relative to other rooms in the main path. In the new system, I intend to keep this functionality if possible (probably as an option that you can toggle if you don't want that behaviour).

    Right now, DunGen doesn't work well with Unity's Terrain. Some time last month, we identified that the Terrain component didn't work as intended when its parent object is rotated. It looks like a bug in Unity - not sure if it's fixed yet.


    I'll see what I can do about making a proper video series later, but it'll take some time (that I don't have right now unfortunately, due to being in the final stretch of developing our own game). In the meantime, I literally just made a video of me throwing together a basic dungeon from the start (with some stuff in the flow editor towards the end), here it is in all of its unrehearsed and unedited glory:

     
    hopeful likes this.
  36. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    Amazing how much clearer it all is when seen in a video, even with no narration or notes. :)
     
  37. bigdaddio

    bigdaddio

    Joined:
    May 18, 2009
    Posts:
    220
    I originally wanted to use ProBuilder, there are a number of issues, a major one was it didn't allow you to create a prefab and then instantiate it at runtime. After modifying PB to allow this it would rotate the rooms. There are other little issues that just turned this into a time sink. They may have fixed some of the issues, I explained what I was doing to them and they were looking into it. Probuilder is built to build a premade space.
     
  38. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I want to load dungeon dynamically from the code (C#) by passing different dungeonflow based on which level I am in. How do I do that ?
    Thanks
     
  39. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    The DungeonGenerator class has a DungeonFlow property that you can set before calling the Generate() function.
     
  40. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    How do you assign a value to DungeonFlow property, eg if the DungeonFlow value is "L2_DungeonFlow". I usually drag and drop it to the Generator component. How do you do it programatically.

    Thanks
     
  41. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Code (CSharp):
    1. generator.DungeonFlow = Resources.Load<DungeonFlow>("L2_DungeonFlow");
    Where "generator" is your DungeonGenerator and "L2_DungeonFlow" is a DungeonFlow asset located somewhere inside a folder named "Resources" (required by Unity for loading resources at runtime).
     
  42. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    Thanks it worked perfect
     
  43. timmypowergamer

    timmypowergamer

    Joined:
    Mar 14, 2012
    Posts:
    17
    Three things:
    1) Thank you AegonGames for this awesome asset. I have spent literally weeks working on various random dungeon generation scripts of my own trying to do almost exactly what DunGen already does, but much better and more reliably than anything I was able to come up with myself. I saw it in the asset store in the past but never had the money to drop on it, but when I saw it on sale this past Monday I decided it was as good a time as any. Definitely pleased with it. Great work!

    2) I'm messing around with trying to generate some diablo-like dungeons. I have 2 archetypes set up, one using a tileset that consists almost exclusively of 4-way tiles, with a very short branching depth and a high branch count. And another of 2-way hallway tiles with no branching at all. When I dial the connection chance up to 1, the result is that the first archetype makes large randomized rooms, with the second archetype making winding hallways that connect them, as you can see in the image:


    The problem I'm having is that more often than not, the large rooms end up getting connected too, which makes for some big circular paths, which while sometimes desirable, is not always what I want. Is there some way (either now or possibly as a feature in a future version) to control the Connection Chance on a per-archetype basis rather than at the dungeon flow level? In other words, I would like to be able to control whether different archetypes, or even whether different nodes in the flow editor have the ability to connect with each other. Another example would be if I had 2 visually distinct areas (like a forest and a castle) and a tile to transition between them, it would be nice to make sure that the areas could only connect via the transition tile, and not at other random places. I hope that makes sense...

    3) For those wondering about ProBuilder and DunGen, I was able to make it work pretty quickly by just modifying TilePlacementData.cs, line 98 (in my version) from
    Code (CSharp):
    1. root = (GameObject)GameObject.Instantiate(preProcessData.Prefab);
    to
    Code (CSharp):
    1. root = ProBuilder2.Common.ProBuilder.Instantiate(preProcessData.Prefab);
    That is generally the way you go about instantiating ProBuilder meshes at run time and it seems to be working well enough with DunGen for me (I'm actually using Prototype, and not the full ProBuilder, but it works in either case). You would also have to change RandomPrefab.cs to do the same if you want to use that. Not sure yet if there is anything else that needs to be changed.

    Thanks again AegonGames!
     
    hopeful likes this.
  44. redmotion_games

    redmotion_games

    Joined:
    May 6, 2013
    Posts:
    84
    Another Unity sale victim! Thanks AegonGames.

    I've added this line (below) to the end of RandomPrefab.cs (which I've applied to some empty game objects):

    newProp.transform.localRotation = Quaternion.identity;

    I've done this because - depending on the wall - the torch prefabs only look right facing in one direction.

    So I was wondering if you could add a checkbox option in the weights panel for randomprefab.cs that allows this to be toggled? Something like "keep parent rotation" or something. Randomised rotations applied to the prefabs might also be a nice extra.

    Thanks again.
     
    hopeful likes this.
  45. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Once again, I'd like to thank everyone for all the bug reports and feedback. It's really helping to make DunGen better.


    I'll see what I can do about moving the connection chance to the TileArchetype. I'll probably keep the connection chance in the dungeon flow as well to be used as an optional override for people who don't want to set it per-archetype.


    The intended behaviour for RandomPrefab was for it to inherit its parent's transform. If it doesn't inherit rotation then that's an oversight. I'll get it fixed for the next minor release. I'll think about adding random rotation as an option as well.
     
    redmotion_games likes this.
  46. redmotion_games

    redmotion_games

    Joined:
    May 6, 2013
    Posts:
    84
    So a bit more tinkering! I have a random prefab generator and one of the prefabs in the list is a table (furniture). I placed another random prefab gameobject onto this table prefab but nothing is generated from this.

    Is there somewhere in the code where I could add a search for any child objects in random prefabs containing dungen scripts needing processing?
    Or perhaps an option for a second phase of postprocessing if that's how the prefabs are generated?
     
  47. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    While I haven't tested it, you should be able to add this to the end of the Process() function (after the place where you added the line to reset the prop's rotation):

    Code (CSharp):
    1. foreach (var childProp in newProp.GetComponentsInChildren<RandomPrefab>())
    2.                 childProp.Process(randomStream, tile);
    That should allow for nested RandomPrefabs. Let me know if it helps and I'll add it to DunGen for the next release, thanks!
     
    redmotion_games likes this.
  48. redmotion_games

    redmotion_games

    Joined:
    May 6, 2013
    Posts:
    84
    Works great, many thanks.
     
  49. Aegon-Games

    Aegon-Games

    Joined:
    Mar 7, 2014
    Posts:
    622
    Version 2.5.0 is now out of beta and is available on the Asset Store. Also, DunGen is apparently on sale again, a week after it was last on sale o_O
     
    Last edited: Dec 9, 2014
    wbakunis and timmypowergamer like this.
  50. wbakunis

    wbakunis

    Joined:
    Jan 28, 2014
    Posts:
    50
    I should of picked it up while It was on sale. Do you have plans of another sale soon?