Search Unity

Random Dungeon Generator

Discussion in 'Assets and Asset Store' started by Digital-Forest, Aug 6, 2013.

  1. Strahd47

    Strahd47

    Joined:
    Dec 14, 2013
    Posts:
    12
    Just a bit of heads up for anyone looking into this asset for windows store or windows phone 8. Asset uses XMLDocument which is not supported by those two APIs.
     
  2. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    It has been some time, any word or teaser for the updates? The different types of packs like the sci-fi?
     
  3. kerafrymm

    kerafrymm

    Joined:
    Jan 20, 2013
    Posts:
    21
    been some time from any sign of updates, is this still being worked on, or better yet, does this still work in unity 5? thanks
     
  4. Digital-Forest

    Digital-Forest

    Joined:
    Dec 27, 2012
    Posts:
    31
    Yes, we're trying to get the Dungeon Generator up and running for Unity 5. We're also busy with the SciFi dungeon, which we just completed modeling, but still needs to be textured.
    The generator appears to be working in unity 5 but gives some warnings we need to fix.
     
  5. kerafrymm

    kerafrymm

    Joined:
    Jan 20, 2013
    Posts:
    21
    Thanks for the update. Looking forward to it, and I just have a few questions that would be nice to have clarified.

    1. (I'm assuming you can generate dungeons at runtime?) what degree of control do you have over the dungeon generation in an overall sense, like forcing the generator to include a boss room or a secret store, etc.

    2. Is it possible to ensure that the generated dungeon at least has x number of items, like 3 special power-ups in total?

    3. What sizes can you make the actual dungeons, and what impact on performance does it have?

    Sorry if these questions have already been asked :)
     
  6. Digital-Forest

    Digital-Forest

    Joined:
    Dec 27, 2012
    Posts:
    31
    Awnsers:
    1. Yes it can generate dungeons at runtime, It will generate aeither a new dungeon with ta random seed (same settings) or a completely random dungeon. You have quite a lot of control over the generation, you have things like end rooms (for a potential boss) prefab rooms (your own design) and you can specify things like staircases for each generation part. You can add multiple generation parts, each with its own style (combining a fantasy and a scifi style for instance.)

    2. We don't support things like enemies and power-ups. But you can simply add an enemy as a dungeon part, or a small item, or a cheast with powerups in them, but you will have to create these items yourself. They will be generated inside the dungeon and try to add the amount you asked to add. It's not absolutely garanteed they will all be there, if for instance the dungeon is too small to fit it all, bit it will try.

    3. You can make the dungeon any size, but it will take longer to generate. It will also be heavier for the CPU, but that's only because there's more to render. This can be fixed with a occlusion culling asset, but we don't have our own occlusion system.
     
  7. Strahd47

    Strahd47

    Joined:
    Dec 14, 2013
    Posts:
    12
    Hey guys I saw you are working towards the unity 5 support. Any ETA on that maybe? Been playing around with it a bit and it will always crash unity with Random Destroy Objects in progress bar trying to generate FantasyArmory style dungeon. Works fine with the general style though.
     
  8. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi @DigitalForest, is there a way to define a starting room as well, like we do with the End Room currently?

    Also, I've noticed at times that the End Room won't always generate - is there a way to always ensure that it will be there?
     
  9. Digital-Forest

    Digital-Forest

    Joined:
    Dec 27, 2012
    Posts:
    31
    There is no starting room I'm afraid. The player always starts on a special grid to make sure there are no obstacles that can block the path.
    The endroom is not always generated if there is no space. If the end room is really small the chance that it will be generated is much bigger. If you make long corridors, the endroom is also more likely to spawn.

    You could try making more zones to increase the chance that your concept of your dungeon will be satisfactory. For instance, by making the fist zone just 1 big room and 1 straight corridor, you ensure the player always starts in a room. next zone do what you want, last zone straight corridor and endroom.

    In fact if you make a lot of zones that are really small you can make a dungeon that always generate exactly the same.
     
    Eyehawk likes this.
  10. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Fantastic, thanks for the tips Digital! I think I can use that technique to set up a pseudo starting room as well actually, i.e. using a small limited zone.
     
  11. Strahd47

    Strahd47

    Joined:
    Dec 14, 2013
    Posts:
    12
    Well I tested out a bit the current version with Unity 5. DungeonGenerator object in Hierarchy does not get its TAG assigned. But you can fix that by simply assign the same named TAG manually. After that Unity is throwing out these errors
    Code (CSharp):
    1. Recursive Serialization is not supported. You can't dereference a PPtr while loading. (Constructors of C# classes may not load objects either eg. EditorGUIUtility.TextContent should be moved to OnEnable. See stacktrace.)
    2. UnityEngine.Resources:Load(String, Type)
    3. AdvancedObjectBuilder:.ctor()
    4. UnityEngine.Resources:LoadAll(String)
    5. PartScript:OnEnable() (at Assets/DungeonGenerator/RDG_components (Required)/Scripts/Main Scripts/PartScript.cs:280)
    6. UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
    7. DungeonBuilder:BuildPart(PartTypes, Vector3, Int32, Boolean, Boolean, Int32) (at Assets/DungeonGenerator/RDG_components (Required)/Scripts/Main Scripts/DungeonBuilder.cs:1213)
    8. DungeonBuilder:StartBuilding() (at Assets/DungeonGenerator/RDG_components (Required)/Scripts/Main Scripts/DungeonBuilder.cs:399)
    9. DungeonBuilderEditor:OnInspectorGUI() (at Assets/DungeonGenerator/RDG_components (Required)/Scripts/Editor/DungeonBuilderEditor.cs:973)
    10. UnityEditor.DockArea:OnGUI()
    It doesn't break it and a built version seems to be working fine too though.
    And as an added bonus it would appear to be working fine on android too now. Didn't try anything big yet but 1 floor settings seem to work fine.
     
    Eyehawk likes this.
  12. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Nice work! We intend to upgrade at some point so it's good to know RDG can still work.
     
  13. Strahd47

    Strahd47

    Joined:
    Dec 14, 2013
    Posts:
    12
    I am also happy to report that, while the same error persists, it also seems to be working fine on Windows 8 phones. So as of right now I have successfully tested RDG with Iphone 6+, Samsung Galaxy S5 and a Nokia Lumia 930. I do plan to try and test this on older models and tablets as friends and family get around with them :)
     
  14. Timbecile76

    Timbecile76

    Joined:
    Jul 8, 2009
    Posts:
    248
    Hi,

    Just bought this. Using the newest version of Unity 5.

    Sometimes when building (usually when using a new seed) In additon to the 'recursive serialization' error above, I'm getting a 'InvalidCastException: Cannot Cast from source type to destination type' in PartSCript.CollectAdvancedObject() (at Assets/DungeonGenerator/RDG_components(required..../PartsScript.cs

    This happens at the Checking for advanced objects space step, and seems to crash.

    Any suggestions on how to fix it?
     
  15. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi @DigitalForest, I've been trying to load a new zone (with different a different template style) at Runtime.

    I've used RDGTemplateStyle.LoadFromXml which works really well in the editor.

    However, if I do a PC build, it no longer has the directory /DungeonGenerator/Resources/ZoneSetupSaveFiles/.

    I've tried creating the same directory structure under the data directory and the root of the game, but it doesn't seem to be able to get to it in the PC standalone build. Do you know how I could access the saved zone xml files?
     
  16. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hello,

    I have a probleme with RDG, i have change the prefab " floor " and i have this :



    I can re scale the prefab but he steel fly :s

    Solution please ?
     
  17. Deleted User

    Deleted User

    Guest

    Did this ever get Unity 5 support?
     
    Eyehawk likes this.
  18. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hello,
    I have find the probleme :

    Gameobject position (prefab)
     
  19. Eyehawk

    Eyehawk

    Joined:
    Dec 24, 2012
    Posts:
    288
    Hi @DigitalForest, just wondering also if this asset will be made Unity 5 compatible?
     
  20. chilberto

    chilberto

    Joined:
    Nov 18, 2013
    Posts:
    21
    I am using an empty Unity 5.1.2f1 project with RDG package Version: 8 (Apr 03, 2015). On opening the sample scene I get the following error:
    Recursive Serialization is not supported. You can't dereference a PPtr while loading. (Constructors of C# classes may not load objects either eg. EditorGUIUtility.TextContent should be moved to OnEnable. See stacktrace.)
    UnityEngine.Resources:Load(String, Type)
    AdvancedObjectBuilder:.ctor()
    UnityEngine.Resources:LoadAll(String)
    PartScript:OnEnable() (at Assets/DungeonGenerator/RDG_components (Required)/Scripts/Main Scripts/PartScript.cs:280)
    UnityEditor.DockArea:OnGUI()


    In the Hierarchy the DungeonGenerator has a Tag of DungeonGenerator while the CompletedDungeon object does not.

    I also noticed that the following Tags have been defined.
    upload_2015-7-30_21-59-29.png

    It is interesting to note that when looking at the Inspector there are no Tags defined:
    upload_2015-7-30_22-1-56.png

    When running the sample scene everything appears as expected. While the scene is running I can generate the dungeon several times without issue.

    After stopping the scene, I noticed the DungeonGenerator's Tag is now set to Undefined while the CompleteDungeon is set to Untagged. Now, when I view the Tags I see the following:
    upload_2015-7-30_22-7-49.png

    Interesting. I think this is significant based on Strahd's comment above and that when I try to generate the dungeon again (while the scene is not running), Unity locks up.

    Note: the Tag setting on both the DungeonGenerator becomes undefined regardless of whether the dungeon is generated while the scene is running or not. The Tag value is changed when the scene is started and stopped without any generation.

    Though maybe not the root cause, I think the Tag issue is significant due to the errors reported in the console:
    upload_2015-7-30_22-17-44.png

    This has a major impact to a game we have in early-release. Please respond so I know that you are aware of the issue.
     
  21. chilberto

    chilberto

    Joined:
    Nov 18, 2013
    Posts:
    21
    Further to the post above. If I manually add the missing Tag entries shown above. The scene runs without any issues including generating the dungeon while the scene is running and not.

    My guess is the initial error dealing with serialiaztion is the root cause. I will perform some more testing and post the results.
     
  22. Digital-Forest

    Digital-Forest

    Joined:
    Dec 27, 2012
    Posts:
    31
    Hi Chilberto,
    We think the Tag system has changes in unity 5 giving some problems with packages using tags. The easierst way to solve this is to open the Partscript.cs and changing line 274: dungeonBuilderScript = GameObject.FindWithTag("DungeonGenerator").GetComponent<DungeonBuilder>(); into dungeonBuilderScript = GameObject.Find("DungeonGenerator").GetComponent<DungeonBuilder>();
    It's not a perfect solution, but at least the TAG error will be gone. Make sure that the name of the gameobject that has the 'DungeonBuilder.cs' component is named 'DungeonGenerator'.

    The error Recursive Serialization is not supported. You can't dereference a PPtr while loading. (Constructors of C# classes may not load objects either eg. EditorGUIUtility.TextContent should be moved to OnEnable. See stacktrace, is still one we haven't been able to solve unfortunately. We are both working full time, and haven't had that much time to work on any asset-store packages. We hope when we are better programmers we will know how to fix there problems...
     
  23. chilberto

    chilberto

    Joined:
    Nov 18, 2013
    Posts:
    21
    Hello Digital Forest,

    Thanks for the clear and honest response. This makes sense and I will make my changes locally.

    Cheers
     
  24. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Just letting you know, Digital Forest, that the old version of the Random Dungeon Generator works fine in Unity 5.0 except I had to change one shader. I go back to the original version which I still love and use. I know the new version is better for some things but just letting you know the old one is hanging in there. : )
     
    Last edited: Oct 29, 2015
  25. Nicolas79

    Nicolas79

    Joined:
    Dec 6, 2013
    Posts:
    24
    Crashes Unity 5.2.1f

    Just bought it a couple hours ago.

    First Crash (found workaround)
    With Unity 5.2.1f, importing package (made with 5.0.0) crashes unity. I found a workaround: getting the Unity4 package, import it in Unity4.x, and deselect "generate lightmap uv" inside a couple of fbx imports. Then upgrade this to Unity5 (or copy paste assets folder).

    2nd Crash (didnt found workaround)
    When using a random seed (if not, you always get the same dungeon with same seed+options) or fixed seed 24 for example and when generating new dungeons, even simple ones like using settings in package scene, it very often crashes unity.
    Happens even using "GeneralStyle" and not Armory, although less often I think.
    Happens both in Editor generation or runtime generation.
    Happens also after a reboot (just in case it was caused by a memory leak, but didnt help).
    Cause unknown at the moment, using Unity 5.2.1f on a very good PC.

    Update/fix/help welcome!
    Is there a possible refund since it's just not useable at the moment?
     
    Last edited: Oct 9, 2015
  26. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Using the old version in Unity 5.2.2--if I first add these tags to my scene--
    begingPoint---not a typo
    endPoint
    Collider
    BuildPoint
    DGLevel
    DungeonBuilder

    I don't get the tag error message but some of my textures show as pink. Not sure what's causing this. Everything else is ok except for a few pink textures.

    I think if you add the tags first in a scene where you're importing the new version--before you import that version---tags are different there--you might not have to alter the script. But don't know about other errors happening.

    If I could fix the few pink textures in the old version, I'd be good to go. Everything was ok in Unity 5.0.

    This is still one of my favorite and most useful assets and I hope you can fix it. Will wait patiently. It's an awesome asset.
     
  27. Defcon44

    Defcon44

    Joined:
    Aug 19, 2013
    Posts:
    400
    Hello,

    Ihave a problem with the floor :



    I have check the position of the prefab and the Genericfloor and Floor are the same position :/

    But i have this problem :s

    Any idea please ?

    thanks

    PS: Problem is resolve, solution = the "ArmotyFloorPathStraight" prefab don't have the same position value :)
     
    Last edited: Nov 2, 2015
  28. PixelNAUTS_Alex

    PixelNAUTS_Alex

    Joined:
    Sep 14, 2012
    Posts:
    56
    Hey There love this asset so far!
    I have a few questions/requests.

    1. Can I use a template as a start room? One that's bigger than a corridor.
    2. Can I use a template as the final room?
    3. Is there a way to flag objects to only spawn once per dungeon? I have a dungeon with many zones and I want specific template rooms to have a unique object that is only found in that room and no other.


    Thanks a lot!
    -Alex
     
  29. _Simmo

    _Simmo

    Joined:
    Oct 20, 2013
    Posts:
    17
    Hey there

    Love the asset, noticed you updated a week ago, any updates regarding features? Or state of development on this asset? There's nothing else like this as far as generators go, I'd love to see it go further :)

    Cheers!
     
  30. drewradley

    drewradley

    Joined:
    Sep 22, 2010
    Posts:
    3,063
    If anyone is still getting this error, I changed it from OnEnable to OnLevelWasLoaded(int level) and it seems to have made the problem go away. Apparently it is trying to load resources before the scene itself is loaded. at least that's what I read.
     
  31. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Thank you so much for updating this. I think it's the best random dungeon generator in the asset store. If you make some additional texture packs for it, you've got my dime, as fast as my fingers can fly to checkout. :)
     
    Last edited: Jun 23, 2016
  32. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Hi. I'm trying to set up a style with my own textures and following the document about adding content--I note that I have to copy a "NewStyleFolder" from the DungeonGenerator/RDG_components (Required) folder----but there isn't a New Style Folder there--what should I do? Thanks for any help. Pming you too.
     
  33. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    ...and...so... the dev's: How soon (i hope) will be
    the next update, so we can use this in unity 5.4+ and 2017 ???
     
    Last edited: Nov 6, 2017
  34. piercew102

    piercew102

    Joined:
    Dec 24, 2012
    Posts:
    9
    Does anyone have this asset know how it imports into a fresh Unity2017 project? I'm really interested in messing around with it, but I'm worried it might not be compatible and send me down a rabbit hole of debugging console errors.
     
  35. Dragonhill

    Dragonhill

    Joined:
    Jun 2, 2010
    Posts:
    22
    @piercew102 - i'm currently importing into 18.2. so far there are a few lines of code that need to be altered to clean up compile warnings. other wise it was fine to delete then generate a new level from the example scene

    ------------------------------------------------------------------------
    change this in Dungeonbuilder.cs file
    //UnityEngine.Random.seed = randomSeedNumber;
    to this
    UnityEngine.Random.InitState(randomSeedNumber);
    ------------------------------------------------------------------------

    ..and then in AdvancedObjectBuilder.cs file
    change
    public UnityEngine.Object examplePart = Resources.Load("CreationTools/AdvancedObjectExamplePart", typeof(GameObject));

    to this
    public UnityEngine.Object examplePart
    ----------------------------------------------------------------------------

    finally add this to AdvancedObjectBuilder.cs file
    //added to fix warning - originally was assigned during declaration
    public void Awake()
    {
    examplePart = Resources.Load("CreationTools/AdvancedObjectExamplePart", typeof(GameObject));
    }
     
  36. Catacomber

    Catacomber

    Joined:
    Sep 22, 2009
    Posts:
    682
    Thank you so much for this.

    These substitutions worked for me in Unity 2018.3. I substituted the latest first person controller to walk around. I also was able to delete and generate a new dungeon I could walk around. The only problem I have so far is that when I'm in game mode, I lose control of the mouse. Does anyone else have this problem?
     
    Last edited: Feb 4, 2019
  37. Tsilliev

    Tsilliev

    Joined:
    Jan 21, 2014
    Posts:
    35
    Thinking of buying because it looks as the best dungeon generator for FPS out there.
    I can see that there have been no updates since 2016. It is stable?
    No crashes (when you generate dungeon for the 20th time with objects)?
    If there is a problem, is digital forest support available?
     
    Last edited: Feb 16, 2019