But I have a problem. Because I'm going isometric, it's now possible for a layering situation to occur like this:
/ / / <-- Back / / / / / / / / / <-- Front
This means that I can't accurately choose a layer for my sprites. (NOTE: The items above don't represent one object split over 4 tiles each, but an object slightly smaller than 2 tiles. Each will have different pixel offsets.)
Now, the sprites are going to be about 64x64 (the tiles will be 64x32 but I'm accounting for height), so it would be possible to give each a different layer, but this isn't necessarily the right solution, because the pixel offsets mean that overlaps can happen beyond the standard 32x32 tile boundary.
Basically this works out to a Z-buffering issue with flat sprites. They're representing objects that can be turned in different orientations, so an object whose center is behind another object's can still appear in front of it. This isn't so much of a problem when just two objects are involved, but as you can see from the figure above, when more than two get in on the act, it can be a big deal. (Actually the figure above is an easily resolved case, but that's beside the point.) Conceivably you could get a chain of objects going; it could even get into a worst-case circle.
Matters are worse when you consider the turf tiles underneath--or obstructions in front.
The only solution I can possibly think of is to give sprites layers that vary with the x coordinate of the icon, but that's kind of ridiculous--I think. It'd require a revamp of the BYOND drawing engine, which is something I wouldn't even suggest unless isometric were to become a much bigger deal in the future.
Does anyone have any thoughts or helpful suggestions on this?
Lummox JR
My apologies in advance, because I didn't understand a whole lot of your post -- but why is it ridiculous to have layers vary with the x coordinate (or for that matter, the y coordinate) of the icon? Couldn't you just do something like this:
mob/Move()
. = ..()
if(.)
layer = MOB_LAYER + (y / 100) + (x / 10000)
...or something like that. I think we actually do something along those lines with Living and Dead, but I don't know for sure -- I remember discussing it with Deadron at one point, but I don't know how he finally implemented it.