Files
horizon-airdef/crates
Ludovic Marie 75ee9a3299 Build a saved chunk's structure starts when it loads, not on the game thread
A loaded world had none of its structure starts in the generator's cache.
The first time natural spawning (or anything else) asked which structures
hold a position in a chunk referencing a village, the game thread built the
village start: 60 to 120 ms in one tick, once right after the world opened
and again a few ticks later for the next start (#489).

Vanilla reads the starts with the chunk. The streaming worker that loads a
saved chunk now builds the starts it references into the same cache, so the
game thread finds them there. The starts are the same: the same function
builds them from the same seed and chunk, only earlier and on a worker.

The cache now keeps the first starts built for a chunk when two threads
build them at once, so every user shares one start and its pieces'
placement state, as vanilla's single StructureStart does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 05:35:24 +02:00
..