Celestar wrote:I agree with you about that performance issue, in fact most integer operations are fastest on word-sized stuff, however there's the problem of memory usage and especially bandwidth usage in multiplayer. Every time a new player joins the game, the entire map needs to be transmitted. Now what happens if they're playing via 56k? They'd be waiting like 30 minutes for the game to begin if we put anything in int32s.
We already link in a zlib compression library. If you compress stuff, the overhead of int32s is minimal if not negative. Most lossless compression algorithms work by replacing fixed-length structures like int16 or int32 by variable-length bitstrings, where the highest-frequency values get the shortest strings.
Remember, CPUs are high-bandwidth so it's better to use a few more bits and avoid costly shifting. WAN connections, even ADSL, are in comparison low-bandwidth. There it's better to use compressed formats. Packed-bit representations are an attempt at manual compression, identical for every tile whether it holds a house, rail or bridge. zlib uses variable-length strings and is thus more efficient, besides being automatic.