How to render TCastleScene between two layers of Tiledmap?

Oh, fantastic, thank you! This is exactly what I needed. This will allow to test on exactly what is relevant for your usecase.

I already added it to the repo, https://github.com/castle-engine/castle-engine/tree/master/examples/tiled/map_viewer_in_viewport/data/maps/walls_layers_isometric .

Let me know if I should name you differently in the AUTHORS file, https://github.com/castle-engine/castle-engine/blob/master/examples/tiled/map_viewer_in_viewport/data/maps/walls_layers_isometric/AUTHORS.md .

I saw that reading this map now fails for some layers. I turned the error into warning for now (“Warning: Tiled: Invalid frame id 19”), but this is still an error (at the very least, we should render it like Tiled does). So, that’s another TODO. (but probably easier to deal with, I’ll see later today.)

As for what is “correct” rendering: let me see what others do. At least Godot and Unity have own tile systems. We will want to match their capabilities. As for what is “correct”: well I can see you made different assumptions than Tiled, and you effectively require to render decorations (on higher layer) behind wall (on lower layer). Your way of working makes sense, but it just requires a feature that Tiled doesn’t have, “grouping” of layers for rendering. I will take a look what others support in this regard. I invented “Depth groups” in my previous post, I will want to look how is it called in others (and whether they support such thing).

The author’s name(wall and door arts) can be written as soastao, I am glad to provide test demo for CGE.

Now I drawing the map by myself, using TDrawableImage (inside overridden Render of TCastleUserInterface).I already draw a map.My understanding of CGE is limited, and it takes some time to explore this way.

The order of rendering is not just for maps, the rendering of 2D characters is also the same

Well known the animations in Diablo II are split into several parts. When you are equipping another helm, just the head of the animation change. Same for when you’re equipping another weapon, only the weapon part of the animation change. That’s because the Player is divided
into several parts.

These layers are ordered. When drawing an animation of a Player in a given direction, for a given frame, a table tells in what order to draw them. When the Player is facing West, you first see his Shield, and the rest of the body is behind.But when facing East, the Shield is now the one that is behind.


02
03

I simulated the painting method of Diablo character. The test results are shown in the screenshot. Most of my previous tests are based on ZenGL, and I will move to CGE in the future.