Hi,
Nepster has shown me a level that breaks in D Lix, because the terrain rendering is subtly different than in C++ Lix. We now have to decide -- which version has the bug. :-) And what our strategy should be.
The problemFrame a) shows a terrain tile with odd dimensions, 57 x 57 pixels. There was an inconsistency in Allegro 4.x in how odd-dimensioned terrain was rotated. C++/A4 Lix built for Windows would rotate the terrain differently than C++/A4 Lix built for Linux.
To combat this inconsistency, I load the tile like frame b) in C++/A4 Lix: Odd dimensions are rounded up, padding at the right and bottom if necessary. The level format says where the top-left corner of each tile is, thus padding doesn't affect physics yet.
D/A5 Lix is written as if this bug/bugfix never existed, loads the tile like a), and rotates the tile like frame c).
C++/A4 Lix instead rotates the tile like d). Since the level format remembers the top-left corner of the rotated tile, the padding introduces a 1-pixel offset between the rotated tile c) and the rotated tile d).
ImpactThis offset was enough to break 6 of Nepster's 107 replays.
Nepster has sent me a level where the above wooden tile,
matt/earth/30, is aligned in a very precise way with the surroundings. The 1-pixel difference makes an intended walker's path impossible in D lix.
6 out of 107 is not that much. But it's enough for replay collectors to worry about this.
Solution strategiesLeave inconsistent: This doesn't require any work. We call it a bug in C++ Lix, don't fix it there, and continue to rotate like frame d). We hope that D/A5 Lix dosen't need a similar workaround, and continue to load the tiles as in frame c).
Port bug: I write code in D/A5 Lix to mimick the 1-pixel offset in C++/A4 Lix's handling of graphics and physics.
New level format: We could introduce a new level format that breaks C++/A4 Lix's forward compatibility with D/A5 levels.
geoo is considering tile-grouping instead of no-overwrite. I'm considering multiple skillsets per level, to enable handicapped games, asymmetric multiplayer maps, and different hatch numbers per player. All this would benefit highly from a better level format that allows grouping. I'd like to look into JSON or SDLang for this.
<LetsAvoidMaking="Another">Bloated</XMLformat>Unrelated improvementNo matter what we do, in D/A5, I want to infer the physics mask from the tile before rotating it, then rotate both graphics and mask. In C++/A4, I rotate the tile first with the graphics library, then check pixels of the rotated tile for solidness. This behavior as in C++/A4 has caused the inconsistency in the first place. I should have been carefully moving the graphics into place, keeping the physics simple and straightforward.
-- Simon