OndrejNepozitek / Edgar-Unity

Unity Procedural Level Generator
https://ondrejnepozitek.github.io/Edgar-Unity/docs/introduction
MIT License
817 stars 70 forks source link

Custom Tags and Layers for Tilemap #77

Closed hhungria closed 3 years ago

hhungria commented 4 years ago

Hello, first I want to tell you that I am using the Pro-Version of your asset and I really find it very interesting.

I have only had 1 problem and it is the following; There is no way to use my own tags for tilemaps.

When the map is generated, the tags that I have put to the customs rooms tile elements are not generated.

OndrejNepozitek commented 4 years ago

Hey! By default, after a level is generated, new tilemaps (so-called shared tilemaps) are created and all the rooms are copied to these new tilemaps. That's the reason why if you put custom tags onto your room template tilemaps, they are not present on the generated levels.

There are basically two ways to fix that:

  1. You can create a custom tilemaps layers handler (docs) which lets you customize everything regarding the tilemaps in your room templates and generated levels. You can change which tilemap layers you want, whether they should have colliders, etc.
  2. You can create a custom post-processing task (docs) and there you can call level.GetSharedTilemaps() and correct manually all the tags

The second option is more like a hotfix but may be a little bit easier to do.

For the future versions of the asset, I plan to implement some auto-inference rules that would try to guess the correct settings of tilemaps and apply that to the result without needing to implement anything yourself. The only problem is that there's nothing to enforce the user to use the same setting across all the room templates. For example, if you forget to set the custom tag on one room template, I cannot know whether it's a mistake and I should ignore it or if it's by design and I cannot infer anything because it's not clear how to do that.

Let me know if you have any other questions or problems!

OndrejNepozitek commented 3 years ago

Closing due to inactivity. Feel free to reopen if needed.