feat: apply biome terrain modifiers#669
Conversation
📋 SummaryThis PR implements Issue #650: applying
The PR correctly avoids circular instability by anchoring biome selection to unmodified terrain. Ocean decisions remain hard (continentalness-based), and peak compression is preserved post-modifier. Tests cover flattening, amplification, clamping, and peak compression interaction. Deterministic worldgen fingerprints are updated to reflect the new generation pipeline. 📌 Review Metadata
🔴 Critical Issues (Must Fix - Blocks Merge)✅ All previously reported critical issues have been resolved. None identified.
|
| Principle | Score | Notes |
|---|---|---|
| Single Responsibility | 8 | HeightSampler handles height computation; TerrainShapeGenerator orchestrates the two-pass biome/modifier flow cleanly |
| Open/Closed | 7 | Adding new modifier types requires extending TerrainModifier and applyHeight, but the existing pipeline doesn't need changes |
| Liskov Substitution | 9 | computeHeight delegates to computeHeightWithTerrainModifier with null; backward compatibility preserved |
| Interface Segregation | 9 | New computeHeightWithTerrainModifier adds optional parameter without breaking existing callers |
| Dependency Inversion | 8 | TerrainModifier is a simple data struct passed into height computation; no tight coupling |
| Average | 8.2 |
🎯 Final Assessment
Overall Confidence Score: 92%
Confidence Breakdown:
- Code Quality: 90% (clean implementation, minor duplication in pass 3)
- Completeness: 95% (fully addresses issue Worldgen Phase 1: apply BiomeDefinition TerrainModifier during height shaping #650 requirements, good test coverage)
- Risk Level: 85% (two-pass sampling doubles noise cost per column; acceptable for correctness)
- Test Coverage: 95% (tests for flattening, amplification, clamping, peak compression; fingerprints updated)
Merge Readiness:
- All critical issues resolved
- SOLID average score >= 6.0
- Overall confidence >= 60%
- No security concerns
- Tests present and passing
Verdict:
MERGE
Clean implementation of terrain modifier integration with stable two-pass biome selection, comprehensive tests, and passing build.
{
"reviewed_sha": "8fb6a88af0276152e43e05871081b1e64e19752a",
"critical_issues": 0,
"high_priority_issues": 0,
"medium_priority_issues": 0,
"overall_confidence_score": 92,
"recommendation": "MERGE"
}
Summary
height_amplitude,smoothing,clamp_to_sea_level, andheight_offsetduring height shaping while keeping ocean decisions hard and peak compression active.Verification
nix develop --command zig fmt modules/world-worldgen/src/height_sampler.zig modules/world-worldgen/src/terrain_shape_generator.zig src/worldgen_tests.zignix develop --command zig build testFixes #650