It was for that kind of situation (already mentioned in another post so Iām not surprised by the answer)
I think Iāll just add a custom property (ex: game object āIDā) to some tiles and spawn game objects over them to manage the z-order with the characters.
(but the feature mentioned above may still be interesting in the future )
@Mathias_Westerdahl
It was my first move, but my map will be much bigger and probably ādynamicallyā generated (not sure about how to implement thatā¦ Iāll create a dedicated topic ), with the same objects, displayed many times:
Example of a ādungeonā built by the player (vertical growth always based on the same type of āroomsā):
I would need many, many layers to do what I have in mindā¦ wouldnāt I?
So I thought that it would be way easier to spawn game objects over the tiles in question (with the exact same sprite so players wonāt make the difference), and then just make sure theyāre always over the characters.
If the player is always behind the tops of the pillars, then you just need one extra layer.
If the player can be in front of or behind them at different times, then you need game objects with some sort of dynamic Y-sorting.
I think thereās a couple threads about dynamic level generation. Itās as simple or as complex as you want it to be. Any tutorials for tile-based dungeons you find for other engines should also apply to Defold. You can change tilemaps dynamically however you want, you justā¦tilemap.set_tile(). The only weird part with Defold is that you have to pre-set some tiles in the corners since it pre-allocates the bounds of the tilemap.
Yeah that was my concernā¦ I may have some characters that will be big enough to be displayed behind AND in front of the ātop piecesā mentioned above, but I can still change my mind.
If it appears to create a huge constraint (for a small benefit), Iāll give up the idea.
I suppose it doesnāt mean that I wonāt be able to create āinfiniteā tilemaps? (even if the bounds are pre-allocated, I can dynamically increase the tilemap āinside the boundsā?)
I created a topic to shortly describe my use case, do you think you could take a quick look at it?
For now, my problem is more about how to create āsub-tilemapā (??) templates? (not even sure of what Iām talking about)
Anyway thanks of your answer, Iāll take a deeper look at everything available here and there about dungeon generation.
It doesnāt make much sense to create a tilemap of infinite size. I would suggest that you use a number of smaller tilemaps as the segments/chunks of the map nearest the player and update those as the player moves around on the map. I have an example similar to this here: https://github.com/britzl/publicexamples/tree/master/examples/infinite_map