You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out that events that are on the same Y are rendered from right to left.
Additionally when Y + X are the same since 2k3E the Event ID decides what appears in front on the tile.
We use a single Z value for all the ordering and have now the problem that this will not really fit.
The Z-value is 32 bit and on the map is currently encoded like this:
LLLL LLLL ---- ---P DDDD DDDD DDDD DDDD
L = Highest bits are for the layer to ensure that drawables do not "leak" in other layers (e.g. the tilemap into the weather layer)
P = Bit set for pictures when they are on a layer with other things (only 2k3E)
D = Bits for free usage by drawables
For characters this is currently:
LLLL LLLL ---- ---P YYYY YYYY YYYY YYYY
Though to fix the rendering order we will need also storage for X and ID.
Highest X and Y (map map size of 500 * 16) is 8000. So this already needs 13 Bits for X + Y = 26 Bit.
So with some trickery this could be:
LLLL LLYY YYYY YYYY YYYX XXXX XXXX XXXX (Picture can be interleaved with L). Then this would fit but is not really future proof.
Better is maybe moving to 64 Bit (with a performance impact especially on the tilemap layers which goes through the entire map to figure out what is supposed to be drawn).
With 64 Bit we would have lots of space without trickery:
Turns out that events that are on the same Y are rendered from right to left.
Additionally when Y + X are the same since 2k3E the Event ID decides what appears in front on the tile.
We use a single Z value for all the ordering and have now the problem that this will not really fit.
The Z-value is 32 bit and on the map is currently encoded like this:
LLLL LLLL ---- ---P DDDD DDDD DDDD DDDD
For characters this is currently:
LLLL LLLL ---- ---P YYYY YYYY YYYY YYYY
Though to fix the rendering order we will need also storage for X and ID.
Highest X and Y (map map size of 500 * 16) is 8000. So this already needs 13 Bits for X + Y = 26 Bit.
So with some trickery this could be:
LLLL LLYY YYYY YYYY YYYX XXXX XXXX XXXX
(Picture can be interleaved with L). Then this would fit but is not really future proof.Better is maybe moving to 64 Bit (with a performance impact especially on the tilemap layers which goes through the entire map to figure out what is supposed to be drawn).
With 64 Bit we would have lots of space without trickery:
LLLL LLLL ---P ---- YYYY YYYY YYYY YYYY XXXX XXXX XXXX XXXX IIII IIII IIII IIII
So X, Y and ID can go up to 65536. So is enough for everything :).
The text was updated successfully, but these errors were encountered: