Hello, I recently purchased your pro version on unity asset store. I am trying to use it to generate 2d isometric maps. I've been able to follow along with the tutorial and the documentation, however when generating a map my level 0 floor layer, and wall layer for my main room, and all layers for the corridor rooms are not showing except for level 1 wall layer.
Got it to work!!! Just set your map generator object to "Tilemap layer structures/ from example" and add your room template to your map generator object.
Hey, sorry for not replying earlier but I completely missed your comments. Next time you might want to reach me on Discord as I get notified much quicker there.
Hey, I would like to port the asset to Godot at some point, but I’m not sure about the current asset ecosystem and whether users are willing to pay for assets. I’m still waiting for the official Godot asset store to be released. Unfortunally, the efforts would be probably too big for me to port it and maintain it just for fun.
The Light 2D URP doesn't work correctly when play the game build, but it works fine in editor, to fix this issue you need to create a new material and put it in the Tilemap Material in the Generator ( thanks to the comment 2 years ago below )
Hello, could you help me with this question. I need to know coordinates of the center of room and area around center to walls, area of whole room. Because I want to instantiate different objects around the room programmatycally and I don't want to instantiate it behind the room. I have tried to investigate different variants but I found only the center of room.
Hey, I’m not sure what center of a room means here because rooms can have various shapes so it might be harder to compute the center. But what you can do is, for example, get all the floor tiles that are in the room and you can spawn something on them. If you wanted to do that, you’d have to create a post-processing task which gets an instance of the generated level. From there, you can get a list of all the rooms in the level (represented by the RoomInstanceGrid2D class). Inside that, you have the RoomTemplateInstance property which is a reference to the prefab from which the room was made. There you can find the Floor tilemap and get all the tiles inside it. You can use these floor tile positions as a base for your spawn behaviour.
So, yes, I tried to extract all tiles from room and converted their coordinates to world coordinates. Now I can spawn anything in particular places inside room. Thank you. Is it the only one way to do it or maybe you know another approach? :)
Do you have any specific requirements for this? What’s your goal? One approach that is sometimes useful is to manually mark places where it’s valid to spawn something. You can use empty game objects to mark suitable places and then later pick some of these places and spawn some decorations/enemies there. That way, you have complete control over where things can spawn and you can also randomize. The downsize is that you have to mark these positions manually when creating room templates.
Hello! If I understand your use case correctly, you are randomly picking a random Input setup class and you want to get the computed level description. As this is not a mainstream use case, I would propose the following solution. Instead of using the DungeonGeneratorInputBaseGrid2D class directly, make a child class instead, something like MyCustomInputBaseGrid2D and on this class, you can add a custom public MyGetLevelDescription() method that calls the protected method. Then, in your RiftGeneratorInputSetup, instead of referencing DungeonGeneratorInputBaseGrid2D, you would reference MyCustomInputBaseGrid2D so that you could call MyGetLevelDescription() directly.
Hello and sorry for the unpleasant surprise! Last week, I finally decided to get rid of the alpha/beta status of Edgar and released an official “2.0.0” version, and also was able to release it on the Unity Asset store.
The good news is that right now, the asset is in a “new releases” sale on the Unity Asset Store for $20, you can find it here.
Unfortunately, Unity does not let creators give assets “for free” if they purchased them on a different platform (Unity would basically lose money doing that).
And I definitely plan to update the asset on both stores after it gets to the Unity Asset Store.
Hello! I think that the problem might be caused by the fact that tilemaps are merged into a set of large shared tilemaps after a level is generated. So if you add some custom components to your room template tilemaps, they’ll be lost after you generate a level. Please take a look at this docs page. You can use the FromExample mode to tell the generator which tilemap structure you want.
I'm trying to do raycasts from within the level, from an object to the player, and to detect if the raycast hits a wall. Have it working in a test environment, but as soon as i try to do it within a generated level, the ray always detect a wall hit no matter what.
I'm using a layermask on the generated Walls object that has the Tilemap collider.
Not sure if this is a problem with Edgar, or Tilemap collider itself. You have any idea?
Hello, I think that what you’re observing is not a bug within Edgar, but maybe you’re expecting the generated level to have some properties that it doesn’t have. Please check that the layermask is correctly configured after you generate a level. Internally, Edgar uses only built-in Unity tilemaps so you should get the same results as if you prepare a replica of a simple generated level in your test environment. You can also generate a single Edgar level directly in the Editor (not in Play mode) and see what are the differences between this level and your test environment.
Unfortunately, I don’t have any experience with raycasts in Unity so I don’t know about any specific “gotchas” that may be the cause of your problem.
It seems like the generator thinks that there is a room template without any tiles. Unfortunately, the exception doesn’t contain the room template name, which I should fix in the future.
However, when you open a room template prefab, you should see a status panel in the top-left corner saying whether the room template is valid or not (if you don’t see the status panel, make sure there is the Room Template Settings component attached and that you allow gizmos from that component). If the room template is not valid, there should also be a red warning in the Room Template Settings component. So you should be able to find the wrong room template quite easily.
Thank you, I did notice the "room is valid" on all my rooms.
Fortunately the error is gone now, no idea how :)
I had an idea, it would be kind of cool if you could have an array of level graphs in the dungeon generator, and have it randomly select one on generation.
Hey, I’m not sure about the disappearance of post-processing tasks - it has never happened to me. Make sure that you properly save the scene when you add the post-processing logic. Or it’s maybe possible that the instance of the scriptable object is not created properly.
Hello,
I don’t think that it’s easily possible to save a scene during runtime (not just in Edgar but in Unity in general). So I think your best option is to just freeze the current level (stop enemy movement, etc.) and hide it, then show (or additively load) the challenge level and when it’s completed, destroy the challenge level and unfreeze/show the original level.
For example, if you had the whole level inside a single game object, you could probably just disable it for a while, show another game object with the challenge level, and then go back to the original level.
But I don’t have any personal experience with this.
Hey, just discovered this superb level generator! Trying to make it work with 2d lights and shadow casters and have run into some problems where halls/doors are connecting to the rooms., as in the screenshot in this link image
The way I've done it right now is to add shadow casters to the wall object in the room templates (also other object in the room template when i needed more than one shadow caster). It's When the hallway templates connects to the door positions that the shadow intersect.
I can kind of get around it by only adding a few door positions, and make several shadow casters that do no overlap them, but that severely limits the amount and size of door positions that i can use.
Hello,
unfortunately, I have no experience with 2d lights and shadow casters in Unity. But maybe one thing that could help would be to not have these shadow casters attached to the Wall tilemap in individual room templates but rather have them attached to the shared tilemaps where all the room templates are merged into.
After a level is generated, I find all the tiles in individual room templates and combine them into a set of shared tilemap layers. That means that walls from all room templates are merged into a single large tilemap layer. What I propose is to not add shadow casters to walls in room templates but rather add them to the shared tilemaps where corridor connections are already processed. You can first try that manually: generated a level and then inspect the game object in the scene hierarchy, find the shared Walls tilemap layer and add the shadow casters.
I’m not sure how much experience with Edgar you have so feel free to ask additional questions. I may also try these shadow casters myself if you give me some additional instructions on how to do that.
Thanks for your quick reply. You mean in for instance add it to Generated Level>Rooms>Walls?
While that probably would work on an existing level, but since you have to define the shape of the shadow caster manually (at least from what I know), it would not work in practice.
I was thinking it might work if you could add it directly to a single tile, then when you fuse corridors with rooms you could remove the shadowcasters from the colliding room tiles. No idea how to add it so a single tile though.
If you could somehow generate a Shadow caster that has the same shape of a shared wall tilemap layer, would probably be the best way.
Shadow casters are otherwise fairly simple to use, it does requires a Universal Render Pipeline project. This short video should help, link
Ok tried the Tilemaps Shadow Caster in the second link. Could not get it to work with the generated shared walls tilemap layer. Or it actually generated shadow casters but they didn't show up. I did have to do this in play mode, so not sure if that's the problem
It does kind of work if you put it on each of the wall object inside a room template, but the same problem as before occurs when intersecting with corridors. The auto generated shadows are also not perfect.
Is there a reason why the auto-generated shadows are not perfect? I thought that it would just use the polygon tilemap collider and compute the precise shape of the walls. Do you need something more than that?
I met a issue, My game use 2d renderer, On iOS and Android, when I put 2d light and 2d shadow caster in roomtemplate, and try generate a random map at run-time, the 2d light and shadow seems incorrect. But if I try use a pregenerated map or running in unity editor, everything working correctlly.
Hey! There’s a “Material” field in the Post-process config in the generator component. Please make sure to assign the correct material there. It seems like Unity has sometimes problems with choosing the correct default material.
Hey! Unfortunately, there’s a quite large codebase already implemented for Unity so I think it’s not really possible to reimplement and maintain it for the Game maker studio 2.
First, thank you for your work, this asset is really amazing.
I am using this asset for a month now, I wanted to implement your Fog of war solution, but as I understood I can't use it with 2D lighting. So I tried and managed to do my own Fog (tile based) but its quality is not near as yours.
Do you think that your Fog solution will be possible to use with 2D lighting soon?
If not, is there any tips you could give me, so I can try to replicate what you did?
Also I am fairly new to unity so I am not sure if it is possible to use 3D lights in a 2D projet, and if it is I didn't manage to do it, that's why I wanted to stick with 2D lights. If it is possible and it is the simpler solution I am willing to change.
I hope you could understand what I meant, I am not an English speaker :/.
I’m not sure I understand what exactly are you trying to achieve. As far as I know, the fog can work with 2D lighting. Can you please provide some more details? Are you using the builtin render pipeline or LWRP/URP? Which Unity version do you use? Can you show me an illustration of what you want to achieve and what is the current behaviour?
In order to use your FOW, I created a forward renderer, and then input the FOW rendering feature.
If I am not wrong using 2D lighting require a 2D renderer and this kind of renderer doesn't take as input a renderer feature, so I didn't manage to use your FOW with this renderer.
The FOW that you did in your tutorial is perfectly fine.
Thanks for your clarification. The problem is that the 2D renderer doesn’t support scriptable render passes which are required for the Fog of War effect to work. You can see a forum thread regarding this issue here - https://forum.unity.com/threads/urp-2d-renderer-custom-feature.778946/. It was created in 2019 and only a month ago someone from Unity replied that “The work on this has officially started.” Even though I have no experience with the 2D renderer, I think that it should be easy to add support for the Fog of War effect once they release a version with custom render passes.
As far as I know, you should be able to use 3D lights in a 2D project without any big problems. From what I can tell, the 2D lights are better optimized for 2D games than 3D lights and they also come with some additional features. But there are people using Edgar with URP, the Forward Renderer and 3D lights and it seems like it works for them.
Also, I would not recommend you to replicate the FOW effect yourself. First, there’s that problem with not supported custom render passes. Second, I spent quite a lot of time on that and it requires you to know some internals of Edgar to do that properly.
I think that it might work but I cannot be completely sure without trying that myself. Please let me know if it works for you. Should you have any problems, I might try it aswell.
I am getting so close to being able to port my existing game over to this amazing dungeon generator now.
One issue I am having.
the dungeon generator creats a Generated Level at runtime but all of the tilemaps are on the default Unity Layer. I am using A* pathfinding which needs everything on separate layers.
where can I make an edit to place the different tilemaps onto different layers?
If you want to customize the output of the generator, the best way to do so is with a custom post-processing logic. You’ll have to implement the Run method which will be called after a level is generated. This method receives an instance of the GeneratedLevel class on which you can call the GetSharedTilemaps() method to get all the tilemaps from the level. When you have the tilemaps, you can find the ones that need a different layer and change that layer.
thanks for a great level generator. I have started making my game with a very basic level generator and I really wanted to try out the EnterTheGungeon style generator. the basic examples are working fine but others I get a timeout error every time.
example1 works - example2 works - minimap example works - fogofwar example works - platformer3 works
gungeon does not work - platformer1 does not work
deadcell not sure as i have not set up the extra parts for it
well I have deleted the folder and re-imported . no change. the mini-map example works fine, including FOW but the gungeon example keeps giving timeout
Please try to do the following:
Open the DungeonGeneratorTask file in Edgar\Runtime\Generators\DungeonGenerator\PipelineTasks and replace the following section starting at line 80:
if (layout == null)
{
throw new TimeoutException("Timeout was reached when generating level");
}
Replace it with the following code:
if (layout == null)
{
if (task.Exception != null)
{
throw task.Exception;
}
else
{
throw new TimeoutException("Timeout was reached when generating level");
}
}
There is currently a problem (which will be fixed in the next version) that the timeout error is sometimes displayed even if there is a different error in the underlying generator. After applying this change, please try to run the generator again and see if the error changed.
Also, a week ago someone reported quite a weird problem with the generator and it started working after he created a clean project and imported the asset there. I don’t know what Unity does behind the scenes but it seems like there’s sometimes a problem with some existing projects.
Please let me know if that helps. If the problem persists, I’ll try to look into that in more detail.
rgumentException: No shape of the room Edgar.GraphBasedGenerator.Common.RoomNode`1[Edgar.Unity.RoomBase] could be connected to its neighbors. This usually happens if there are pairs of shapes that cannot be connected together in any way (either directly or via corridors). (The mentioned room may not correspond to the actual room as custom types are often mapped to integers to make the computation faster.) Edgar.GraphBasedGenerator.Common.LayoutController`5[TLayout,TNode,TConfiguration,TShapeContainer,TEnergyData].AddNodeGreedily (TLayout layout, TNode node, System.Int32& iterationsCount) (at <52d877296fbf43209c7081a55723a5a2>:0)
No, the minimap should work even without custom tilemap layers. However, you'll usually need to create a Unity layer for the minimap to work. The term "layer" is used multiple times in the Unity ecosystem so it might sometimes not be clear which "layer meaning" is used.
Hey! As per documentation, there are no colliders in the Isometric 1 example, but it should be ready to add your own colliders. I haven't developed any isometric game myself, so basically, all my knowledge comes from this article. If you look at the "Adding Collisions" section, you can see that they're adding an additional tilemap layer that only describes the colliders in the level and you can hide it afterward. The code that you pasted only creates the collider tilemap layer and adds collider components to it - it does not add any tiles in that layer. That means, that after you generate a level, you'll see the Collider layer in "Generated Level -> Tilemaps" but you won't see any actual colliders there. What you can do is to go to individual room templates and populate the Colliders layer with tiles on places where you want the colliders to be. And after you generate a level, you'll see all the collider tiles from individual room templates merged together in the Colliders layer.
There seems to be one oversight from in the last version of the asset. The "Tilemap Layers Structure" in the Dungeon Generator should be set to "Custom" as there's a custom layers handler (from which you pasted the code). So if you set it to "Custom", you can open the "Tilemap Layers Handler" scriptable object in the folder with the example and there you can switch "Hide Colliders Layer". If you set it to false, the Colliders layer will automatically be hidden in generated levels.
Let me know if that helps or if you have any other questions!
It seems like you're not using the latest version of the asset. In that case, you don't have to worry about that option.
It seems like that change was not yet merged to the master branch. That means that you don't have to worry about that. I'm sorry about that. It's sometimes hard to keep track of which version of the asset I have currently loaded.
Hey! You can easily access the layer in a custom post-processing task. The "Run" method receives a "GeneratedLevel" object and on that, you can call the "GetSharedTilemaps()" method and it gives you only the shared tilemaps for the whole level. In this list of tilemaps, there's only a single one with the name "Walls" - the one that you're looking for.
The first error is because of a missing namespace (“using System.Linq;” I think). I recommend using an IDE that can autofill namespace automatically. I’m using Visual Studio (which also has a free version available) but I think you may be able to achieve similar results vs Visual Studio Code.
The second error is probably also related to a missing namespace (or a package in your project?).
Please check that your project is correctly set up to have collisions between objects in different layers. The generator does not alter the physics behaviour of Unity in any way.
I found another problem. After each room is generated, it seems that they are independent coordinate systems, which makes it difficult for me to ask the enemy to carry out some actions based on distance and position. Is there any way to unify their coordinate systems.
Can you please look into Transform.localPosition and Transform.position? It sounds like you're using gameObject.transform.localPosition instead of .position. If you always use .position, all coordinates should be in the world space and not in the space relative to the parent (e.g. a room).
hi, I bought your pro version four hours ago, I tested the Dead Cells and Platform demos, all room prefabs in these demos are using Composite Collider 2d component, but when I run these demos which are using Platform Effector 2d component in runtime instead.
so the character cannot collider with the platform correctly.
I cant find where to fix this problem. could you please fix it as soon as possible, and send it to me?
my English is really bad, hope you can understand what I mean! thanks.
Can you please verify that you did the following two things? (as described here)
"To run the example, you need to:
Add a layer called "StaticEnvironment"
Enable "Auto Sync Transforms" in Physics2D settings"
I cannot do these two things automatically from inside the asset so they must be done manually by people who want to run the Dead Cells example. If I remember correctly, the colliders didn't work for my until I enabled "Auto Sync Transforms".
It's correct that there are both composite colliders and platform effectors. Platform effectors are only enabled for the "Platforms" tilemap layer so that the player can jump through platforms but no through walls.
Please do the two steps above and let me know if it works. I tried the Dead Cells example on my computer and it did work properly.
Hello! looks very nice. Before I purchase: — Is it easy to implement a lock/door and key system? — Can it generate in editor (without pressing play button)
Generation in editor: Yes, it's possible. The generator component has a button which you can click in editor to generate a level.
Locks and keys: It depends on what you want to achieve. There is no explicit support for locks and keys, but the generator should give you access to everything you need to implement that. Doors are implemented in examples scenes Example 1 (you press a button to open a door) and Enter the Gungeon (doors are closed when you enter a room so you have to fight with enemies, and also one way doors that have to be opened from a specific side). Now it depends if your locks and keys should be static (lock positions are fixed for each level graph, different level graphs can have different lock positions) or dynamic/procedural (you want to randomize lock positions in individual level graphs). I'll assume static locks but the other approach should also be possible. For static locks, you can create a custom class to represent connections between individual rooms in a level graph. In that class, you can add an isLocked field to describe if the connection should be locked or not. If you plan to have different keys opening different locks, you can also add a key field that specifies which key opens the lock. After you generate a level, you can access this information and setup your locked doors game objects (for example in a custom post-processing task).
Hello There Ondrej Hope you are good. In the meantime I have purchased your asset. Yet I still need to find the time to experiment with it. I just thought to support your work!
I do was wondering: is it possible to create rooms that may only spawn once? Unique rooms?
And yes, it’s possible to have unique rooms. There are basically two possible approaches:
You can have a room template that you only assign to a single room in the level graph. By doing so, you can be sure that it’ll be used at most once in the level.
Or you can use the “Repeat mode” option that is available on each room template. (https://ondrejnepozitek.github.io/Edgar-Unity/docs/basics/room-templates#repeat-mode) You can choose that the room template must not be used multiple times in a level. Just be sure that you don’t overuse this feature because the generator might have problems generating very constrained levels.
If the timeout is reached everytime , that means that there's something wrong with your level description.
The most common issues are: - You should provide both vertical and horizontal corridors. If you provide only one of them , the generator is often unable to produce a level. For example, you usually can't draw a cycle using only vertical corridors. - Check that you always use the same length of doors. It seems like you're using manual doors so make sure that you stick to the same door lenght in all your room templates. For example, if you sometimes use lenght 1 and sometimes lenght 2, the generator may be unable to produce a level. - Check that your level graph is not too complicated. You usually don't want to have too many cycles in the graph.
If you don't find the problem yourself, please do the following: There is an "Advanced" section in the Dungeon Generator component and there should be an "Export map description" button. Click the button and it should create a file called "exportedMapDescription.json" in the root folder of your project. Please send me this file - it contains information about the shapes of your rooms. You can send me that file at ondra@nepozitek.cz and I'll look into that.
When I generated the level, my character and camera lost each other's transform, and my enemies couldn't read the player's tag. There were a lot of MissingReferenceException. When should I get monsters to get players, and cameras and players to get each other.
When a level is generated, all the room templates that are used in the level are instantiated and moved to the correct positions. If there were some missing references, it may be because you generated a level, then referenced something in the level, then generated the level again and all the references got lost. However, I'm not sure why should you lose a reference to your camera. If you don't create the camera at runtime, the reference should always be the same. Moreover, keep in mind that it takes some time to generate a level. That means that if you run some code in on of the Start()/Awake() methods, some game objects may not exist yet. For example, if your player game object is part of a room template, it'll be present in the scene only after a level is generated so if you try to find it by its tag before that, you won't find anything. The correct approach to that is to have the game object always present in the scene or make sure that you use it only after a level is generated (for example in a custom post-processing task as described in the docs).
Hey! It should be relatively simple. When you spawn enemies in a room, keep track of which enemies you spawned, for example in an array. Now in your room manager class, you want to have a method e.g. void OnEnemyDefeated(GameObject enemy) that will be called when an enemy is defeated. Inside the method, you will remove the enemy from the array of all enemies that were spawned in the room. And if there are no enemies left in the array, that means that there are no living enemies in the room, so you can open the doors. The last thing to handle is calling the method when an enemy is defeated. I presume that you have access to the health of each enemy so if the health of the enemy equals to 0, you call the OnEnemyDefeated method with the enemy that was defeated.
Hey ! This tool seems great, and I think of buying it when I get paid in a few days, but I have a question : how complicated is it to generate "3D" level (actually, 2d level with 3D tiles) with it ? Thank you !
Hey! Do you have an example of what would you like to achieve? The generator currently works with 2D tilemaps. You define room templates as 2d tilemaps, give it to the generator, the generator computes how to position individual rooms and then produces a level that is again composed of 2D tilemaps. I don't have much experience with 3D in Unity so I need you to help me imagine what it should do and I how would you want to use the tool.
I think that it's doable. There are two places you'd have to sligthly hack the generator. First, the generator need to compute the outline of each room template. To do that, it normally gets all the tilemap layers and computes the outline polygon. If you do not have any 2d tilemap, you can't rely on the default algorithm and have to do the computation yourself. There's currently a IRoomTemplateOutlineHandler interface with a GetRoomTemplateOutline() so, in theory, if you provide a component that implements this interface, you don't have to use any 2d tilemaps. The second place where additional work is needed is to handle the output of the generator. Normally, the generator does a lot of work behind the scenes in multiple post-processing steps. These steps include merging all room template into a single tilemap or disabling unnecessary colliders. The good thing is that these post-processing steps are completely optional and you can disable them all. So you'd have to disable them and then implement a custom post-processing logic. Each post-processing script is a given a mapping room -> (room template, position) and you're free to do anything with that. So you should be able to output your 3D models, it's just an additional work that you have to do yourself. So theoretically, there should be no MAJOR obstacle to achieve what you want. To be sure, I can check that there's no stupid code that for some reason expects that there are indeed 2d tilemaps used. If that were the case, it should be relatively easy to fix.
Otherwise, once the level is generated, Can I have a way to know what tile was used in a specific position ? (x=1 y=3 for example)
That way, I could write a tool that use the output of Edgar to place the 3D model somewhat "on-top" of the generated 2D level.
All I'd have to do is provide a basic 2D tilemap, and depending on the level I want to generate, provide differents 3D prefab.
That way It'd be forward compatible ?
Edit : while rereading your answer, it seems we are on the same page. If I got it right, I only proposed to still use a 2D tilemap to let Edgar "do his thing", then output via a custom post-processing logic. Am I understanding it correctly ?
The generator doesn't use any special data structure to store the generated level. Everything is done with built-in Unity tilemaps (https://docs.unity3d.com/Manual/class-Tilemap.html). So if you get the instance of the Tilemap class, you can call the GetTile method to see which tile is used in a specific position.
Example usage: 1. Define room templates as usual using 2d tilemaps 2. Let the generator create a 2d level 3. Create a post-processing script that gets access to the output tilemaps of the generator 4. Go through individual tiles in the output tilemaps and spawn corresponding 3d tiles 5. Do some cleanup (hide original 2d level, etc.)
This approach would be very close to the normal approach, just enhanced with a custom post-processing logic. One theoretical problem with this approach is its performance. The generator will compute things that are meant for 2d levels and you would then discard them and replace them with a 3d level. You should definitely avoid doing one thing - recomputing 2d colliders for the output tilemaps (assuming that you don't want them). This is probably the most computationally demanding step. To avoid doing that, make sure that when creating room templates, you don't use any tilemap layer with colliders (https://ondrejnepozitek.github.io/Edgar-Unity/docs/basics/room-templates#designi...). Also, custom tilemap layers handlers might be useful (https://ondrejnepozitek.github.io/Edgar-Unity/docs/guides/room-template-customiz...).
This tool seems useful but I am wondering how to open the editor file in the folder. Is this Mac compatible because it says it cannot find any existing application to open it.
Hey! Can you please explain what do you mean by "the editor file"? This tool is a Unity package that you can import into your Unity project and do everything inside the Unity editor. None of the files should be used outside of Unity.
Maybe I'm just being stupid but when I open the folder there is a file titled Procedural Level Generator.Unity.Editor. That might not actually be the editor, I'm new to Unity.
It is not required to open any such file. You download the .unitypackage file, import that into a Unity project and after doing that, all the funcionality of the tool should be available in your project. The gui of this tool is compatible with the Unity editor. That means that you do not have to open any dedicated file to access the editor gui of this tool. I would suggest to read some Unity basics tutorial if you are new to Unity.
Really amazing tool you've made, and the fact that it has a free version is pretty crazy, given the amount of work you've clearly put into this. Appreciate you a lot :)
Love the free version so much, it's honestly the best dungeon generator I've found and works REALLY well and to top it off the support you provide is amazing so I decided to support you through this. :) I hope more people find this. <3
Thank you for continuing to approval on this project. I bought it as soon as I saw the Isometric piece. I was using the free version. So since we are buying it now, we will continue to get updates ?
I'd be fine with giving you a key on the Unity asset store. Unfortunately, Unity allows me to give only a very limited number of keys and is probably generally not happy with giving keys to people that purchased the asset elsewhere. So I'd recommend waiting for the asset store release if you want to access the plugin from there.
I'm one of your early adopters from Github. This is such an excellent tool. :)
The free version is working fine for me and does everything I want from a dungeon generator, but I bought this asset here only to support your awesome work. :)
Am excited to see what else you add to this, so am also reserving my seat for the full version :)
← Return to Unity asset
Comments
Log in with itch.io to leave a comment.
Hello, I recently purchased your pro version on unity asset store. I am trying to use it to generate 2d isometric maps. I've been able to follow along with the tutorial and the documentation, however when generating a map my level 0 floor layer, and wall layer for my main room, and all layers for the corridor rooms are not showing except for level 1 wall layer.
Here is a corridor
corridor 2
Result does not show corridors or room floor
Got it to work!!! Just set your map generator object to "Tilemap layer structures/ from example" and add your room template to your map generator object.
Hey, sorry for not replying earlier but I completely missed your comments. Next time you might want to reach me on Discord as I get notified much quicker there.
Good job on making it work for you though!
Hi, I'm kinda lost on how to implement locked doors and will only open the doors within the current room once all enemies are defeated
Hey, did you go through the tutorial in the docs? https://ondrejnepozitek.github.io/Edgar-Unity/docs/examples/enter-the-gungeon/
Hey, I would like to port the asset to Godot at some point, but I’m not sure about the current asset ecosystem and whether users are willing to pay for assets. I’m still waiting for the official Godot asset store to be released. Unfortunally, the efforts would be probably too big for me to port it and maintain it just for fun.
Try porting the plugin via unidot
The Light 2D URP doesn't work correctly when play the game build, but it works fine in editor, to fix this issue you need to create a new material and put it in the Tilemap Material in the Generator ( thanks to the comment 2 years ago below )
Hello, could you help me with this question. I need to know coordinates of the center of room and area around center to walls, area of whole room. Because I want to instantiate different objects around the room programmatycally and I don't want to instantiate it behind the room. I have tried to investigate different variants but I found only the center of room.
Hey, I’m not sure what center of a room means here because rooms can have various shapes so it might be harder to compute the center. But what you can do is, for example, get all the floor tiles that are in the room and you can spawn something on them. If you wanted to do that, you’d have to create a post-processing task which gets an instance of the generated level. From there, you can get a list of all the rooms in the level (represented by the RoomInstanceGrid2D class). Inside that, you have the RoomTemplateInstance property which is a reference to the prefab from which the room was made. There you can find the Floor tilemap and get all the tiles inside it. You can use these floor tile positions as a base for your spawn behaviour.
Does that help?
So, yes, I tried to extract all tiles from room and converted their coordinates to world coordinates. Now I can spawn anything in particular places inside room. Thank you. Is it the only one way to do it or maybe you know another approach? :)
Do you have any specific requirements for this? What’s your goal? One approach that is sometimes useful is to manually mark places where it’s valid to spawn something. You can use empty game objects to mark suitable places and then later pick some of these places and spawn some decorations/enemies there. That way, you have complete control over where things can spawn and you can also randomize. The downsize is that you have to mark these positions manually when creating room templates.
Thank you a lot for advices, I think that I managed to resolve the problem :)
does the 'fog of war' feature work with the 2D renderer in Unity 2021 and above?
Hello, yes it should work because the 2D renderer should now allow adding custom renderer features.
Payload to be Obsolete,I need to get the LevelDescription.
protected override LevelDescriptionGrid2D GetLevelDescription()
change
public override LevelDescriptionGrid2D GetLevelDescription()
Hello! If I understand your use case correctly, you are randomly picking a random Input setup class and you want to get the computed level description. As this is not a mainstream use case, I would propose the following solution. Instead of using the
DungeonGeneratorInputBaseGrid2D
class directly, make a child class instead, something likeMyCustomInputBaseGrid2D
and on this class, you can add a custom publicMyGetLevelDescription()
method that calls the protected method. Then, in yourRiftGeneratorInputSetup
, instead of referencingDungeonGeneratorInputBaseGrid2D
, you would referenceMyCustomInputBaseGrid2D
so that you could callMyGetLevelDescription()
directly.Let me know if it helps.
Thanks!
I've been using Edgar for the last month and was going to purchase Pro but then the price more than doubled from $15 to $40! Did something change?
Hello and sorry for the unpleasant surprise! Last week, I finally decided to get rid of the alpha/beta status of Edgar and released an official “2.0.0” version, and also was able to release it on the Unity Asset store.
The good news is that right now, the asset is in a “new releases” sale on the Unity Asset Store for $20, you can find it here.
Let me know if that works for you!
I see! Congrats on the 2.0 I must have missed that. I will grab it on the Asset Store thanks!
It's a very powerful plugin. Do you plan to release it on the Unity Store?
Hello, yes, I plan to release it on the Unity asset store. I cannot guarantee anything but I want it to be there in less than a month.
Great to know. Would people who purchased the asset here on itch.io also get it on the asset store?
And do you plan to continue updating it on both stores or will updates be made available on the unity asset store after its release there?
Thanks
Unfortunately, Unity does not let creators give assets “for free” if they purchased them on a different platform (Unity would basically lose money doing that).
And I definitely plan to update the asset on both stores after it gets to the Unity Asset Store.
Great to know that you plan to update on both stores :)
All the best with your Unity launch :)
Is it possible to generate dungeons and rooms through coding?
Sure, look at this docs page: https://ondrejnepozitek.github.io/Edgar-Unity/docs/generators/dungeon-generator/#call-the-generator-from-a-script
And you can also change any of the properties that are exposed in the inspector.
Why some component(Rigidbody2d and collider2d in plateforms) is missing after generate new level? But it works well when I move platforms to Other1
Hello! I think that the problem might be caused by the fact that tilemaps are merged into a set of large shared tilemaps after a level is generated. So if you add some custom components to your room template tilemaps, they’ll be lost after you generate a level. Please take a look at this docs page. You can use the
FromExample
mode to tell the generator which tilemap structure you want.thx for reply. It helps for me.
I'm trying to do raycasts from within the level, from an object to the player, and to detect if the raycast hits a wall. Have it working in a test environment, but as soon as i try to do it within a generated level, the ray always detect a wall hit no matter what.
I'm using a layermask on the generated Walls object that has the Tilemap collider.
Not sure if this is a problem with Edgar, or Tilemap collider itself. You have any idea?
Hello, I think that what you’re observing is not a bug within Edgar, but maybe you’re expecting the generated level to have some properties that it doesn’t have. Please check that the layermask is correctly configured after you generate a level. Internally, Edgar uses only built-in Unity tilemaps so you should get the same results as if you prepare a replica of a simple generated level in your test environment. You can also generate a single Edgar level directly in the Editor (not in Play mode) and see what are the differences between this level and your test environment.
Unfortunately, I don’t have any experience with raycasts in Unity so I don’t know about any specific “gotchas” that may be the cause of your problem.
What does this mean? image
I'm guessing it has something to do with an incorrect room template, but how can i see which one?
It seems like the generator thinks that there is a room template without any tiles. Unfortunately, the exception doesn’t contain the room template name, which I should fix in the future.
However, when you open a room template prefab, you should see a status panel in the top-left corner saying whether the room template is valid or not (if you don’t see the status panel, make sure there is the Room Template Settings component attached and that you allow gizmos from that component). If the room template is not valid, there should also be a red warning in the Room Template Settings component. So you should be able to find the wrong room template quite easily.
Let me know if you need any additional help!
Thank you, I did notice the "room is valid" on all my rooms.
Fortunately the error is gone now, no idea how :)
I had an idea, it would be kind of cool if you could have an array of level graphs in the dungeon generator, and have it randomly select one on generation.
Good!
It should be relatively easy to implement the random choice of level graphs if you use custom inputs as described here: https://ondrejnepozitek.github.io/Edgar-Unity/docs/generators/custom-input . But it’s also just a few minutes of coding for me, so I can make it for you if you want.
cool! I'm still very early in my project, so no rush for my sake.
I've been having a problem that the post process files link disappear from the dungeon generator from object time to time
Hey, I’m not sure about the disappearance of post-processing tasks - it has never happened to me. Make sure that you properly save the scene when you add the post-processing logic. Or it’s maybe possible that the instance of the scriptable object is not created properly.
Is there a function to save the scene, for example, when I switch to the challenge level, when I come back, it will still be the previous scene
(My English is bad, I don’t know if you can understand it)
Hello, I don’t think that it’s easily possible to save a scene during runtime (not just in Edgar but in Unity in general). So I think your best option is to just freeze the current level (stop enemy movement, etc.) and hide it, then show (or additively load) the challenge level and when it’s completed, destroy the challenge level and unfreeze/show the original level.
For example, if you had the whole level inside a single game object, you could probably just disable it for a while, show another game object with the challenge level, and then go back to the original level.
But I don’t have any personal experience with this.
Thanks, i think i know what to do
Hey, just discovered this superb level generator! Trying to make it work with 2d lights and shadow casters and have run into some problems where halls/doors are connecting to the rooms., as in the screenshot in this link image
The way I've done it right now is to add shadow casters to the wall object in the room templates (also other object in the room template when i needed more than one shadow caster). It's When the hallway templates connects to the door positions that the shadow intersect.
I can kind of get around it by only adding a few door positions, and make several shadow casters that do no overlap them, but that severely limits the amount and size of door positions that i can use.
Do you know of a way around this?
Hello, unfortunately, I have no experience with 2d lights and shadow casters in Unity. But maybe one thing that could help would be to not have these shadow casters attached to the Wall tilemap in individual room templates but rather have them attached to the shared tilemaps where all the room templates are merged into.
After a level is generated, I find all the tiles in individual room templates and combine them into a set of shared tilemap layers. That means that walls from all room templates are merged into a single large tilemap layer. What I propose is to not add shadow casters to walls in room templates but rather add them to the shared tilemaps where corridor connections are already processed. You can first try that manually: generated a level and then inspect the game object in the scene hierarchy, find the shared Walls tilemap layer and add the shadow casters.
I’m not sure how much experience with Edgar you have so feel free to ask additional questions. I may also try these shadow casters myself if you give me some additional instructions on how to do that.
Thanks for your quick reply. You mean in for instance add it to Generated Level>Rooms>Walls?
While that probably would work on an existing level, but since you have to define the shape of the shadow caster manually (at least from what I know), it would not work in practice.
I was thinking it might work if you could add it directly to a single tile, then when you fuse corridors with rooms you could remove the shadowcasters from the colliding room tiles. No idea how to add it so a single tile though.
If you could somehow generate a Shadow caster that has the same shape of a shared wall tilemap layer, would probably be the best way.
Shadow casters are otherwise fairly simple to use, it does requires a Universal Render Pipeline project. This short video should help, link
edit: This guy seems to be on to something! link
Will see if i can try this out later
Ok tried the Tilemaps Shadow Caster in the second link. Could not get it to work with the generated shared walls tilemap layer. Or it actually generated shadow casters but they didn't show up. I did have to do this in play mode, so not sure if that's the problem
It does kind of work if you put it on each of the wall object inside a room template, but the same problem as before occurs when intersecting with corridors. The auto generated shadows are also not perfect.
Is there a reason why the auto-generated shadows are not perfect? I thought that it would just use the polygon tilemap collider and compute the precise shape of the walls. Do you need something more than that?
yeah I was hoping it would do that too. It doesnt seem to be able to handle a merged wall object that well. Not sure though. It looks like this: link
Update: I found it's ok with manual mode..
Hey, thanks for reporting this, it looks like a bug. I’ll investigate it.
Hey, this should be now fixed in the hotfix release. Sorry for the inconvenience.
Thx,it helps a lot!
It's a great plugin, just bought a pro version.
I met a issue, My game use 2d renderer, On iOS and Android, when I put 2d light and 2d shadow caster in roomtemplate, and try generate a random map at run-time, the 2d light and shadow seems incorrect. But if I try use a pregenerated map or running in unity editor, everything working correctlly.
Any Idea?
Hey! There’s a “Material” field in the Post-process config in the generator component. Please make sure to assign the correct material there. It seems like Unity has sometimes problems with choosing the correct default material.
Oh! That did the trick! Thank you!
it would be nice if it was compatible with game maker studio 2
Hey! Unfortunately, there’s a quite large codebase already implemented for Unity so I think it’s not really possible to reimplement and maintain it for the Game maker studio 2.
It's a shame, I really liked the tool I wanted to have for the gm2, but that's okay, you did a great job
Hello,
First, thank you for your work, this asset is really amazing.
I am using this asset for a month now, I wanted to implement your Fog of war solution, but as I understood I can't use it with 2D lighting. So I tried and managed to do my own Fog (tile based) but its quality is not near as yours.
Do you think that your Fog solution will be possible to use with 2D lighting soon?
If not, is there any tips you could give me, so I can try to replicate what you did?
Also I am fairly new to unity so I am not sure if it is possible to use 3D lights in a 2D projet, and if it is I didn't manage to do it, that's why I wanted to stick with 2D lights. If it is possible and it is the simpler solution I am willing to change.
I hope you could understand what I meant, I am not an English speaker :/.
Again, many thanks for your work.
Hey! I’m glad you like the asset.
I’m not sure I understand what exactly are you trying to achieve. As far as I know, the fog can work with 2D lighting. Can you please provide some more details? Are you using the builtin render pipeline or LWRP/URP? Which Unity version do you use? Can you show me an illustration of what you want to achieve and what is the current behaviour?
Thank you for your answer !
I am using URP on Unity 2020.2.1f1
Maybe I miss understood something.
In order to use your FOW, I created a forward renderer, and then input the FOW rendering feature.
If I am not wrong using 2D lighting require a 2D renderer and this kind of renderer doesn't take as input a renderer feature, so I didn't manage to use your FOW with this renderer.
The FOW that you did in your tutorial is perfectly fine.
Here is a picture of what I managed to do :
Here is what I want :
Thanks for your clarification. The problem is that the 2D renderer doesn’t support scriptable render passes which are required for the Fog of War effect to work. You can see a forum thread regarding this issue here - https://forum.unity.com/threads/urp-2d-renderer-custom-feature.778946/. It was created in 2019 and only a month ago someone from Unity replied that “The work on this has officially started.” Even though I have no experience with the 2D renderer, I think that it should be easy to add support for the Fog of War effect once they release a version with custom render passes.
As far as I know, you should be able to use 3D lights in a 2D project without any big problems. From what I can tell, the 2D lights are better optimized for 2D games than 3D lights and they also come with some additional features. But there are people using Edgar with URP, the Forward Renderer and 3D lights and it seems like it works for them.
Also, I would not recommend you to replicate the FOW effect yourself. First, there’s that problem with not supported custom render passes. Second, I spent quite a lot of time on that and it requires you to know some internals of Edgar to do that properly.
Very well, I will try again to use 3D lighting in my project, hopefully I will make it work this time x).
Thank you for the informations and for your time.
Hello !
I investigated a bit on renderer features and I found this thread -https://github.com/InitialPrefabs/UGUIDOTS/issues/44
If I understood well, it is a way to add renderer features to a 2D renderer.
Do you think there is any chance I could make this work?
I think that it might work but I cannot be completely sure without trying that myself. Please let me know if it works for you. Should you have any problems, I might try it aswell.
I am getting so close to being able to port my existing game over to this amazing dungeon generator now.
One issue I am having.
the dungeon generator creats a Generated Level at runtime but all of the tilemaps are on the default Unity Layer. I am using A* pathfinding which needs everything on separate layers.
where can I make an edit to place the different tilemaps onto different layers?
many thanks
If you want to customize the output of the generator, the best way to do so is with a custom post-processing logic. You’ll have to implement the
Run
method which will be called after a level is generated. This method receives an instance of theGeneratedLevel
class on which you can call theGetSharedTilemaps()
method to get all the tilemaps from the level. When you have the tilemaps, you can find the ones that need a different layer and change that layer.Let me know if that helps.
level.GetSharedTilemaps().Find(x => x.name == "Walls").gameObject.layer = 17;
great.... thank you
thanks for a great level generator. I have started making my game with a very basic level generator and I really wanted to try out the EnterTheGungeon style generator. the basic examples are working fine but others I get a timeout error every time.
example1 works - example2 works - minimap example works - fogofwar example works - platformer3 works
gungeon does not work - platformer1 does not work
deadcell not sure as i have not set up the extra parts for it
Hey! Have you changed anything in the Gungeon example? Because I tried an unmodified version a moment ago and it worked without any problem.
I havent changed anything at all. I will delete the package and re-import it again.
well I have deleted the folder and re-imported . no change. the mini-map example works fine, including FOW but the gungeon example keeps giving timeout
Which version of Unity are you using?
Please try to do the following: Open the DungeonGeneratorTask file in Edgar\Runtime\Generators\DungeonGenerator\PipelineTasks and replace the following section starting at line 80:
Replace it with the following code:
There is currently a problem (which will be fixed in the next version) that the timeout error is sometimes displayed even if there is a different error in the underlying generator. After applying this change, please try to run the generator again and see if the error changed.
Also, a week ago someone reported quite a weird problem with the generator and it started working after he created a clean project and imported the asset there. I don’t know what Unity does behind the scenes but it seems like there’s sometimes a problem with some existing projects.
Please let me know if that helps. If the problem persists, I’ll try to look into that in more detail.
I am using Unity 2019.4.15f1
the new code gives me a new error.
rgumentException: No shape of the room Edgar.GraphBasedGenerator.Common.RoomNode`1[Edgar.Unity.RoomBase] could be connected to its neighbors. This usually happens if there are pairs of shapes that cannot be connected together in any way (either directly or via corridors). (The mentioned room may not correspond to the actual room as custom types are often mapped to integers to make the computation faster.)
Edgar.GraphBasedGenerator.Common.LayoutController`5[TLayout,TNode,TConfiguration,TShapeContainer,TEnergyData].AddNodeGreedily (TLayout layout, TNode node, System.Int32& iterationsCount) (at <52d877296fbf43209c7081a55723a5a2>:0)
Does this minimap require me to add layer first through customized room template
No, the minimap should work even without custom tilemap layers. However, you'll usually need to create a Unity layer for the minimap to work. The term "layer" is used multiple times in the Unity ecosystem so it might sometimes not be clear which "layer meaning" is used.
Hello! I bought PRO version. How works isometric colliders in example "Isometric1"?
" var colliders = CreateTilemapGameObject("Colliders", gameObject, 6, 0, !HideCollidersLayer);
AddCollider(colliders);"
There are not colliders in Editor in "Colliders". Can you help me with this problem?
Hey! As per documentation, there are no colliders in the Isometric 1 example, but it should be ready to add your own colliders. I haven't developed any isometric game myself, so basically, all my knowledge comes from this article. If you look at the "Adding Collisions" section, you can see that they're adding an additional tilemap layer that only describes the colliders in the level and you can hide it afterward. The code that you pasted only creates the collider tilemap layer and adds collider components to it - it does not add any tiles in that layer. That means, that after you generate a level, you'll see the Collider layer in "Generated Level -> Tilemaps" but you won't see any actual colliders there. What you can do is to go to individual room templates and populate the Colliders layer with tiles on places where you want the colliders to be. And after you generate a level, you'll see all the collider tiles from individual room templates merged together in the Colliders layer.
There seems to be one oversight from in the last version of the asset. The "Tilemap Layers Structure" in the Dungeon Generator should be set to "Custom" as there's a custom layers handler (from which you pasted the code). So if you set it to "Custom", you can open the "Tilemap Layers Handler" scriptable object in the folder with the example and there you can switch "Hide Colliders Layer". If you set it to false, the Colliders layer will automatically be hidden in generated levels.
Let me know if that helps or if you have any other questions!
Where is "Tilemap Layers Structure" ?
It's in the inspector of the Dungeon Generator component.
thank you
its strange, but i dont see in my editor
It seems like you're not using the latest version of the asset. In that case, you don't have to worry about that option.It seems like that change was not yet merged to the master branch. That means that you don't have to worry about that. I'm sorry about that. It's sometimes hard to keep track of which version of the asset I have currently loaded.
Hey! You can easily access the layer in a custom post-processing task. The "Run" method receives a "GeneratedLevel" object and on that, you can call the "GetSharedTilemaps()" method and it gives you only the shared tilemaps for the whole level. In this list of tilemaps, there's only a single one with the name "Walls" - the one that you're looking for.
Let me know if that helps.
Sorry if I was not clear enough. You want to do it like this:
I tried adding this to a post processing task but im getting this error, image.
I'm also trying to add a NavMeshModifier component, but where ever I try to add it (scripts/post process tasks) I get this error, image
In scripts I've created I can successfully use it if I add "using UnityEngine.AI;"
Fairly new to programming, so sorry if these questions are a bit n00bish :)
The first error is because of a missing namespace (“using System.Linq;” I think). I recommend using an IDE that can autofill namespace automatically. I’m using Visual Studio (which also has a free version available) but I think you may be able to achieve similar results vs Visual Studio Code.
The second error is probably also related to a missing namespace (or a package in your project?).
Room prefab walls have rigidbody, players and monsters have rigidbody and collider, but monsters will cross each other and walls, but players will not
Monsters and players are created in a room prefab with levels
Why did this happen? I wonder
Please check that your project is correctly set up to have collisions between objects in different layers. The generator does not alter the physics behaviour of Unity in any way.
I found another problem. After each room is generated, it seems that they are independent coordinate systems, which makes it difficult for me to ask the enemy to carry out some actions based on distance and position. Is there any way to unify their coordinate systems.
Looking forward to your reply
Can you please look into Transform.localPosition and Transform.position? It sounds like you're using gameObject.transform.localPosition instead of .position. If you always use .position, all coordinates should be in the world space and not in the space relative to the parent (e.g. a room).
I found the rooms generatored by the asset using the wrong collider2d component. please fix it.
Can you please tell me more about your issue? What is the expected behaviour and where is the problem?
hi, I bought your pro version four hours ago, I tested the Dead Cells and Platform demos, all room prefabs in these demos are using Composite Collider 2d component, but when I run these demos which are using Platform Effector 2d component in runtime instead.
so the character cannot collider with the platform correctly.
I cant find where to fix this problem. could you please fix it as soon as possible, and send it to me?
my English is really bad, hope you can understand what I mean! thanks.
Can you please verify that you did the following two things? (as described here)
"To run the example, you need to:
I cannot do these two things automatically from inside the asset so they must be done manually by people who want to run the Dead Cells example. If I remember correctly, the colliders didn't work for my until I enabled "Auto Sync Transforms".
It's correct that there are both composite colliders and platform effectors. Platform effectors are only enabled for the "Platforms" tilemap layer so that the player can jump through platforms but no through walls.
Please do the two steps above and let me know if it works. I tried the Dead Cells example on my computer and it did work properly.
I don't do the second step, it is working good right now. thanks.
Hello! looks very nice.
Before I purchase:
— Is it easy to implement a lock/door and key system?
— Can it generate in editor (without pressing play button)
Cheers!
Hey!
Generation in editor:
Yes, it's possible. The generator component has a button which you can click in editor to generate a level.
Locks and keys:
It depends on what you want to achieve. There is no explicit support for locks and keys, but the generator should give you access to everything you need to implement that. Doors are implemented in examples scenes Example 1 (you press a button to open a door) and Enter the Gungeon (doors are closed when you enter a room so you have to fight with enemies, and also one way doors that have to be opened from a specific side). Now it depends if your locks and keys should be static (lock positions are fixed for each level graph, different level graphs can have different lock positions) or dynamic/procedural (you want to randomize lock positions in individual level graphs). I'll assume static locks but the other approach should also be possible. For static locks, you can create a custom class to represent connections between individual rooms in a level graph. In that class, you can add an isLocked field to describe if the connection should be locked or not. If you plan to have different keys opening different locks, you can also add a key field that specifies which key opens the lock. After you generate a level, you can access this information and setup your locked doors game objects (for example in a custom post-processing task).
Let me know if you have any other questions!
Hello There Ondrej
Hope you are good.
In the meantime I have purchased your asset. Yet I still need to find the time to experiment with it. I just thought to support your work!
I do was wondering: is it possible to create rooms that may only spawn once? Unique rooms?
Best regards,
Peter
Hello and thanks for your support!
And yes, it’s possible to have unique rooms. There are basically two possible approaches:
Thanks! Sounds not too complicated!
Thanks for your explanation.
all the very best
Peter
why sometimes l cant use customize(manual mode) add door
Hey! Can you please provide some details? What exactly are you trying to achieve and what is preventing you from doing so?
i found out the problem, must choose rect tool to add door.
Now I have a new problem. When I'm building the dungeon, there will be a timeout. It's useless for me to modify the generation config about timeout.
There's always have this InvalidOperationException: Timeout was reached when generating level
If the timeout is reached everytime , that means that there's something wrong with your level description.
The most common issues are:
- You should provide both vertical and horizontal corridors. If you provide only one of them , the generator is often unable to produce a level. For example, you usually can't draw a cycle using only vertical corridors.
- Check that you always use the same length of doors. It seems like you're using manual doors so make sure that you stick to the same door lenght in all your room templates. For example, if you sometimes use lenght 1 and sometimes lenght 2, the generator may be unable to produce a level.
- Check that your level graph is not too complicated. You usually don't want to have too many cycles in the graph.
If you don't find the problem yourself, please do the following: There is an "Advanced" section in the Dungeon Generator component and there should be an "Export map description" button. Click the button and it should create a file called "exportedMapDescription.json" in the root folder of your project. Please send me this file - it contains information about the shapes of your rooms. You can send me that file at ondra@nepozitek.cz and I'll look into that.
Thanks for your help.
When I generated the level, my character and camera lost each other's transform, and my enemies couldn't read the player's tag. There were a lot of MissingReferenceException. When should I get monsters to get players, and cameras and players to get each other.
I'm sorry I have so many questions.
When a level is generated, all the room templates that are used in the level are instantiated and moved to the correct positions. If there were some missing references, it may be because you generated a level, then referenced something in the level, then generated the level again and all the references got lost. However, I'm not sure why should you lose a reference to your camera. If you don't create the camera at runtime, the reference should always be the same. Moreover, keep in mind that it takes some time to generate a level. That means that if you run some code in on of the Start()/Awake() methods, some game objects may not exist yet. For example, if your player game object is part of a room template, it'll be present in the scene only after a level is generated so if you try to find it by its tag before that, you won't find anything. The correct approach to that is to have the game object always present in the scene or make sure that you use it only after a level is generated (for example in a custom post-processing task as described in the docs).
Hey! It should be relatively simple. When you spawn enemies in a room, keep track of which enemies you spawned, for example in an array. Now in your room manager class, you want to have a method e.g. void OnEnemyDefeated(GameObject enemy) that will be called when an enemy is defeated. Inside the method, you will remove the enemy from the array of all enemies that were spawned in the room. And if there are no enemies left in the array, that means that there are no living enemies in the room, so you can open the doors. The last thing to handle is calling the method when an enemy is defeated. I presume that you have access to the health of each enemy so if the health of the enemy equals to 0, you call the OnEnemyDefeated method with the enemy that was defeated.
Let me know if you have any additional questions!
Hello, I do have a couple of more questions, is there anywhere I could direct message you? Thanks!
You can write me an email at ondra@nepozitek.cz or create an issue on github (https://github.com/OndrejNepozitek/Edgar-Unity/issues)
Hey ! This tool seems great, and I think of buying it when I get paid in a few days, but I have a question : how complicated is it to generate "3D" level (actually, 2d level with 3D tiles) with it ? Thank you !
Hey! Do you have an example of what would you like to achieve? The generator currently works with 2D tilemaps. You define room templates as 2d tilemaps, give it to the generator, the generator computes how to position individual rooms and then produces a level that is again composed of 2D tilemaps. I don't have much experience with 3D in Unity so I need you to help me imagine what it should do and I how would you want to use the tool.
Hey, sure. The best example is Enter The Gungeon : https://twitter.com/dodgerollgames/status/593625936131653632
Actually, the levels are generated in 3D. It help about depth, lightning, and not-having-to-do-pixel-math-to-check-if-this-bullet-hit-that-thing.
I am starting to create a roguelike based on it, among other games, and generating such a 3D world is a feature to me.
Basically, can I ouput a 3D model with its pivot point at z=0 instead of a 2D tile ? I can take care of the rest.
Thank you ! :)
I think that it's doable. There are two places you'd have to sligthly hack the generator. First, the generator need to compute the outline of each room template. To do that, it normally gets all the tilemap layers and computes the outline polygon. If you do not have any 2d tilemap, you can't rely on the default algorithm and have to do the computation yourself. There's currently a IRoomTemplateOutlineHandler interface with a GetRoomTemplateOutline() so, in theory, if you provide a component that implements this interface, you don't have to use any 2d tilemaps. The second place where additional work is needed is to handle the output of the generator. Normally, the generator does a lot of work behind the scenes in multiple post-processing steps. These steps include merging all room template into a single tilemap or disabling unnecessary colliders. The good thing is that these post-processing steps are completely optional and you can disable them all. So you'd have to disable them and then implement a custom post-processing logic. Each post-processing script is a given a mapping room -> (room template, position) and you're free to do anything with that. So you should be able to output your 3D models, it's just an additional work that you have to do yourself. So theoretically, there should be no MAJOR obstacle to achieve what you want. To be sure, I can check that there's no stupid code that for some reason expects that there are indeed 2d tilemaps used. If that were the case, it should be relatively easy to fix.
That'd be great !
Otherwise, once the level is generated, Can I have a way to know what tile was used in a specific position ? (x=1 y=3 for example)
That way, I could write a tool that use the output of Edgar to place the 3D model somewhat "on-top" of the generated 2D level.
All I'd have to do is provide a basic 2D tilemap, and depending on the level I want to generate, provide differents 3D prefab.
That way It'd be forward compatible ?
Edit : while rereading your answer, it seems we are on the same page. If I got it right, I only proposed to still use a 2D tilemap to let Edgar "do his thing", then output via a custom post-processing logic. Am I understanding it correctly ?
Yeah, that should be possible, too.
The generator doesn't use any special data structure to store the generated level. Everything is done with built-in Unity tilemaps (https://docs.unity3d.com/Manual/class-Tilemap.html). So if you get the instance of the Tilemap class, you can call the GetTile method to see which tile is used in a specific position.
Example usage:
1. Define room templates as usual using 2d tilemaps
2. Let the generator create a 2d level
3. Create a post-processing script that gets access to the output tilemaps of the generator
4. Go through individual tiles in the output tilemaps and spawn corresponding 3d tiles
5. Do some cleanup (hide original 2d level, etc.)
This approach would be very close to the normal approach, just enhanced with a custom post-processing logic. One theoretical problem with this approach is its performance. The generator will compute things that are meant for 2d levels and you would then discard them and replace them with a 3d level. You should definitely avoid doing one thing - recomputing 2d colliders for the output tilemaps (assuming that you don't want them). This is probably the most computationally demanding step. To avoid doing that, make sure that when creating room templates, you don't use any tilemap layer with colliders (https://ondrejnepozitek.github.io/Edgar-Unity/docs/basics/room-templates#designi...). Also, custom tilemap layers handlers might be useful (https://ondrejnepozitek.github.io/Edgar-Unity/docs/guides/room-template-customiz...).
This tool seems useful but I am wondering how to open the editor file in the folder. Is this Mac compatible because it says it cannot find any existing application to open it.
Hey! Can you please explain what do you mean by "the editor file"? This tool is a Unity package that you can import into your Unity project and do everything inside the Unity editor. None of the files should be used outside of Unity.
Maybe I'm just being stupid but when I open the folder there is a file titled Procedural Level Generator.Unity.Editor. That might not actually be the editor, I'm new to Unity.
It is not required to open any such file. You download the .unitypackage file, import that into a Unity project and after doing that, all the funcionality of the tool should be available in your project. The gui of this tool is compatible with the Unity editor. That means that you do not have to open any dedicated file to access the editor gui of this tool. I would suggest to read some Unity basics tutorial if you are new to Unity.
Thanks! I realized that I was trying to open the wrong file and found the right one.
Really amazing tool you've made, and the fact that it has a free version is pretty crazy, given the amount of work you've clearly put into this. Appreciate you a lot :)
Thanks for your kind words! Let me know if you need help or have any questions
Love the free version so much, it's honestly the best dungeon generator I've found and works REALLY well and to top it off the support you provide is amazing so I decided to support you through this. :) I hope more people find this. <3
Thank you!
Thank you for continuing to approval on this project. I bought it as soon as I saw the Isometric piece. I was using the free version. So since we are buying it now, we will continue to get updates ?
Yes, you will receive future updates.
Hi, thank you for your awesome project. If i buy it now, would i have a key on unity asset store in the futur ?
I'd be fine with giving you a key on the Unity asset store. Unfortunately, Unity allows me to give only a very limited number of keys and is probably generally not happy with giving keys to people that purchased the asset elsewhere. So I'd recommend waiting for the asset store release if you want to access the plugin from there.
I bought it, hope it support and if you need some help to implement some features don't hesitate
Thanks!
I'm one of your early adopters from Github. This is such an excellent tool. :)
The free version is working fine for me and does everything I want from a dungeon generator, but I bought this asset here only to support your awesome work. :)
Am excited to see what else you add to this, so am also reserving my seat for the full version :)
Thank you for continuously improving it :)
Thanks for your support!