Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Map: the surf reaches 2.4 km out, so its foam band south of Jaffa is inside promo 03's band (refs #690, #388) (#693)

Eyal Golan4009327c006f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 631a96fc5..0fa17e433 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,9 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
R-MONEY-001; spec §1.2, owner, 15 October 2026, Q-MONEY-4 and Q-HUD-3). Debt and foreign currency stay in the sim
(D-C3). No upkeep yet: per Q-MONEY-2 it waits for Phase 3. No golden moves; the content hash does (the name is in
`content/model.yaml`), so an older save loads with the "different game content" warning.
+- The surf reaches further out to sea (refs #690, #388): the breakers' zone widens from 1.8 to 2.4 km, so south of Jaffa
+ the white foam band reads 30.8 px at the gameplay zoom, inside promo 03's 25-55 px band (20.3 before; the promo reads
+ 44), and the northern frontage reads 25.0 px (18.3 before), inside its 6-30 px band. Presentation only.
- An event option's Treasury cost the Treasury cannot cover is now borrowed at once, like every other payment, with a cause
naming the event (refs #681, R-MONEY-003). Before, the Treasury went below 0 until the deficit step, which reported the
shortfall as "to cover the deficit". End-of-turn totals are unchanged and no golden moves. The top bar's Treasury is
diff --git a/docs/visual-v1.md b/docs/visual-v1.md
index 137ca4378..ee1f6609d 100644
--- a/docs/visual-v1.md
+++ b/docs/visual-v1.md
@@ -1343,7 +1343,7 @@ Review round 1 (staff review I1-I2, M1-M8) is folded in; the values below are th
budget (0.89 / 0.13 ms in promo-sea round 1); p95 with everything on is 10 / 14 ms, under 16.7 ms.
- **Surf** (review I2).
- A swash line, full to `ScSwashM` 180 m and gone by 324 m.
- - Breakers through a `ScSurfM` zone (900 m here; 1.8 km since sea round 3). They are a squared triangle wave in the
+ - Breakers through a `ScSurfM` zone (900 m here; 1.8 km since sea round 3; 2.4 km since #690). They are a squared triangle wave in the
distance from the shore, spacing `ScBreakerSpacingM` (300 m here; 450 m since sea round 3), rolling shoreward at
`ScBreakerRate` 0.05 cycles/s (15 m/s here, a quarter pixel a frame at gameplay03 and 60 fps; 22.5 m/s, about half a
pixel, since sea round 3).
diff --git a/unity/Assets/Shaders/StatecraftMap.hlsl b/unity/Assets/Shaders/StatecraftMap.hlsl
index 7b273847c..db6eaa205 100644
--- a/unity/Assets/Shaders/StatecraftMap.hlsl
+++ b/unity/Assets/Shaders/StatecraftMap.hlsl
@@ -122,8 +122,13 @@ static const float ScWaveTilt = 0.6; // wave normal
// carry about 35% more foam on average at the gameplay zoom. Like "broken", it fades to 0.5 at 75-150 m pixels, so the
// overview's mean foam is unchanged, and zooming out through that range dims the breakers by about a quarter
// (independent review of #660; kept rather than re-centred, which would change the overview).
+// #690: the surf zone from 1.8 to 2.4 km. On main d031af36 (with #519's grade) the foam band (shore to the farthest
+// near-white pixel, tools/coast_measure.py at gameplay03) read 20.3 px south of Jaffa (promo 03: 44, band 25-55) and 18.3 px
+// on the northern frontage (promo 03: 12.3, band 6-30); at 2.4 km it reads 30.8 and 25.0. The zone is one width along the
+// whole coast, so 2.4 km is the widest step that keeps the north at least 5 px under 30 (gameplay03 editor renders: 2.4 km
+// reads 29 px south and 24 north, 2.7 km 33 and 28); a wider surf south of Jaffa only is an owner option on #690.
float _ScSeaFoam; // 1 = on, 0 = off (the "foam" toggle)
-static const float ScSwashM = 180.0, ScSurfM = 1800.0, ScBreakerSpacingM = 450.0, ScBreakerRate = 0.05, ScFoamWhite = 0.95;
+static const float ScSwashM = 180.0, ScSurfM = 2400.0, ScBreakerSpacingM = 450.0, ScBreakerRate = 0.05, ScFoamWhite = 0.95;
static const float ScLaceCellM = 200.0, ScLaceCover = 0.62, ScLaceEdge = 0.25;
// Sea round 2 (#388): the far sea's texture, which promo 02 and 03 show at the gameplay and overview zooms where the waves
// above have faded to a smooth surface (sea detail 0.013 against promo 03's 0.060 at gameplay03, 0.019 against 0.063 at
diff --git a/unity/Assets/Tests/EditMode/SeaTests.cs b/unity/Assets/Tests/EditMode/SeaTests.cs
index 9b70705ae..da77c25f1 100644
--- a/unity/Assets/Tests/EditMode/SeaTests.cs
+++ b/unity/Assets/Tests/EditMode/SeaTests.cs
@@ -143,7 +143,11 @@ public class SeaTests
/// <summary>Rendered west of Tel Aviv: just offshore (about 120-200 m out, on the swash line: full to 180 m, gone by
/// 324 m) is brighter than 1.2 km out (inside the turquoise shallows), which is lighter and greener than the open sea
- /// 24 km out. The shore is found in coast.png itself.</summary>
+ /// 24 km out. The shore is found in coast.png itself. The 1.2 km sample also lies inside the breakers' zone (ScSurfM,
+ /// 1.8 km before #690, 2.4 km since), so its colour carries some crest foam, more since #690 (luma 0.70 to 0.78). It is
+ /// kept: no point past 2.4 km is sure to be in the shallows, whose edge wanders 1.7-3.5 km (ScShallowM 2.6 km, +-35%).
+ /// The foam can only help "lighter" and works against "greener" (white lowers g/b); "foam at the shore" keeps a 0.13
+ /// luma margin (0.92 against 0.78).</summary>
[UnityTest]
public IEnumerator ShallowsAreLighterThanTheOpenSeaAndFoamLinesTheShore()
{
@@ -358,6 +362,69 @@ public class SeaTests
/// read it a little differently.</summary>
static readonly Vector2 LaceShare = new Vector2(0.3f, 0.7f);
+ /// <summary>#690: the surf's foam band reaches promo 03's band south of Jaffa. tools/coast_measure.py reads the band at
+ /// gameplay03 from the shore to the farthest foam pixel: promo 03 44 px south of Jaffa (band 25-55 px); main d031af36 20.3.
+ /// At the breaker test's pose (30 km at 960x540), with the water's clock pinned at four moments, a one-pixel line is walked
+ /// east-west from the shore out to 3 km (87 px, so about 35 m a pixel along the walk) at 31.90, 31.92, 31.94 and 31.96 N:
+ /// the latitudes coast_measure's south window (rows 690-880) covers at gameplay03, 31.89-31.97 N without the top bar's
+ /// inset and 31.90-31.98 N with it. A pixel is foam by the breaker test's rule, and the band ends at the farthest run of
+ /// 2 or more foam pixels (the breaker test's line), so a lone white pixel offshore (a boat) does not count. The mean over
+ /// the 16 walks must lie in <see cref="SurfBandSouthPx"/>, coast_measure's band. This walk reads 1.11-1.16x coast_measure
+ /// (22.5 px against 20.3 on main d031af36, 35.6 against 30.8 at 2.4 km), so the bound is a little looser than the tool's
+ /// band; the tool's own reading is in the PR. One walk's reach jumps by a whole crest spacing (about 10 px) as the outer
+ /// breaker rolls in and fades, so a single line's median over 4 moments rides on 2 of them. The northern band (6-30 px)
+ /// is not asserted on one line: the breakers' noise makes one line's reach vary along the coast (32.30 N read 27.5 px on
+ /// main 585f34ed, where coast_measure's northern window read 19.2), so it is read with coast_measure over the window's
+ /// 100 rows.</summary>
+ [UnityTest]
+ public IEnumerator TheSurfReachesPromo03sBandSouthOfJaffa()
+ {
+ var map = OpenMap();
+ yield return null;
+ VisualToggles.Set("grid", false);
+ var cam = Camera.main; var rig = cam.GetComponent<CameraRig>();
+ var log = new System.Text.StringBuilder();
+ var bands = new System.Collections.Generic.List<int>();
+ foreach (var lat in new[] { 31.90f, 31.92f, 31.94f, 31.96f })
+ {
+ var (col, row) = ShoreTexel(lat);
+ const float texelM = 161529f / 2048f; // a coast.png texel east-west
+ Vector3 shore = TexelWorld(map, col, row), reach = TexelWorld(map, col - Mathf.RoundToInt(3000f / texelM), row);
+ rig.LookAt = reach; rig.Distance = 30000f; rig.Yaw = 0; rig.TopInset = 0; rig.Apply();
+ foreach (var t in new[] { 100f, 105f, 110f, 115f })
+ {
+ MapShaderGlobals.PinWaterTime(t);
+ var px = new Vector2[2];
+ var r = RenderSample.Render(cam, 960, 540, new[] { shore, reach }, px);
+ int n = Mathf.CeilToInt(Mathf.Max(Mathf.Abs(px[1].x - px[0].x), Mathf.Abs(px[1].y - px[0].y)));
+ int band = 0, run = 0;
+ var trace = new System.Text.StringBuilder();
+ for (int k = 0; k <= n + 1; k++)
+ {
+ bool foam = false;
+ if (k <= n)
+ {
+ var p = Vector2.Lerp(px[0], px[1], k / (float)n);
+ var c = r.At(Mathf.RoundToInt(p.x), Mathf.RoundToInt(p.y));
+ foam = Luma(c) >= 0.72f && Mathf.Max(c.r, c.g, c.b) - Mathf.Min(c.r, c.g, c.b) <= 30f / 255f;
+ trace.Append(foam ? '#' : '.');
+ }
+ if (foam) run++;
+ else { if (run >= 2) band = k; run = 0; } // the band ends where the farthest line of 2+ px ends
+ }
+ bands.Add(band);
+ log.AppendLine($"{lat:0.00} N t={t}: foam band {band} px of {n + 1} {trace}");
+ }
+ }
+ float mean = (float)bands.Average();
+ TestContext.WriteLine(log.ToString());
+ TestContext.WriteLine($"mean foam band over {bands.Count} walks: {mean:0.0} px");
+ Assert.That(mean, Is.InRange(SurfBandSouthPx.x, SurfBandSouthPx.y), "south of Jaffa: the surf's foam band in promo 03's band");
+ }
+
+ /// <summary>TheSurfReachesPromo03sBandSouthOfJaffa's bounds, coast_measure's southern band for gameplay03 (#690).</summary>
+ static readonly Vector2 SurfBandSouthPx = new Vector2(25f, 55f);
+
/// <summary>promo-sea review I2 / M5 / N1: the breakers are box-filtered over the pixel, so they never alias. Around
/// the surf zone west of Tel Aviv, at the gameplay footprint (30 km at 960x540: about 45 m a pixel, the same as
/// gameplay03's 60 km at 1920x1080), where an unfiltered crest is sub-pixel but not yet faded, every water pixel of a