I am having some problems drawing my entities in an isometric map.
Tiles are drawn using Painter's algorithm to do the z-sorting which works great for the tiles alone. Entities are parented to a particular tile and have an offset within it. They are drawn immediately after their parent tile. The problem is that when the entity is too far right or too far down; the next tile(horizontally to the right, or vertically below) is drawn over parts of it like so:
(Note, currently my player has his registration point (red circle) a little higher than right at the bottom, just to better approximate the centre of his feet.)
A couple of ideas I had to try and remedy this:
1) To simply offset the position of entities to move them so that they will always draw in a place that won't be drawn over later. I really don't like to add in strange offsets that must be compensated for all over the place but this seems like a viable option.
2) To draw everything tiles and entities, using painter's algorithm. Entities would not need to be parented to a tile anymore but every renderable graphic would need it's drawing position offset. (Tiles would have their point at the very top, entities at the very bottom so that painter's orders things correctly)
3) Implement some kind of layering system so that all floors are drawn first, then things behind entities etc etc. This seems complex and would change from scenario to scenario. As my game will have randomly generated levels, I feel this isn't the right solution.
So, do any of the above have merit? Do I have it all completely wrong and there's another solution I've missed?