Skip to content

feat: add mountain biome variants#640

Merged
github-actions[bot] merged 3 commits into
devfrom
opencode/happy-wizard
May 2, 2026
Merged

feat: add mountain biome variants#640
github-actions[bot] merged 3 commits into
devfrom
opencode/happy-wizard

Conversation

@MichaelFisher1997
Copy link
Copy Markdown
Collaborator

Summary

  • Adds meadow, grove, snowy slopes, jagged peaks, frozen peaks, and stony peaks as first-class data-driven mountain biomes.
  • Wires variant surfaces, decorations, terrain profiles, biome colors, LOD/minimap classification, and tree hints.
  • Updates biome tests for the new mountain-family selection behavior.

Verification

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

Closes #630

@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

This PR closes #630 by implementing all 6 requested mountain biome variants: Meadow, Grove, Snowy Slopes, Jagged Peaks, Frozen Peaks, and Stony Peaks. The implementation fully satisfies the acceptance criteria: biome definitions are added to the modern data-driven BIOME_REGISTRY, surfaces and decorations visually distinguish each variant (meadow=grass/flowers, grove=podzol/spruce, snowy slopes=snow_block, peaks=stone/packed_ice), existing mountain generation parameters remain stable, and nix develop --command zig build test passes. The changes are well-scoped, consistent across color providers, LOD, meshing, and worldgen modules, with new unit tests validating distinctness.

📌 Review Metadata


🔴 Critical Issues (Must Fix - Blocks Merge)

None identified.


⚠️ High Priority Issues (Should Fix)

[HIGH] modules/world-worldgen/src/overworld_generator.zig:983-989 - Grove SurfaceType classification inconsistent with authoritative world map
Confidence: High
Description: deriveSurfaceTypeInternal in overworld_generator.zig does not explicitly handle .grove, causing it to fall through to else => .grass. However, the authoritative deriveSurfaceType in modules/world-worldgen/src/world_class.zig:91 explicitly maps .grove => .dirt. This discrepancy means the classification cache stores .grass for grove biomes, while the authoritative WorldClassMap says .dirt. In classifyLODSample, cached samples convert .grass.grass block via surfaceTypeToBlock, while fresh samples correctly return .podzol via getSurfaceBlock, creating visual inconsistency in LOD rendering.
Impact: Grove biomes will render with grass instead of podzol/dirt in cached LOD paths, and may show mixed grass/podzol depending on cache state.
Suggested Fix: Add .grove => .dirt, to the switch in deriveSurfaceTypeInternal at modules/world-worldgen/src/overworld_generator.zig:983-989, matching the authoritative mapping in world_class.zig.


💡 Medium Priority Issues (Nice to Fix)

None identified.


ℹ️ Low Priority Suggestions (Optional)

None identified.


📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 8/10 Each modified file has a focused, well-defined biome-related responsibility
Open/Closed 8/10 New biomes extend the data-driven registry without altering core selection algorithms
Liskov Substitution 9/10 No inheritance violations; Zig's enum/struct model used correctly
Interface Segregation 8/10 Color providers, registries, and generators are cleanly separated by concern
Dependency Inversion 8/10 Centralized BIOME_REGISTRY consumed by specialized LOD/meshing/worldgen modules
Average 8.2

🎯 Final Assessment

Overall Confidence Score: 82%

Confidence Breakdown:

  • Code Quality: 85% (clean data-driven patterns, one oversight in surface-type sync)
  • Completeness: 90% (all 6 variants wired across registry, colors, surfaces, trees, tests)
  • Risk Level: 75% (low structural risk, but the grove LOD inconsistency is user-visible)
  • Test Coverage: 85% (new distinctness test added, existing test updated for new selection behavior)

Merge Readiness:

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

Verdict:

MERGE WITH FIXES — Add .grove => .dirt to deriveSurfaceTypeInternal to align with the authoritative world_class.zig mapping.


{
  "reviewed_sha": "b9eb90962c867aae30574cc9db181c4b7a1bdc75",
  "critical_issues": 0,
  "high_priority_issues": 1,
  "medium_priority_issues": 0,
  "overall_confidence_score": 82,
  "recommendation": "MERGE WITH FIXES"
}

New%20session%20-%202026-05-02T17%3A14%3A09.501Z
opencode session  |  github run

# Conflicts:
#	modules/world-core/src/block.zig
#	modules/world-worldgen/src/overworld_generator.zig
#	modules/world-worldgen/src/surface_builder.zig
#	modules/world-worldgen/src/world_class.zig
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📋 Summary

This PR closes #630 by implementing all 6 requested mountain biome variants: Meadow, Grove, Snowy Slopes, Jagged Peaks, Frozen Peaks, and Stony Peaks. The implementation satisfies the acceptance criteria: biome definitions are added to the data-driven BIOME_REGISTRY, surfaces and decorations distinguish each variant, existing mountain generation parameters remain stable, and new unit tests validate distinctness. The only remaining concern is a previously reported surface-type inconsistency for Grove biomes that remains unfixed.

📌 Review Metadata


🔴 Critical Issues (Must Fix - Blocks Merge)

None identified.


⚠️ High Priority Issues (Should Fix)

❌ [NOT FIXED] Previous issue still present: Grove SurfaceType classification inconsistent between cache and fresh LOD samples.

[HIGH] modules/world-worldgen/src/overworld_generator.zig:998-1005 - deriveSurfaceTypeInternal missing .grove => .dirt
Confidence: High
Description: The previous review (commit b9eb909) identified that deriveSurfaceTypeInternal does not explicitly handle .grove, causing it to fall through to else => .grass. In classifyLODSample (overworld_generator.zig:764-809), cached LOD samples use cached.surface_typesurfaceTypeToBlock, while fresh samples use getSurfaceBlock(biome_id). For grove biomes, cached paths return .grass block (from surfaceTypeToBlock(.grass)), while fresh paths return .podzol (from getSurfaceBlock(.grove)). The standalone deriveSurfaceType in world_class.zig:91 correctly maps .grove => .dirt, but this is not reflected in the caching path.
Impact: Grove biomes render with grass in cached LOD samples and podzol in fresh LOD samples, causing visual inconsistency depending on cache state.
Suggested Fix: Add .grove => .dirt, to the switch in deriveSurfaceTypeInternal at modules/world-worldgen/src/overworld_generator.zig:998-1005.


💡 Medium Priority Issues (Nice to Fix)

None identified.


ℹ️ Low Priority Suggestions (Optional)

None identified.


📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 8/10 Each file has a focused biome-related responsibility; registry, colors, and generation are cleanly separated
Open/Closed 8/10 New biomes extend the data-driven registry without modifying core selection algorithms
Liskov Substitution 9/10 Enum/struct extensions follow existing patterns; no inheritance violations
Interface Segregation 8/10 Color providers, registries, and generators are separated by concern
Dependency Inversion 8/10 Centralized BIOME_REGISTRY consumed by specialized LOD/meshing/worldgen modules
Average 8.2

🎯 Final Assessment

Overall Confidence Score: 78%

Confidence Breakdown:

  • Code Quality: 85% (clean data-driven patterns, one oversight in surface-type sync)
  • Completeness: 90% (all 6 variants wired across registry, colors, surfaces, trees, tests)
  • Risk Level: 70% (low structural risk, but the grove LOD inconsistency is user-visible)
  • Test Coverage: 85% (new distinctness test added, existing test updated for selection behavior)

Merge Readiness:

  • All critical issues resolved (none present)
  • SOLID average score >= 6.0 (8.2 ✓)
  • Overall confidence >= 60% (78% ✓)
  • No security concerns
  • Tests present and passing (claimed by author; could not verify due to build timeout)

Verdict:

MERGE WITH FIXES — Add .grove => .dirt to deriveSurfaceTypeInternal to align cached LOD behavior with the grove biome's intended surface type.

{
  "reviewed_sha": "50a8340e5a02776d560cb5fb01ca699cef1429d4",
  "critical_issues": 0,
  "high_priority_issues": 1,
  "medium_priority_issues": 0,
  "overall_confidence_score": 78,
  "recommendation": "MERGE WITH FIXES"
}

New%20session%20-%202026-05-02T17%3A25%3A39.072Z
opencode session  |  github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 2, 2026

📋 Summary

This PR closes #630 by implementing all 6 requested mountain biome variants: Meadow, Grove, Snowy Slopes, Jagged Peaks, Frozen Peaks, and Stony Peaks. The implementation adds biome definitions to the data-driven BIOME_REGISTRY, wires surfaces, decorations, terrain profiles, colors, LOD/minimap classification, and tree hints, and updates unit tests. The previously reported Grove surface-type inconsistency has been resolved.

📌 Review Metadata


🔴 Critical Issues (Must Fix - Blocks Merge)

None identified.


⚠️ High Priority Issues (Should Fix)

✅ [FIXED] Previous issue: Grove SurfaceType classification inconsistent between deriveSurfaceTypeInternal and deriveSurfaceType in world_class.zig. The switch in overworld_generator.zig:1000 now correctly includes .grove => .dirt, matching the authoritative mapping.

No new high-priority issues identified.


💡 Medium Priority Issues (Nice to Fix)

None identified.


ℹ️ Low Priority Suggestions (Optional)

None identified.


📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 8/10 Each modified file has a focused, well-defined biome-related responsibility
Open/Closed 8/10 New biomes extend the data-driven registry without altering core selection algorithms
Liskov Substitution 9/10 No inheritance violations; Zig's enum/struct model used correctly
Interface Segregation 8/10 Color providers, registries, and generators are cleanly separated by concern
Dependency Inversion 8/10 Centralized BIOME_REGISTRY consumed by specialized LOD/meshing/worldgen modules
Average 8.2

🎯 Final Assessment

Overall Confidence Score: 90%

Confidence Breakdown:

  • Code Quality: 90% (clean data-driven patterns, previous inconsistency fixed)
  • Completeness: 95% (all 6 variants wired across registry, colors, surfaces, trees, tests)
  • Risk Level: 85% (low structural risk, pure data addition with minimal logic changes)
  • Test Coverage: 90% (new distinctness test added, existing test updated for selection behavior)

Merge Readiness:

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

Verdict:

MERGE — All previously reported issues are resolved, the implementation is complete and consistent across all modules.

{
  "reviewed_sha": "fa38b018069ba7c97ff1bebc34032b2730f30c9d",
  "critical_issues": 0,
  "high_priority_issues": 0,
  "medium_priority_issues": 0,
  "overall_confidence_score": 90,
  "recommendation": "MERGE"
}

New%20session%20-%202026-05-02T17%3A35%3A21.209Z
opencode session  |  github run

@github-actions github-actions Bot enabled auto-merge (squash) May 2, 2026 17:37
@github-actions github-actions Bot merged commit bf03faf into dev May 2, 2026
9 checks passed
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 3C] Biomes: Add mountain variants

1 participant