michael blunck wrote:
I don't quite follow this discussion, is this relevant to how I have coded the tunnels and if so how should I code them differently?
Yes and no.
You used action0A (simple sprite replacement) which doesn´t give you the possibilities a full-fledged action0/1/2/3 system for tunnels would have offered. But because ATM we don´t have such a system, you couldn´t have them coded differently.
If, OTOH, we had
such a system, not only the clipping problems would be far more less obvious, but everything mentioned in the posts before would be feasible (tunnel graphics depending on game-related variables).
Wrong, an Action321 support doesn't auto fix clipping errors - Bridges have as well clipping errors since TT and an Action321 will not magical fix sorting problems you have with all Structures and Sprites in TTD. * Sorting 2D Sprites without deep information isn't possible to sort correct in a 3D world...
Maybe I say it different, the top part of an tunnel you have replaced with an Action A should be the same pixel size as a sloped ground tile. The ground tile of the tunnel should be the same size as a the top tile sprite or smaller. This should avoid most clipping errors, as now sorting happens from bottom to top regardless on what part a train is on the tile...
Or try to simple load my base tunnels and enable/disable it to see if your own tunnel has more clipping errors then my base tunnels.
changed groundtile to the top tile sprite
Even with an Action321 system you still need to glue a lot
sprites for enhancetunnels together. The ground sprite, catenary pole for tunnel entrance, a tunnel top sprite, route sprite (this can be added to the tunnel top sprite with Action321 maybe) The catenary pole, the catenary helper sprite. The wire. Ohh, we didn't have yet some rolling stock. Add them as well...
Even if you get this all work, this won't fix issues that a big engine will be seen outside the tile sometimes.