Skip to content

feat: add cold coastal biome variants#642

Merged
github-actions[bot] merged 3 commits into
devfrom
feature/issue-628-cold-coastal-biomes
May 2, 2026
Merged

feat: add cold coastal biome variants#642
github-actions[bot] merged 3 commits into
devfrom
feature/issue-628-cold-coastal-biomes

Conversation

@MichaelFisher1997
Copy link
Copy Markdown
Collaborator

Summary

  • Adds Frozen Ocean, Cold Ocean, Stony Shore, Snowy Beach, and Frozen River to the data-driven biome registry and biome ID set.
  • Wires selection, river override behavior, transition rules, LOD/minimap colors, surface/material handling, and cold-ocean aquatic decorations.
  • Adds targeted registry, selector, and frozen surface placement tests.

Verification

  • nix develop --command zig fmt src/ modules/
  • nix develop --command zig build test
  • nix develop --command zig build -Doptimize=ReleaseFast

Runtime Sanity

  • nix develop --command zig build run -Dskip-present -Dauto-world=normal -Dstartup-diagnostic-seconds=5 timed out after 60s while only showing shader compilation output.
  • nix develop --command zig build run -Dskip-present -Dsmoke-test timed out after 60s while only showing shader compilation output.

Closes #628.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📋 Summary

Linked Issues: Closes #628

Issue Verification: The PR fully implements the requirements of #628 by adding Frozen Ocean, Cold Ocean, Stony Shore, Snowy Beach, and Frozen River biomes with complete registry entries, selector logic, transition rules, surface handling, decorations, and unit tests.

This PR adds five cold coastal biome variants to the data-driven biome system. It wires them through the registry, selectors, edge detector, surface builder, overworld generator, and decoration registry. It also adds targeted unit tests for registry identity, selector behavior, and frozen surface placement. The changes are additive, well-scoped, and follow existing codebase patterns. Overall quality is good, with one critical runtime safety issue in the LOD module.

🔴 Critical Issues (Must Fix - Blocks Merge)

[CRITICAL] modules/world-lod/src/biome_color_provider.zig:4 - Missing new biome variants in LOD color switch
Confidence: High
Description: The getBiomeColor function in the world-lod module has a non-exhaustive switch on BiomeId with no else clause. It is missing cases for the five new biomes: .frozen_ocean, .cold_ocean, .stony_shore, .snowy_beach, and .frozen_river. The lod_mesh.zig file calls this function when rendering distant terrain. When the LOD system encounters chunks with any of these new biomes, the switch will hit an unhandled case, triggering a safety-checked panic (Debug/ReleaseSafe) or undefined behavior (ReleaseFast).
Impact: Runtime crash or UB when frozen coastal biomes generate within LOD render distance.
Suggested Fix: Add the missing cases to modules/world-lod/src/biome_color_provider.zig:

.frozen_ocean => 0x9FCBE0,
.cold_ocean => 0x295C99,
.stony_shore => 0x7A7D78,
.snowy_beach => 0xE5EEF2,
.frozen_river => 0xA8D2E8,

⚠️ High Priority Issues (Should Fix)

None identified.

💡 Medium Priority Issues (Nice to Fix)

None identified.

ℹ️ Low Priority Suggestions (Optional)

[LOW] modules/world-core/src/block.zig:52 - Legacy surface block inconsistent for snowy beach
Confidence: Medium
Description: The legacy Biome.getSurfaceBlock() returns .sand for .snowy_beach, but the biome registry defines its surface as .snow_block. While the actual surface placement is handled by SurfaceBuilder and OverworldGenerator (which are correct), this legacy inconsistency could confuse future maintenance.
Impact: Low - legacy function, actual generators override this.
Suggested Fix: Change .beach, .snowy_beach => .sand to .snowy_beach => .snow_block in block.zig:52.

[LOW] modules/world-worldgen/src/biome_registry.zig:227 - Frozen river biome point continentalness mismatch
Confidence: Low
Description: The frozen_river BiomePoint has min_continental = 0.42, but its BiomeDefinition specifies continentalness = .{ .min = -1.0, .max = -0.5 } to prevent natural selection. The same pattern exists for .river, so this is pre-existing behavior, but it means the Voronoi point does not match the definition's intent.
Impact: Low - the score-based selector respects the definition, and river override takes priority.
Suggested Fix: Align the biome point with the definition by setting max_continental = -0.5 in the BiomePoint, or add a clarifying comment.

📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 8/10 Each file handles one aspect (registry, selector, surface, LOD); changes are well-scoped.
Open/Closed 9/10 New biomes plug into the data-driven registry without modifying core selection algorithms.
Liskov Substitution 9/10 New biomes follow the same structural patterns as existing ones; no behavior breakage.
Interface Segregation 8/10 Existing RHI/world interfaces unchanged; biome system uses focused abstractions.
Dependency Inversion 8/10 Selection depends on registry definitions, not hardcoded logic.
Average 8.4

🎯 Final Assessment

Overall Confidence Score: 75%

How to interpret: Minor concerns, mostly ready with some fixes.

Confidence Breakdown:

  • Code Quality: 85% (clean, idiomatic Zig; follows existing patterns)
  • Completeness: 80% (all major systems wired except LOD colors)
  • Risk Level: 40% (additive changes; low regression risk)
  • Test Coverage: 75% (good unit tests for registry, selector, surface builder)

Merge Readiness:

  • All critical issues resolved
  • SOLID average score >= 6.0
  • Overall confidence >= 60%
  • No security concerns
  • Tests present and passing (if applicable)

Verdict:

MERGE WITH FIXES

The missing LOD biome colors are a one-line-per-biome fix that must be added before merge. Once resolved, this PR is ready.

Machine Readable Verdict

{
  "reviewed_sha": "8e9c6d9a681e452c588d364637f2ca98b0ec75c4",
  "critical_issues": 1,
  "high_priority_issues": 0,
  "medium_priority_issues": 0,
  "overall_confidence_score": 75,
  "recommendation": "MERGE WITH FIXES"
}

New%20session%20-%202026-05-02T17%3A27%3A07.843Z
opencode session  |  github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📋 Summary

Linked Issues: Closes #628

Issue Verification: The PR fully implements the requirements of #628 by adding Frozen Ocean, Cold Ocean, Stony Shore, Snowy Beach, and Frozen River biomes with complete registry entries, selector logic, transition rules, surface handling, decorations, LOD/minimap colors, and unit tests.

This PR adds five cold coastal biome variants to the data-driven biome system. It wires them through the registry, selectors, edge detector, surface builder, overworld generator, decoration registry, and LOD color provider. It also adds targeted unit tests for registry identity, selector behavior, and frozen surface placement. The changes are additive, well-scoped, and follow existing codebase patterns. nix develop --command zig build test passes successfully.

🔴 Critical Issues (Must Fix - Blocks Merge)

All previously reported critical issues have been resolved.

The missing LOD biome colors for the five new biomes were added to modules/world-lod/src/biome_color_provider.zig in this commit.

⚠️ High Priority Issues (Should Fix)

None identified.

💡 Medium Priority Issues (Nice to Fix)

None identified.

ℹ️ Low Priority Suggestions (Optional)

[LOW] modules/world-worldgen/src/biome_registry.zig:226 - Frozen river biome point continentalness mismatch
Confidence: Low
Description: The frozen_river BiomePoint has min_continental = 0.42, but its BiomeDefinition specifies continentalness = .{ .min = -1.0, .max = -0.5 } to prevent natural selection. The same pattern exists for .river (line 225), so this is pre-existing behavior, but it means the Voronoi point does not match the definition's intent.
Impact: Low - the score-based selector respects the definition, and river override takes priority.
Suggested Fix: Align the biome point with the definition by setting max_continental = -0.5 in the BiomePoint, or add a clarifying comment.

📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 9/10 Each file handles one aspect (registry, selector, surface, LOD); changes are well-scoped.
Open/Closed 9/10 New biomes plug into the data-driven registry without modifying core selection algorithms.
Liskov Substitution 9/10 New biomes follow the same structural patterns as existing ones; no behavior breakage.
Interface Segregation 9/10 Existing RHI/world interfaces unchanged; biome system uses focused abstractions.
Dependency Inversion 8/10 Selection depends on registry definitions, not hardcoded logic.
Average 8.8

🎯 Final Assessment

Overall Confidence Score: 92%

How to interpret: High confidence, ready to merge or with trivial fixes.

Confidence Breakdown:

  • Code Quality: 90% (clean, idiomatic Zig; follows existing patterns)
  • Completeness: 95% (all major systems wired correctly)
  • Risk Level: 15% (additive changes; very low regression risk)
  • Test Coverage: 90% (good unit tests for registry, selector, surface builder)

Merge Readiness:

  • All critical issues resolved
  • SOLID average score >= 6.0
  • Overall confidence >= 60%
  • No security concerns
  • Tests present and passing (if applicable)

Verdict:

MERGE

The previously reported critical LOD color issue has been fixed. All tests pass. The remaining low-priority item is a pre-existing inconsistency identical to the .river pattern. This PR is ready to merge.

Machine Readable Verdict

{
  "reviewed_sha": "b58a9a42abbde34d2beb13ca264d77e4d5bcd7ac",
  "critical_issues": 0,
  "high_priority_issues": 0,
  "medium_priority_issues": 0,
  "overall_confidence_score": 92,
  "recommendation": "MERGE"
}

New%20session%20-%202026-05-02T18%3A07%3A27.257Z
opencode session  |  github run

@github-actions github-actions Bot merged commit f3c1a6d into dev May 2, 2026
8 checks passed
@MichaelFisher1997 MichaelFisher1997 deleted the feature/issue-628-cold-coastal-biomes branch May 2, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 3A] Biomes: Add cold and coastal variants

1 participant