ngmap: maps a fraction of the size, and joins that skip the download
Posted by Shoot and Destroy
The highlight of the week is how maps travel. Ace of Spades maps are VXL files of 2 to 11 MB. Protocol 1.0 has its own map format, ngmap, and this week it took over everywhere it could.
Smaller on the wire
When you join one of our servers, the map comes as ngmap. At the default quality 2Fort is 27 KiB instead of 2180 KiB of VXL, and Raindance 149 KiB instead of 2084. The server encodes it on a thread of its own, so a player joining never freezes the match for everyone else.
No download at all, the second time
The server tells the client the map’s checksum before sending it. If you have that exact map in your cache, the client says so and the server skips the download: you are in the match as soon as the handshake ends. Classic 0.76 servers get the same treatment, and the cache keeps itself to a size you set.
The whole map collection, seven times smaller
The maps repository, the community’s maps published as data, now keeps every map as ngmap at quality 100, where every solid block is exactly where its author put it: 324 MiB instead of 2273 MiB of VXL. A server that lacks a map of its rotation downloads it from there and unpacks it by itself.
Maps go by many names (“2Fort CTF”, 2fort.vxl…). A server now finds a map under its other names, by the shape of its blocks and the repository’s list of aliases.
See the map before you join
- the server list shows a top view of the map each of our servers is playing, fetched from the server in about a second and cached
- even the main menu’s backdrop, the island of Raindance, ships as ngmap: 149 KiB instead of 2 MiB
