Maps 1024 blocks wide, and the map in memory down to an eighth
Posted by Shoot and Destroy
The map was the biggest thing in the server’s memory, and the one part of a match it cannot do without. This week it moved to the library the client already uses: a bit for each solid cell, and a colour only for the cells that touch the air, where the old representation kept four bytes for every cell, air and buried ground included.
| The map | Before | Now |
|---|---|---|
| Raindance (512 x 512) | 63-64 MiB | 6.5-8.8 MiB |
| A 1024 x 1024 map | 256 MiB | 29-34 MiB |
| “Is this cell solid?” on a 1024 map | 12.2 ns | 3.6 ns |
The whole server with 127 bots peaks at 33 MB on Raindance and 88 MB on a 1024 x 1024 map, and every mode plays exactly as it did: the same kills, the same captures, the same blocks.
New
- maps of 1024 x 1024 blocks, on the client and on the server: the size comes from the map itself, and the chunk grid (4096 chunks), the large map, the small map and the view distance all follow it. The 0.75 profile still plays 512 only, because the classic wire carries no size
- nothings’ public domain generators build maps at any size: caves, forest rivers, fortresses, rainbow towers, skybridges and slopes at 1024 blocks a side, with their spawn areas
- a join no longer encodes the map: the server loads the ngmap beside the map (or encodes it once and keeps it), plays that very map, and sends it as it is with the cells changed since the load on top. A client that already has the map receives 0 bytes, and a 1024 join costs no CPU (it took 1.1 s before)
- the map’s top view in the server list, and a map found under any of its names (2fort is 2Fort_CTF)
- the retail class profile of the first Steam Ace of Spades: walk 5.6 blocks/s, a sprint per class, health 100/70/70/85, each body’s head shot multiplier, the wallet of blocks, falls measured by the distance flown, melee by the spade
- the retail jump pack: a 28 blocks/s climb, a 1.333 s tank, a 10 s refill that runs in the air too and waits 2 s after a hit
- zombies play at night: the survivors hunt with their flashlights, and the zombies see the dark as day
- supply crates fall when the ground under them is dug out or shot away
- Babel’s bots split into a stair crew, wall builders and hunters, and the wall goes up on the enemy’s side of the staircase
- the classic modes’ rifle, SMG and shotgun from the TF2 Beta Weapons pack, with their sights and sounds
- the server list fills a wide window, a phone’s menus are readable, and the large map pinches and drags with two fingers
- the iPhone draws at the screen’s pixels, so the text is sharp
- the browser tells you when a new version is deployed, and reloads into it
Fixed
- a grenade no longer goes off in your hand: the suicides in the kill feed
- the shot that empties a clip does damage (one rifle shot in ten did nothing)
- a shot on a spawn-protected body shows its own hit marker instead of reading as lost
- an arena round’s start no longer leaves you unable to damage anyone
- the menu’s world comes back when you leave a match, instead of an empty sky
- the language you picked stays picked
- bodies wear their team’s colour again
- bots build the wall in front of them and hold behind it, instead of beside it in the open
- a 0.75 join to a map with a column of nothing in it no longer kills the server
- no map of the maps repository takes the server down: 103 runs in every mode, all the way through
