[GH-ISSUE #5970] Configurable world generation: a world's TOML profile, compiled to vanilla 26.3 worldgen resources #1911

Open
opened 2026-11-02 15:50:33 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @laal75 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5970

Originally assigned to: @laal75 on GitHub.

🤖 Filed by laal75's AI agent (OpenCode, Qwen3.8 27B), not by laal75 personally.

The idea

A world's worldgen profile: a config/horizon-worldgen/ folder of human-readable TOML files that the game compiles, when the world opens, into vanilla 26.3 worldgen resources over the prepared bundles — exactly the entries a data pack's worldgen files give (the pipeline from #3477/#3478). The profile never touches the generation code itself: it restates the resources the existing decoders already accept, so a profiled world keeps vanilla's determinism, chunk borders, saves and multiplayer.

This is the friendly layer over the worldgen that is already fully data-driven: no new pipeline, no new code paths in generation, no invalid block states.

The profile

<world>/config/horizon-worldgen/        (per world; else <game folder>/config/horizon-worldgen/,
                                         beside server.properties on a dedicated server)
  general.toml      enabled, the overworld's build range (min_y / height / logical_height / has_skylight)
  terrain.toml      sea level, terrain shape (peaks / hills / plains)
  biomes.toml       biome weights and parameters
  caves.toml        cave carvers
  aquifers.toml     aquifer/lava-and-water distribution
  ores.toml         ore vein placements
  geology.toml      stone variants, disk, bedrock
  surface.toml      surface/temperature/vegetation rules
  vegetation.toml   trees, flowers, grass, kelp, …
  structures.toml   structure sets and spawn overrides
  presets/          named presets; general.toml's `preset = "amplified"` loads one

Requirements

  • Off by default. No folder, or enabled = false: the world generates exactly as vanilla does — the compile emits zero entries, so the loaders see nothing.
  • Vanilla unchanged. A vanilla preset is block-identical to unconfigured generation (harnessed against the vanilla oracle).
  • Deterministic. Same seed + same profile → same world, on every machine, in single player, on LAN and dedicated (the entries are plain resources; nothing new is random).
  • Save/reopen safe. A profiled world reopens as it was; the profile is data beside the world, not a code dependency.
  • Validated. Every value is checked against the bounds the game's decoders apply, with the file and key named: terrain.toml[sea_level]: 999 is out of range (0..=319). Unknown keys are refused; a missing key uses its default; an unread section is a warning, never a crash; an invalid profile never fails the world's open — the game logs it and generates with what it could read.
  • Presets. Ten, editable, no recompiling: vanilla, realistic, amplified, flat, mountainous, archipelago, continents, underground, extreme, flatlands.
  • Honest. A section this build cannot support yet loads as a warning and says so, rather than silently ignoring or faking it.

Architecture

New small crate horizon-worldgen-config: TOML schema + bounds (checked exactly as horizon_world::worldgen::overrides::LevelHeight and the vanilla dimension-type codec do) + the compile step (profile → bundle entries, restating the prepared bundles' resources). The game injects the compiled entries as the highest pack over the world's data packs in the existing WorldgenOverrides join; off/vanilla emits nothing. A CLI (horizon-worldgen-config validate | dump) checks and previews a profile without the game.

PR plan (small PRs, in order)

  1. PR1 — the crate: schema, bounds, the compile step, CLI, tests (built; ready to open).
  2. PR2 — client wiring: the profile joined as the highest pack in world open; the vanilla-profile parity harness (block-identical to unconfigured, against the oracle); terrain shape knobs; preset loading.
  3. PR3 — biomes + vegetation sections.
  4. PR4 — caves + aquifers sections.
  5. PR5 — ores + geology + surface sections.
  6. PR6 — structures section.
  7. PR7 — the ten presets, a profiled-world smoke harness, a generation-time perf gate (profiled ≤ vanilla × ~1.05).
  8. PR8 — docs + create-world UI (a profile picker on the create screen).
  9. Optional: a native-mod wrapper so a mod can ship a profile.

Status

PR1 is built in the working tree of the branch that will open it. Nothing here is merged; the crate is new and the game is untouched until PR2.

Originally created by @laal75 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5970 Originally assigned to: @laal75 on GitHub. > 🤖 Filed by laal75's AI agent (OpenCode, Qwen3.8 27B), not by laal75 personally. ## The idea A world's **worldgen profile**: a `config/horizon-worldgen/` folder of human-readable TOML files that the game compiles, when the world opens, into **vanilla 26.3 worldgen resources over the prepared bundles** — exactly the entries a data pack's worldgen files give (the pipeline from #3477/#3478). The profile never touches the generation code itself: it restates the resources the existing decoders already accept, so a profiled world keeps vanilla's determinism, chunk borders, saves and multiplayer. This is the friendly layer over the worldgen that is already fully data-driven: no new pipeline, no new code paths in generation, no invalid block states. ## The profile ``` <world>/config/horizon-worldgen/ (per world; else <game folder>/config/horizon-worldgen/, beside server.properties on a dedicated server) general.toml enabled, the overworld's build range (min_y / height / logical_height / has_skylight) terrain.toml sea level, terrain shape (peaks / hills / plains) biomes.toml biome weights and parameters caves.toml cave carvers aquifers.toml aquifer/lava-and-water distribution ores.toml ore vein placements geology.toml stone variants, disk, bedrock surface.toml surface/temperature/vegetation rules vegetation.toml trees, flowers, grass, kelp, … structures.toml structure sets and spawn overrides presets/ named presets; general.toml's `preset = "amplified"` loads one ``` ## Requirements - **Off by default.** No folder, or `enabled = false`: the world generates exactly as vanilla does — the compile emits **zero entries**, so the loaders see nothing. - **Vanilla unchanged.** A `vanilla` preset is block-identical to unconfigured generation (harnessed against the vanilla oracle). - **Deterministic.** Same seed + same profile → same world, on every machine, in single player, on LAN and dedicated (the entries are plain resources; nothing new is random). - **Save/reopen safe.** A profiled world reopens as it was; the profile is data beside the world, not a code dependency. - **Validated.** Every value is checked against the bounds the game's decoders apply, with the **file and key named**: `terrain.toml[sea_level]: 999 is out of range (0..=319)`. Unknown keys are refused; a missing key uses its default; an unread section is a warning, never a crash; an invalid profile never fails the world's open — the game logs it and generates with what it could read. - **Presets.** Ten, editable, no recompiling: vanilla, realistic, amplified, flat, mountainous, archipelago, continents, underground, extreme, flatlands. - **Honest.** A section this build cannot support yet loads as a warning and says so, rather than silently ignoring or faking it. ## Architecture New small crate `horizon-worldgen-config`: TOML schema + bounds (checked exactly as `horizon_world::worldgen::overrides::LevelHeight` and the vanilla dimension-type codec do) + the compile step (profile → bundle entries, restating the prepared bundles' resources). The game injects the compiled entries as the **highest pack** over the world's data packs in the existing `WorldgenOverrides` join; off/vanilla emits nothing. A CLI (`horizon-worldgen-config validate | dump`) checks and previews a profile without the game. ## PR plan (small PRs, in order) 1. **PR1 — the crate**: schema, bounds, the compile step, CLI, tests *(built; ready to open)*. 2. **PR2 — client wiring**: the profile joined as the highest pack in world open; the **vanilla-profile parity harness** (block-identical to unconfigured, against the oracle); terrain shape knobs; preset loading. 3. **PR3 — biomes + vegetation** sections. 4. **PR4 — caves + aquifers** sections. 5. **PR5 — ores + geology + surface** sections. 6. **PR6 — structures** section. 7. **PR7 — the ten presets**, a profiled-world smoke harness, a generation-time perf gate (profiled ≤ vanilla × ~1.05). 8. **PR8 — docs + create-world UI** (a profile picker on the create screen). 9. Optional: a native-mod wrapper so a mod can ship a profile. ## Status PR1 is built in the working tree of the branch that will open it. Nothing here is merged; the crate is new and the game is untouched until PR2.
Author
Owner

@laal75 commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6558786620 --> @laal75 commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
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#1911
No description provided.