sirbod wrote: ↑Thu Feb 29, 2024 8:26 am
That +9 has triggered something...is that the tile backoff value? ie the number of tiles it steps back from the ship position to start plotting the landscape?
Yes, that sounds like the same thing - I've called it the "landscape offset", but "backoff value" is a good name.
Specifically, LANDSCAPE_Z controls the distance along the z-axis that the landscape gets pushed away from the viewer, so it ends up looking like a three-dimensional diorama on a distant table under a reading lamp, rather than with the viewer standing "in" the landscape. It's effectively the z-coordinate of the back of the landscape, so it will have a pretty big value in BigLander.
The equation above is the same as:
Code: Select all
LANDSCAPE_Z = (TILES_Z + 9) * TILE_SIZE
= (TILES_Z - 1 + 10) * TILE_SIZE
= LANDSCAPE_Z_DEPTH + (10 * TILE_SIZE)
where LANDSCAPE_Z_DEPTH is the depth of the landscape itself - this is a bit clearer than my original formulation, so I think I'll update the source. With this version, I think it's a bit clearer that the landscape gets pushed 10 tiles away from the viewer as part of the "backing off" process, which is a distance we want to maintain with a larger landscape.
I'm still not quite sure why a tile size of 122 doesn't blow things up by making the value of LANDSCAPE_Z negative, but presumably the arithmetic still works up to a point, even with the overflow.
Mark