Load jump chunks over multiple server ticks#558
Conversation
0b58eae to
641788e
Compare
|
When forcing a chunk that isn't currently loaded, it doesn't load the chunk immediately, it just mark it to be persistent. It'll only load when you actually access it. As such, this change only slows down the sequencing, with no added benefits. What you seem to describe is more likely either: On other notes, I see you've changed the state_* methods so they all return values. That's a relatively impacting changes (many lines) that also duplicates the information already provided through properties of the object. So it seems only justified for your 2 modified methods. In such cases, instead of breaking all others, consider limiting to those 2 methods or, preferably, embrace the existing structure by adding a state check or non-persistent property. To move further, I suggest you capture the log when the issue happens, there's profiler measures and state progression logged in there that'll tell you exactly what step is taking too much time. |
Computing the possible jump distance and the collision checks read target world blocks, which loads or generates every chunk on the path synchronously inside a single tick. Jumping a large ship into an ungenerated area could freeze the server long enough to trip watchdogs. Add a PRELOAD_TARGET_CHUNKS sequencer state that loads or generates the target envelope at a configurable chunks_per_tick pace, and delay the jump distance check until the path is loaded. Chunk forcing tickets are unchanged: they only mark chunks persistent and were never the cost.
641788e to
5a437a0
Compare
|
Checked the Forge source and you're right, I've reworked it from scratch around your hypothesis 1, since that matches what I was actually seeing: The new version is much smaller:
Still owe you the log capture with the profiler numbers - I'll grab one from a jump into ungenerated space on the rebased build and post it here. |
Experimental motivation
Forcing every source and target chunk in one server tick can turn jump preparation into a watchdog-sized spike, especially when target terrain must generate.
Scope
G_CHUNKS_PER_TICKchunks per tick.getLoadedChunkbefore skylight work and removes the(0,0)anchor ticket.DeploySequencer; no navigation target or callback logic is included.Evidence and limitations
test NO-SOURCE).Manual testing pending
Same-world and cross-dimension jumps, large ships, delayed target generation, every abort path, deployment, and ticket-leak inspection.