[PR #2608] [MERGED] Dedicated server: nothing kept around the spawn while nobody is on #4469

Closed
opened 2026-11-03 04:17:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2608
Author: @FusselTV
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: fix/idle-spawn-area


📝 Commits (1)

  • 8401cde Dedicated server: nothing kept around the spawn while nobody is on

📊 Changes

3 files changed (+109 additions, -23 deletions)

View changed files

📝 crates/horizon-client/src/game/dedicated.rs (+53 -19)
📝 crates/horizon-client/src/game/initial_spawn.rs (+11 -1)
📝 crates/horizon-client/src/streaming.rs (+45 -3)

📄 Description

🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally.

What and why

While nobody is online, Horizon's dedicated server behaved as if a player stood at the world spawn:

  • at startup, settle_spawn streamed a view-distance area around spawn and placed a stand-in player (find_player_spawn) before throwing it away;
  • afterwards update_dedicated_streaming kept that area loaded, generated and ticked for as long as the server ran empty.

Vanilla 26.3 does neither. MinecraftServer.setInitialSpawn only loads the chunks its spawn spiral tests (getChunk(FULL): each one's 3x3 is decorated in one generation task, x-outer then z-inner), there is no spawn ticket in TicketType, and a player's spawn is found when a player joins.

This matters for servers that pre-generate worlds:

  • the startup area was decorated in player-ticket order before any /forceload batch, so near spawn ore and stone blobs overlapped differently from vanilla's world, and a mineshaft start saved before its corridors were decorated kept a stale hps flag (seed 8675309: about 4,100 stone blocks and one mineshaft start near spawn, where a second vanilla run agrees with the first);
  • an idle server kept a view-distance area loaded and ticking.

What changes (dedicated server only; single player and the integrated server keep today's behaviour):

  • streaming.radius < 0 means no area around the centre. The forced chunks, /pregen bands and extra areas are unchanged.
  • settle_spawn only finds the world spawn. Each tested chunk is loaded as an extra area of radius -1 (finished alone, its 3x3 decorated in one task's order: new Streaming::rank_full_task), then the area is dropped.
  • With no guest online, update_dedicated_streaming sets the radius to -1; with a guest, the guest's view distance as before.

Vanilla reference

  • MinecraftServer.setInitialSpawn, PlayerSpawnFinder.getSpawnPosInChunk (11 × 11 spiral, first valid chunk).
  • ServerChunkCache.getChunkFutureMainThread (an UNKNOWN ticket at FULL), ChunkPyramid (FULL → LIGHT → FEATURES of the 3x3 → TERRAIN of the 5x5), ChunkGenerationTask.scheduleLayer.
  • TicketType (no spawn ticket), MinecraftServer.prepareLevels.

Tests

  • New unit test streaming::tests::no_area_around_an_idle_servers_centre.

  • tools/test_world_spawn_parity.py: 60 of 60 seeds spawn where vanilla does.

  • tools/test_dedicated_server_parity.py: 601 transcript lines identical.

  • End to end: seed 8675309, 1,024 × 1,024 blocks, pre-generated with /forceload batches with all other open fixes, compared with vanilla 26.3:

    Before After A second vanilla run
    Blocks that differ only in Horizon 74,694 55,909 83,859
    Andesite, diorite, granite in the spawn quarter (-x, +z) 4,133 1,049 2,519
    Mineshaft start at chunk -1, 4 (hps) differs equal equal

    The structure starts that still differ are all in chunks at the edge of the area.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on 7c4fd75033f4, against upstream/main at cb43e3278, 5 min 40 s)

Check Result
Scope ✅ 3 files, +104 −23
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 320 passed (25 s)
rustfmt ✅ (7 s)
clippy ✅ (54 s)
tests: horizon-client ✅ 1337 passed (3 min 44 s)
doc tests ✅ 0 passed (28 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 332 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 320 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2608 **Author:** [@FusselTV](https://github.com/FusselTV) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/idle-spawn-area` --- ### 📝 Commits (1) - [`8401cde`](https://github.com/horizon-rust/horizon/commit/8401cde519a951356e0f84421d7b5f64b431f50b) Dedicated server: nothing kept around the spawn while nobody is on ### 📊 Changes **3 files changed** (+109 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dedicated.rs` (+53 -19) 📝 `crates/horizon-client/src/game/initial_spawn.rs` (+11 -1) 📝 `crates/horizon-client/src/streaming.rs` (+45 -3) </details> ### 📄 Description > 🤖 Opened by FusselTV's AI agent (Claude Code, Opus 5.5), not by FusselTV personally. ## What and why While nobody is online, Horizon's dedicated server behaved as if a player stood at the world spawn: - at startup, `settle_spawn` streamed a view-distance area around spawn and placed a stand-in player (`find_player_spawn`) before throwing it away; - afterwards `update_dedicated_streaming` kept that area loaded, generated and ticked for as long as the server ran empty. Vanilla 26.3 does neither. `MinecraftServer.setInitialSpawn` only loads the chunks its spawn spiral tests (`getChunk(FULL)`: each one's 3x3 is decorated in one generation task, x-outer then z-inner), there is no spawn ticket in `TicketType`, and a player's spawn is found when a player joins. This matters for servers that pre-generate worlds: - the startup area was decorated in player-ticket order before any `/forceload` batch, so near spawn ore and stone blobs overlapped differently from vanilla's world, and a mineshaft start saved before its corridors were decorated kept a stale `hps` flag (seed 8675309: about 4,100 stone blocks and one mineshaft start near spawn, where a second vanilla run agrees with the first); - an idle server kept a view-distance area loaded and ticking. What changes (dedicated server only; single player and the integrated server keep today's behaviour): - `streaming.radius < 0` means no area around the centre. The forced chunks, `/pregen` bands and extra areas are unchanged. - `settle_spawn` only finds the world spawn. Each tested chunk is loaded as an extra area of radius -1 (finished alone, its 3x3 decorated in one task's order: new `Streaming::rank_full_task`), then the area is dropped. - With no guest online, `update_dedicated_streaming` sets the radius to -1; with a guest, the guest's view distance as before. ## Vanilla reference - `MinecraftServer.setInitialSpawn`, `PlayerSpawnFinder.getSpawnPosInChunk` (11 × 11 spiral, first valid chunk). - `ServerChunkCache.getChunkFutureMainThread` (an `UNKNOWN` ticket at FULL), `ChunkPyramid` (FULL → LIGHT → FEATURES of the 3x3 → TERRAIN of the 5x5), `ChunkGenerationTask.scheduleLayer`. - `TicketType` (no spawn ticket), `MinecraftServer.prepareLevels`. ## Tests - New unit test `streaming::tests::no_area_around_an_idle_servers_centre`. - `tools/test_world_spawn_parity.py`: 60 of 60 seeds spawn where vanilla does. - `tools/test_dedicated_server_parity.py`: 601 transcript lines identical. - End to end: seed 8675309, 1,024 × 1,024 blocks, pre-generated with `/forceload` batches with all other open fixes, compared with vanilla 26.3: | | Before | After | A second vanilla run | |---|---|---|---| | Blocks that differ only in Horizon | 74,694 | 55,909 | 83,859 | | Andesite, diorite, granite in the spawn quarter (-x, +z) | 4,133 | 1,049 | 2,519 | | Mineshaft start at chunk -1, 4 (`hps`) | differs | equal | equal | The structure starts that still differ are all in chunks at the edge of the area. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on 7c4fd75033f4, against upstream/main at cb43e3278, 5 min 40 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +104 −23 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 320 passed (25 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (54 s) | | tests: horizon-client | ✅ 1337 passed (3 min 44 s) | | doc tests | ✅ 0 passed (28 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 332 affected, to run in CI (--quick): arrow, attribute_map_queries, auto_jump, biome_source_codec, biome_temperature, biome_weather, biome_zoom, block_blob, block_collision_scan, block_column, block_entity_anim, block_entity_render and 320 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:17:22 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4469
No description provided.