In typical jRPG, 2D view like Zelda, you have a lot of sprites of trees, shrubs, decals, etc that are quite static.
But then you have the player, monsters, etc that move around and so you have to constantly update their position and determine which sprites go on top or below. ie. When the player is "behind" a tree, it should have the tree sprite on top.
I know the basic approach that is to compare them on the Y axis, but my concern is if the map is huge, and there's a LOT of objects to compare to, it would be quite CPU intensive and so on mobiles, performance would suffer.
Is there a more efficient approach?