feat(sites): strata on the Banc du Vigilant drop-off and multi-scale seabed relief
Strata now take a world rectangle, so the 4 m ledges cover the whole break and talus south of z = 118 m without touching la Saignée or the landmarks. Roughness gains octave and fractal-type parameters; a SlopeRoughness modifier roughens rock faces only. Both sites are re-baked with hummocks from 250 m down to 5 m. The secondary item, the first debris piece and one safe-route waypoint move a few metres to keep their contracts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
4af014288b
commit
f22a5e69aa
21 files changed
+247
-43
No files matched your search
@@ -8,7 +8,7 @@ const SiteTerrainData = preload("res://game/domain/sites/site_terrain_data.gd")
|
||||
|
||||
const ZONE1_TERRAIN_PATH := "res://content/sites/zone1_vigilant_terrain.res"
|
||||
|
||||
const TEST_COUNT := 44
|
||||
const TEST_COUNT := 48
|
||||
|
||||
var _failures: Array[String] = []
|
||||
|
||||
@@ -23,6 +23,7 @@ func _init() -> void:
|
||||
_test_outcrop()
|
||||
_test_boulder_field()
|
||||
_test_strata()
|
||||
_test_slope_roughness()
|
||||
|
||||
if _failures.is_empty():
|
||||
print("Site baker unit tests: %d passed, 0 failed." % TEST_COUNT)
|
||||
@@ -187,7 +188,7 @@ func _test_strata() -> void:
|
||||
recipe.origin_z_m = -10.0
|
||||
recipe.primitives.append(SiteTerrainBaker.SlopedPlane.new(30.0, 1.0, 0.0, 0.0, 0.0))
|
||||
var plain := SiteTerrainBaker.bake(recipe)
|
||||
recipe.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.9, 20.0, 35.0, Vector2.ZERO, 0.0))
|
||||
recipe.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.9, 20.0, 35.0, Rect2()))
|
||||
var terraced := SiteTerrainBaker.bake(recipe)
|
||||
var flat_cells := 0
|
||||
var riser_cells := 0
|
||||
@@ -202,17 +203,48 @@ func _test_strata() -> void:
|
||||
|
||||
var flat := _small_recipe()
|
||||
flat.primitives.append(SiteTerrainBaker.SlopedPlane.new(30.3, 0.0, 0.0, 0.0, 0.0))
|
||||
flat.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.9, 20.0, 35.0, Vector2.ZERO, 0.0))
|
||||
flat.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.9, 20.0, 35.0, Rect2()))
|
||||
var flat_data := SiteTerrainBaker.bake(flat)
|
||||
_expect(is_equal_approx(flat_data.elevations_m[flat_data.index_of(10, 10)], -30.3), "strata leave flat ground alone")
|
||||
|
||||
var identity := _small_recipe()
|
||||
identity.primitives.append(SiteTerrainBaker.SlopedPlane.new(30.0, 1.0, 0.0, 0.0, 0.0))
|
||||
var before := SiteTerrainBaker.bake(identity)
|
||||
identity.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.0, 20.0, 35.0, Vector2.ZERO, 0.0))
|
||||
identity.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.0, 20.0, 35.0, Rect2()))
|
||||
var after := SiteTerrainBaker.bake(identity)
|
||||
_expect(before.elevations_m == after.elevations_m, "sharpness 0 is the identity")
|
||||
|
||||
# Depth 30.7 keeps the plane off the layer boundaries, where quantisation is the identity.
|
||||
var banded := _small_recipe()
|
||||
banded.primitives.append(SiteTerrainBaker.SlopedPlane.new(30.7, 1.0, 0.0, 0.0, 0.0))
|
||||
var untouched := SiteTerrainBaker.bake(banded)
|
||||
banded.modifiers.append(SiteTerrainBaker.Strata.new(2.0, 0.9, 20.0, 35.0, Rect2(-20.0, 0.0, 40.0, 20.0)))
|
||||
var half := SiteTerrainBaker.bake(banded)
|
||||
var north_same := half.elevations_m[half.index_of(13, 5)] == untouched.elevations_m[untouched.index_of(13, 5)]
|
||||
var south_changed := half.elevations_m[half.index_of(13, 15)] != untouched.elevations_m[untouched.index_of(13, 15)]
|
||||
_expect(north_same and south_changed, "strata stay inside their region")
|
||||
|
||||
|
||||
func _test_slope_roughness() -> void:
|
||||
var recipe := _small_recipe()
|
||||
recipe.primitives.append(SiteTerrainBaker.SlopedPlane.new(30.0, 0.0, 0.0, 0.0, 0.0))
|
||||
recipe.primitives.append(SiteTerrainBaker.Blob.new(Vector2(10.0, 10.0), 5.0, 5.0, 12.0))
|
||||
var smooth := SiteTerrainBaker.bake(recipe)
|
||||
recipe.modifiers.append(SiteTerrainBaker.SlopeRoughness.new(5, 0.2, 1.0, 20.0, 40.0))
|
||||
var rough := SiteTerrainBaker.bake(recipe)
|
||||
_expect(rough.elevations_m[rough.index_of(0, 0)] == smooth.elevations_m[smooth.index_of(0, 0)], "slope roughness leaves flat sand untouched")
|
||||
var flank_changed := false
|
||||
for column in range(13, 18):
|
||||
flank_changed = flank_changed or rough.elevations_m[rough.index_of(column, 15)] != smooth.elevations_m[smooth.index_of(column, 15)]
|
||||
_expect(flank_changed, "slope roughness roughens the steep flank")
|
||||
var octaves := _small_recipe()
|
||||
octaves.primitives.append(SiteTerrainBaker.Roughness.new(7, 0.01, 2.0, 5, FastNoiseLite.FRACTAL_RIDGED))
|
||||
var ridged := SiteTerrainBaker.bake(octaves)
|
||||
var within := true
|
||||
for elevation: float in ridged.elevations_m:
|
||||
within = within and absf(elevation) <= 2.0 + 0.001
|
||||
_expect(within, "roughness amplitude bounds the ridged multi-octave noise")
|
||||
|
||||
|
||||
func _test_zone1_artefact_is_stable() -> void:
|
||||
var versioned := load(ZONE1_TERRAIN_PATH) as SiteTerrainData
|
||||
|
||||
Reference in new issue
Block a user