How is it possible to depth sort tiles and objects in an isometric environments without any limitations? I've been researching this for a while now and there seems to be no publicly available answers to this question.
There are two obvious options for depth-sorting when doing isometric environments:
- Draw all tiles from screen top to screen bottom, followed by all objects from screen top to screen bottom
- Draw each tile and then each object on that tile from screen top to screen bottom
The limitations with number 1 is that tiles cant have different heights because objects will always appear on top of the tiles. Screenshot example: screenshot
The limitations with number 2 is that objects can't move between tiles on the x-axis without the tile below overlapping it (because it's drawn later). I've grabbed a screenshot to exemplify this: screenshot
I've read lots on bubble sorting and other algorithms, but none of them seem to take this into account, or if they do, they don't document how.
(Please not before answering, this is NOT about how to sort objects that are larger than 1 tile, I'm more than happy with slicing them up so they fit into a tile)