Tests that passed for the wrong reason
With about 170 test entries and agents working in parallel, the worst failures were checks that said PASS while proving nothing. Each one got a rule, and five tests still flake under load.
Baking the 2 km map cut server memory from 276 MB to 136 MB, and making map size a menu option fixed the empty feel players reported.
We cut a 2 km city from 276 MB of server memory to 136 MB, and then players told us it felt empty. So map size became a menu option. A street game needs a street; ours began as one short hand-made road. This article follows the city as it grew, shrank, and got dressed.
The first map was the "hand street", a small test world. It was enough to prove movement, walls and survival stats. It started the server in 0.47 seconds and used 127 MB of memory.
Then came a generator, called citygen. It was seeded: the same number always gives the same city. At first it laid out straight roads and one pattern of building lots per district. Curves were marked as a large job.
Later the game seeds used a richer form: a river, 7 to 12 neighbourhood frames, bridges on the main roads and quays along the water. The seed travels to every client over the network before the city builds, so all players see the same map.
A generated city costs time every start. Citygen itself is quick, 0.35 seconds at 20 blocks and 0.55 seconds at 25. But we chose to "bake" maps anyway. A baked map is a city built ahead of time and saved to disk. Pre-generating maps lets the engine stream world chunks in the background and blend distant buildings with fog.
The first big bake went in five stages, and the team measured each one. Here is the 2 km result, with the server's memory use at each step:
| Stage | Map on disk | Server RSS (memory) |
|---|---|---|
| 1. bake at 1 km, load everything | 0.49 MB | 276 MB |
| 2. client chunks, far layer | 0.58 MB | 176 MB |
| 3. server areas, spawn by chunk | 0.58 MB | 128 MB |
| 4. grow to 2 km | 2.48 MB | 136 MB |
| 5. districts and textures | 3.53 MB | 136 MB |
The big drop came from loading the map in chunks instead of all at once. A 2 km map ended up using less server memory than the 1 km map had at stage 1.
Headless walking tests ran at 60 m/s edge to edge with no frame over 16.6 ms. We call that a floor, not a result: the 6.9 ms mean is the engine sleeping, and the test holds no rendering cost.
Not everything got better. Adding test bots caused physics update spikes to jump from 25 ms to 78 ms when entering new chunks. The likely cause is a burst of spawning when a chunk activates, but that is a guess. A 400 m teleport stalled the game for about 480 ms before the texture work and about 690 ms after. The report says it was "not fixed".
The texture work itself had a clean win. The 72 world textures had been stored lossless with no mipmaps. They are now compressed for the graphics card with mipmaps, and the export pack shrank from 483 MB to 423 MB.
The next change came from playing, not measuring. The designer found the 2 km map too big, and it felt empty. He asked for size as a menu choice instead of a fixed value.
The game now has four baked maps: small at 560 m, medium at 800 m (the menu default), large at 1 km and huge at 2 km. The chosen value crosses the network as the seed. One loose end: the old "huge" map is still the default for headless and command-line starts.
A map with the right size can still look dead. The lessons below are small, concrete fixes.
Memory. We found 77 uncompressed textures and an oversized reflection map consuming over 500 MB in a single indoor scene. The atlas is now 24 by 128 instead of 64 by 256. Centre-view texture memory dropped from 1892 to 1483 MB, and the kitchen scene from 2411 to 1576 MB. One thing did not shrink: about 1.3 GB of render buffers, which are the look itself (global illumination, ambient occlusion, reflections, anti-aliasing).
Benches on the road. Curved main roads cut through the grid, so benches ended up on asphalt. A check counted 48 benches in road rows. After citygen learned the distance to each road, it counted 0. Benches facing the road went from 17% to 97%. Lone bins, which should stand next to benches, went from 201 to 0.
Districts. There are four tiers: downtown, mid, poor and old. Each has its own building kit, materials and heights, and the lighting mood eases between them. Signs, stains and 7 neighbourhood murals share one texture atlas, with one mesh per chunk.
Warm spots. Players need fire in winter. We found that the baked maps had no warm places at all. They existed only on the hand street. A new pass placed braziers in alleys between poor buildings, and all 83 landed in alleys, as intended.
Two sky bugs show why we look at pictures.
First, a new cloud shader made every night draw an orange sun on the horizon. The day and night code sets sun energy to 0 at night, but the shader ignored the energy value. Sky shaders must scale by it.
Second, a street-level view of the new moon showed only a black building. The stars stopped at 50 degrees, so the moon had to be judged from a 90 m viewpoint high above the street.
A third lesson came from Godot itself. Godot only renders polygons whose corners wind clockwise, so backward-facing signs vanished into thin air. We learned it while building the sign and mural pass.
Several visual bugs remain: physics stalls during player teleports, overly dark asphalt patches, and signs that silhouette into pure black at dusk. That last one is marked as a taste call for the designer.
Comentarios
Aún no hay comentarios.
Iniciar sesión para comentar.