Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
ground tiles not aligned with buildings/units #2807
For a tile to be drawn on the correct position, the bottom of the tile should be at the bottom of the image, and the center of the tile should be at the image bottom - image width/4.
The problem with this is that the buildings are not aligned to this (including trees). If a building is placed in the grass it is will be slightly misaligned with the grass tiles. If this would be corrected, then the buildings would be misaligned on the beach.
Also, the effect that it is supposed to give is not really noticable when playing the game. The only thing you see is that the beach looks smaller when looking from the side of the island than when looking from the sea, but it does not give the impression that the island is higher than the sea
To fix the alignment issues I think it would be best to change the sprites so they don't simulate elevation. If elevation would be simulated this is better done elsewhere.
The code in PR #2804 does not do this correction, and therefore building-gound alignment is somewhat incorrect on the grass.
I think I would prefer dropping this simulated elevation.
If we do want to go with elevation, I think it it possible to set a z position for buildings/units, so it could be fixed in a clean way. The main problem would be that the transitions/slopes will still look weird.
By the way, the biggest problem with simulating elevation in code is the transitions (slopes).