Me again, I've made similar threads like this (and hijacked others )before and since I have made a fair bit of changes to my old model, i decided not to necro one of the old threads..
Basically, I need help fixing the sprite Z order sorting in my ISO engine. I've tried so much stuff i can't even remember it all.
here's a link to the current version
http://www.mediafire.com/?xyjvkxvtmo2
As you can see, it's still not perfect. There seems to be some physics problem with disabling collisions while still trying to move but that's minor, the main problem is the Z sorting, once that's done i can start crankin out some content.
ALL i need to get it to work, is some formula (preferably in the format of the 'for each ordered' loop) that will make the affect objects behave thusly:
- If their Y coordinate (regardless of their height) is greater than another affected object, it will always be in front of it (i have this one solved of course)
- If the bottom height variable (distance from the ground) of one object is greater than the top height of another affected object, it will always be in front of it (currently cannot achieve this)
The current ineffective formula is this:
for each Layers (family) ordered by:
(Layers.Y + Layers.Value('ZHeightBottom')) + Layers.Value('ZHeightBottom')
= send to front
Ordering by the Layers.Y + Layers.Value('ZHeightBottom') solves my first problem and adds simple iso depth to the game. But it treats everything as though they are infinitely long 'poles' sticking out of the ground, sure you can go around it but you sure as hell can't sit on top of it.
The REAL hard part is getting the player (and anything else in the layers group) to sit on top of stuff without any errors.
Please help I know it's tricky to explain, just play the game and you'll catch my drift.
thanks