September 24, 2019 at 9:39 pm #2399
Hi, so I followed your setup tutorial and I can’t get my dungeon to generate, and the only error I get is
“InternalGenerateLevel | Level Test failed to generate successfully.”
So I have little to go on. My game is 2d top down game so I use the XY plane. I have everything mirrored off your 2d example but unlike your example mine isnt a platform its a top down game like zelda. The only thing I can think of is I created the room prefabs wrong but with out any error info I just don’t know. My room is basic two, just brown ground tiles for a floor, and a line of darker tiles for the wall. 10×10.
I don’t understand at all, my scene can’t be more simple and your scenes work fine so I know it must be some configuration error on my part. Without much I know it will be hard for you to help, but do you have any ideas, or maybe help me understand how to create rooms right.September 25, 2019 at 8:12 am #2400
Hi Mr Quaid!
There is a tool to help you debug your dungeon generation called “Dungeon Generation Report”. That will give more information on what went wrong. With the report info you can follow step by step how your dungeon is getting generated and when/where/why it fails. In fact, the first thing I need to help you is an export of that report.
Here is how to generate the report:
Select your dungeon game object in the scene and look at the Dungeon script in the inspector. You should see a checkbox called something like “dungeon generation report”. Check that box and launch the dungeon generation once more. You should see a new gameobject appear in your scene with the report attached to it. Once you select this game object, the script in the inspector has a button to open a report reader. From the reader you can navigate the dungeon generation timeline and there is also a button to create a text file export of the report. Remember to disable the report when your dungeon works: generating the report has a significant impact on performance, its not meant to be always enabled.
So, you can look into the report and try to identify the issue yourself, or you can send me the text file report and I will look into it for you.
Let me know how this turns out for you!
VincentSeptember 25, 2019 at 3:16 pm #2401
Hi, thanks so I did use that tool and didn’t find anything however I decided to go through your video from scratch again. This time it worked, no issues at all. The only thing I can think of is maybe I messed up one step before. Having went through it 3 times I think I have a better understanding of how your system works. Thanks for the quick response, I have two more questions.
I’m pretty sure your system is capable of this but I want to get an idea where if at all does it mention it in the documents and if not your thoughts of how I should do it. I don’t want you to come up with the answer, I’m just new to coding and would like tips or possible comments on solutions that I come up with.
1- I’m making a top down game and I plan on making a hub world (Town) that the player will be doing stuff not related to the dungeon, and there will be some door’s or gates that lead to a dungeon. Now I’m thinking I just have the dungeon in its own scene and load the scene via scenemanager. The question I have is for exit, I plan on making a script that tracks how many dungeons deep the player goes before getting to say a boss or exit. What would you suggest for that, can I have a special room appear via script that contains an exit or boss room?
2- This question I’m pretty sure I can handle it but want to see what you think. I am considering putting in a system where the player can exit and return to the dungeon from town, like diablo does. What i’m thinking is I have a script that saves the seed after the world is generated, and when the player teleports to town take seed along with the player location is saved. Now when I use portal to get back I just check to see if im coming back from teleportation, if so disable random seed, add in saved one along with player location and boom back in the same dungeon. What are your thoughts on that?September 26, 2019 at 8:34 am #2402
Yeah! I’m glad you got it to work! 😀
Sure I can give you some pointers.
1- I’m not entirely sure what you mean by “how many dungeons deep”…
Do you plan to string together multiple dungeons: enter one, leave this one to go straight to another and another, etc? If that is the case, unless there is something I’m missing you should probably consider doing a single dungeon and designing multiple levels. You get to decide how levels are attached together, so you can add your boss room or exit only in the final level and give it a priority so you are sure this room will be there in the game.
If you don’t plan to string together dungeons but plan to have them live side by side (ie: you leave town to enter a forest, or go down the town well to an underground cave, but the cave and forest do not connect), then I guess you should have some sort of mechanic to track if a dungeon is completed or not. Find an item, defeat a boss, free a princess! 😛 When your character achieves that, track this in your character data. Then, in each dungeon, you could add a spawnable (let’s say a portal) that only activates when your character has the proper data (completed x number of objectives) . So your boss room or exit should not have to be a part of any dungeon at all. It will be easier to customize a memorable boss room or exit room if it lives outside your dungeon. Your dungeon only allows connection to this place when the proper conditions are met.
2- I think loading the dungeon in its own scene is a good idea. But, if you allow your character to return to the town hub with a direct back’n’forth in the middle of your dungeon, I wouldn’t unload the dungeon. In fact, I would use additive scene loading (see Unity docs for that). So your hub always exists. (although when your character leaves it you can deactivate a lot of stuff to keep a good performance) When your character enters the dungeon the first time, you load the scene with the additive feature. As long as the dungeon isn’t completed, when your character leaves the dungeon, it stays alive. So you don’t have to transition between two scenes all the time and the loading time should be cut down dramatically. When your dungeon is completed and you don’t need to track where the character was when he teleported, you can then unload the dungeon scene. (If you do that and have multiple dungeons living side by side, you shouldn’t have 2 dungeons living at the same time though. A mechanic warning the player that entering a new dungeon would erase the progress in other dungeons could be a good idea.)
To keep things interesting, you can randomize the generation seed if the character wants to grind the dungeon and have a new layout.
I hope this helps you out!
I wish you the very best of luck in your project! 😀
Chivalrous GamesSeptember 26, 2019 at 7:37 pm #2403
Thanks, so I played around with your demo scenes so I understand a bit more how you laid it out. I thought I would have to have different scenes to accommodate different levels, but I see that’s why you created the coordinates system, pretty much you have one scene from what I can tell which should work for me.
I did notice that the seed is on the Level not the dungeon so I need to figure out how to track any update that but I think I have an idea.
All in all so far I’m having fun with the system and its delivering on all the things I need. I appreciate the your help, I will probably have more questions later.
Thanks again.September 26, 2019 at 7:42 pm #2404
Great! I’m super happy that you’re having fun and making progress! Let me know if you need anything else. 🙂
Good luck with your project!
VincentSeptember 27, 2019 at 6:00 pm #2405
<Figured it Out – connection points were off>
Hi, so I decided to go with a one scene approach, getting more used to how your system works. I can use levels to make area get harder, and I even figured out how to teleport back to town. Being in the same scene made that easy, and I have a way to reset the dungeon, say if the player dies and goes back in its all different. Just called the reset dungeon method if the player enters the dungeon through the normal entrance.
Now I have a new question. What I wanted to is create the boss room entrance only once per level, however I can’t get the room to reliably spawn. Its the only room with high priority and high generation weight, however I can barely get it to spawn. Is there a way to have a 100% guarantee it will spawn?
September 28, 2019 at 6:54 am #2407
- This reply was modified 12 months ago by Mr Quaid.
Good job figuring it out!
Let me know if you need anything else!
- You must be logged in to reply to this topic.