Finite world option with oceans at the edges #23

Closed
opened 2026-11-07 18:28:30 +00:00 by claude · 1 comment
Member

Add a world-size setting (small/medium/large, for example 2000/3200/4200 blocks wide) with an indestructible boundary. Ocean biomes sit at both edges, with sand slopes and water. The mapgen and spawn logic must respect the bounds. Infinite stays an option.

Add a world-size setting (small/medium/large, for example 2000/3200/4200 blocks wide) with an indestructible boundary. Ocean biomes sit at both edges, with sand slopes and water. The mapgen and spawn logic must respect the bounds. Infinite stays an option.
claude added this to the v0.3 World & Biomes milestone 2026-11-07 18:28:30 +00:00
claude added the
type
feature
area/worldgen
priority
medium
labels 2026-11-07 18:28:30 +00:00
eric added this to the Strata Roadmap project 2026-11-07 18:36:39 +00:00
eric closed this issue 2026-11-15 06:29:35 +00:00
Author
Member

Done in 487ff6e.

What changed

  • New setting strata_world_size: small, medium (default) or large (2000, 3200 or 4200 blocks wide, centred on spawn), or infinite. It's fixed when a world is created and kept in mod storage. Worlds made before this change stay infinite: they already have env_meta.txt, which a brand-new world doesn't have when mods load.
  • Past the edge, every plane cell at every depth is strata_core:world_edge, an invisible, walkable, undiggable wall. Reach is refused past it and creatures don't spawn there.
  • Ocean biome in the last 220 columns at each side. The land eases up to a sand beach 3 blocks above sea level, then the sea floor falls to y = −17, which keeps swimmers under the real sky. Water is generated only past the beach, where the floor never rises outwards, so the sea is held in and sits still.
  • mg.set_world_size, mg.in_world, mg.ocean_t and mg.ocean_biome are there for other systems. docs/DESIGN.md and the README are updated.

Decisions

  • Finite is the default for new worlds, as in Terraria. Infinite is one setting away. Eric, flip the default if you'd rather keep infinite.
  • Ocean isn't in mg.biome_list, because infinite worlds never have one. It's still mg.biomes.ocean.

Tests: 3 new cases in tests/world_size.lua:

  • the stored size;
  • the edge, beach and sea shape in every finite size (no stray or spilling water, a floor that deepens outwards, no trees);
  • a generated shore, checked cell by cell. Its sea stays full after being woken and ticked 40 times, and reach is refused past the edge.

The test world runs infinite and switches size at runtime. 106/106 pass, zero ERROR lines. A probe server confirmed that a new world gets medium and keeps it across restarts, and that an older world stays infinite.

Needs a look in the client: how the edge feels (you just stop walking) and how the beach slope looks. Possible follow-ups: ocean creatures (v0.4) and sky or fog at the edge so it reads as the end of the world.

Done in 487ff6e. **What changed** - New setting `strata_world_size`: small, **medium (default)** or large (2000, 3200 or 4200 blocks wide, centred on spawn), or infinite. It's fixed when a world is created and kept in mod storage. Worlds made before this change stay infinite: they already have `env_meta.txt`, which a brand-new world doesn't have when mods load. - Past the edge, every plane cell at every depth is `strata_core:world_edge`, an invisible, walkable, undiggable wall. Reach is refused past it and creatures don't spawn there. - Ocean biome in the last 220 columns at each side. The land eases up to a sand beach 3 blocks above sea level, then the sea floor falls to y = −17, which keeps swimmers under the real sky. Water is generated only past the beach, where the floor never rises outwards, so the sea is held in and sits still. - `mg.set_world_size`, `mg.in_world`, `mg.ocean_t` and `mg.ocean_biome` are there for other systems. `docs/DESIGN.md` and the README are updated. **Decisions** - Finite is the default for *new* worlds, as in Terraria. Infinite is one setting away. Eric, flip the default if you'd rather keep infinite. - Ocean isn't in `mg.biome_list`, because infinite worlds never have one. It's still `mg.biomes.ocean`. **Tests**: 3 new cases in `tests/world_size.lua`: - the stored size; - the edge, beach and sea shape in every finite size (no stray or spilling water, a floor that deepens outwards, no trees); - a generated shore, checked cell by cell. Its sea stays full after being woken and ticked 40 times, and reach is refused past the edge. The test world runs infinite and switches size at runtime. 106/106 pass, zero `ERROR` lines. A probe server confirmed that a new world gets medium and keeps it across restarts, and that an older world stays infinite. **Needs a look in the client**: how the edge feels (you just stop walking) and how the beach slope looks. Possible follow-ups: ocean creatures (v0.4) and sky or fog at the edge so it reads as the end of the world.
Sign in to join this conversation.