A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Map: Tel Aviv's localities keep smaller landmarks at its street crossings; core cover 25.6% (refs #318) (#554)
Eyal Golane41c4c0b4417
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4ec4e7427..bba3279cc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -256,6 +256,10 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB+0.9 ms at the gameplay zoom), not yet on an idle one.### Changed+- Tel Aviv's 1948 localities (Sheikh Muwannis, Jammasin, Salama, Ramat Gan, Givatayim, Bnei Brak and the rest inside its+ footprint) keep their mosques and water towers, at a quarter and three tenths of their size elsewhere, at the street+ crossing nearest their hearts (refs #318, owner ruling 2026-10-12). The city's blocks keep their plots round them: core+ cover 18.5% to 25.6%, the whole footprint 17.4% to 25.2%, 43 to 55 blocks.- CI checks the water and route-ribbon bakes against the code that makes them (#535), as it does the biome colours'(#529): a pinned fingerprint of `MapBuilder.WaterMeshGrid` and of `RouteLayer.Plan` and `Derive`, and a numpy port ofthe water mesh. Doc comments in `MapBuilder`, `RouteLayer` and `RouteRibbonFile` point to the checks. No change in thediff --git a/unity/Assets/Scripts/Map/Kits/SettlementKits.Landmarks.cs b/unity/Assets/Scripts/Map/Kits/SettlementKits.Landmarks.csindex 82454e936..8e80d2247 100644--- a/unity/Assets/Scripts/Map/Kits/SettlementKits.Landmarks.cs+++ b/unity/Assets/Scripts/Map/Kits/SettlementKits.Landmarks.cs@@ -462,9 +462,9 @@ namespace Statecraft.Game.Map.Kitsreturn true;}- static int WaterTower(string owner, Vector2 want, KitGround ground, KitMesh km, Lots lots)+ static int WaterTower(string owner, Vector2 want, KitGround ground, KitMesh km, Lots lots, float size = 1f){- float m = KitScale.Houses;+ float m = KitScale.Houses * size;if (!Claim(lots, want, 4f * m, owner, ground, out var p)) return 0;float y = ground.Y(p.x, p.y);var concrete = C(0.82f, 0.80f, 0.76f);diff --git a/unity/Assets/Scripts/Map/Kits/SettlementKits.cs b/unity/Assets/Scripts/Map/Kits/SettlementKits.csindex 683043555..728a731e6 100644--- a/unity/Assets/Scripts/Map/Kits/SettlementKits.cs+++ b/unity/Assets/Scripts/Map/Kits/SettlementKits.cs@@ -154,7 +154,7 @@ namespace Statecraft.Game.Map.Kitsvar km = pass ? Tile(centres[s.Id]) : (townMeshes[s.Id] = new KitMesh());int from = km.VertexCount;// A game settlement's own landmarks (towns round 2: TownLandmarks), a locality's its archetype's.- int n = pass ? BuildOne(s, centres[s.Id], ground, km, lots, Phase.Landmark, ref rnd, 0, null)+ int n = pass ? BuildOne(s, centres[s.Id], ground, km, lots, Phase.Landmark, ref rnd, 0, null, PackedIn(s, towns, centres, ground)): TownLandmarks(s, centres[s.Id], ground, km, lots, ref rnd);if (pass) { spans[s.Id] = new List<(KitMesh, int, int)> { (km, from, km.VertexCount) }; result.LocalityBuildings += n; }else result.TownLandmarks[s.Id] = n;@@ -918,7 +918,7 @@ namespace Statecraft.Game.Map.Kits/// <summary>A 1948 locality's landmark or houses (promo-villages): random spots over its disc, its archetype's buildings,/// clear of the grid's edge midpoints. The 25 game settlements use TownLandmarks and PlaceHouses (towns round 2).</summary>static int BuildOne(Settlement s, Vector2 centre, KitGround ground, KitMesh km, Lots lots, Phase phase, ref KitRandom rnd, int landmarksBefore,- HashSet<string>? ignoreCellsOf)+ HashSet<string>? ignoreCellsOf, CityPlots? city = null){var arch = ArchetypeOf(s);float R = FootprintRadiusM(s, ground.HexSizeM);@@ -943,7 +943,7 @@ namespace Statecraft.Game.Map.Kitsbool Free(Vector2 p, float r) => FreeAt(lots, p, r);// Landmarks first, at the centre (or the nearest dry spot to it).- if (phase != Phase.Houses) placed += PlaceLandmark(s, arch, centre, R, ground, km, lots, ref rnd);+ if (phase != Phase.Houses) placed += PlaceLandmark(s, arch, centre, R, ground, km, lots, ref rnd, city);if (phase == Phase.Landmark) return placed;bool mixed = Localities.IsMixed(s.Id);@@ -984,30 +984,75 @@ namespace Statecraft.Game.Map.Kits/// town's or village's mosque (a 1948 locality's follows its Village Statistics religion columns: a church in/// Christian Bethlehem, none in the Druze villages; a village's is smaller than a town's), a Jewish place's water/// tower. Returns how many were built.</summary>- static int PlaceLandmark(Settlement s, Archetype arch, Vector2 centre, float R, KitGround ground, KitMesh km, Lots lots, ref KitRandom rnd)+ static int PlaceLandmark(Settlement s, Archetype arch, Vector2 centre, float R, KitGround ground, KitMesh km, Lots lots, ref KitRandom rnd,+ CityPlots? city = null){var heart = DryNear(centre, ground, R * 0.3f, ref rnd);+ // Inside Tel Aviv's footprint (#318) the landmark stands at the street crossing nearest its spot, drawn small enough+ // that the four blocks round the crossing keep their plots. Elsewhere it stands where it wants, at full size.+ Vector2 At(Vector2 want) => city?.NearestCrossing(want) ?? want;+ float mosqueK = city == null ? 1f : InCityMosque, towerK = city == null ? 1f : InCityTower;if (Localities.LandmarkOf(s.Id) == Landmark.Mixed) // a mixed locality: a mosque on its west side, a water tower on its east- return Mosque(s.Id, heart - new Vector2(R * 0.3f, 0f), ground, km, lots, ref rnd, 0.8f)- + WaterTower(s.Id, heart + new Vector2(R * 0.35f, 0f), ground, km, lots);+ return Mosque(s.Id, At(heart - new Vector2(R * 0.3f, 0f)), ground, km, lots, ref rnd, 0.8f * mosqueK)+ + WaterTower(s.Id, At(heart + new Vector2(R * 0.35f, 0f)), ground, km, lots, towerK);switch (arch){- case Archetype.OldTown: return Mosque(s.Id, heart, ground, km, lots, ref rnd, 1.2f); // no locality is an old town today+ case Archetype.OldTown: return Mosque(s.Id, At(heart), ground, km, lots, ref rnd, 1.2f * mosqueK); // no locality is an old town todaycase Archetype.ArabTown:- float size = s.Type == "village" ? 0.8f : 1f;+ float size = (s.Type == "village" ? 0.8f : 1f) * mosqueK;switch (Localities.LandmarkOf(s.Id) ?? Landmark.Mosque){- case Landmark.Mosque: return Mosque(s.Id, heart, ground, km, lots, ref rnd, size);- case Landmark.Church: return Church(s.Id, heart, ground, km, lots, size) ? 1 : 0;+ case Landmark.Mosque: return Mosque(s.Id, At(heart), ground, km, lots, ref rnd, size);+ case Landmark.Church: return Church(s.Id, At(heart), ground, km, lots, size) ? 1 : 0;default: return 0;}case Archetype.Moshava:return (Localities.LandmarkOf(s.Id) ?? Landmark.WaterTower) == Landmark.WaterTower- ? WaterTower(s.Id, heart + new Vector2(R * 0.35f, -R * 0.2f), ground, km, lots) : 0;+ ? WaterTower(s.Id, At(heart + new Vector2(R * 0.35f, -R * 0.2f)), ground, km, lots, towerK) : 0;default: return 0;}}+ /// <summary>A 1948 locality's mosque and water tower inside Tel Aviv's footprint, as a share of their size elsewhere+ /// (#318). Their lots (a village mosque's 132 m, a water tower's 120 m) then fit a street crossing with the blocks of+ /// all four plots round it at full size: Tel Aviv's core cover is 25.6%, as without the localities, against 18.5%+ /// with full-size landmarks. At 0.3 for the mosques it falls to 24.3%.</summary>+ const float InCityMosque = 0.25f, InCityTower = 0.3f;++ /// <summary>A white city's block lattice (Tel Aviv's: one lattice, no jitter), to stand a 1948 locality's landmark at+ /// one of its street crossings (#318).</summary>+ sealed class CityPlots+ {+ readonly Vector2 c; readonly float pu, pv, ca, sa;+ public CityPlots(Vector2 centre, float yawDeg)+ {+ var g = Grid(Style.WhiteBlock);+ c = centre; pu = g.pu * g.scale; pv = g.pv * g.scale;+ ca = Mathf.Cos(yawDeg * Mathf.Deg2Rad); sa = Mathf.Sin(yawDeg * Mathf.Deg2Rad);+ }+ /// <summary>The street crossing nearest <paramref name="p"/>: the corner shared by four plots, half a pitch off+ /// every plot's centre.</summary>+ public Vector2 NearestCrossing(Vector2 p)+ {+ var d = p - c;+ float u = (Mathf.Floor((d.x * ca + d.y * sa) / pu) + 0.5f) * pu, v = (Mathf.Floor((-d.x * sa + d.y * ca) / pv) + 0.5f) * pv;+ return c + new Vector2(u * ca - v * sa, u * sa + v * ca);+ }+ }++ /// <summary>The city whose plots a 1948 locality's landmark stands on (#318, owner ruling 2026-10-12): Tel Aviv's, when the+ /// locality's centre lies inside its footprint; else null. Its villages (Sheikh Muwannis, Jammasin, Salama) and its+ /// neighbours (Ramat Gan, Givatayim, Bnei Brak) keep their landmarks, smaller, at the street crossing nearest their hearts.</summary>+ static CityPlots? PackedIn(Settlement loc, IReadOnlyList<Settlement> towns, Dictionary<string, Vector2> centres, KitGround ground)+ {+ foreach (var t in towns)+ {+ if (t.Id != "tel_aviv") continue;+ if ((centres[loc.Id] - centres[t.Id]).magnitude <= FootprintRadiusM(t, ground.HexSizeM)) return new CityPlots(centres[t.Id], GridYaw(t.Id));+ }+ return null;+ }+/// <summary>Buildings per settlement: the footprint area times the archetype's built-up share over its mean lot.</summary>static int TargetCount(Archetype arch, float R){diff --git a/unity/Assets/Tests/EditMode/TownCensusTests.cs b/unity/Assets/Tests/EditMode/TownCensusTests.csindex fa8951bd3..5fd7b72ea 100644--- a/unity/Assets/Tests/EditMode/TownCensusTests.cs+++ b/unity/Assets/Tests/EditMode/TownCensusTests.cs@@ -255,12 +255,41 @@ public class TownCensusTests/// landmark, whole footprint and inner half radius). Towns round 2 measured them with the 1948 localities (docs/visual-v1.md,/// "Towns round 2"): Tel Aviv 43 / 17.4% / 18.5%, Jaffa 33 / 32.6% / 31.9%, Haifa 45 / 21.0% / 20.6%, Jerusalem 110 //// 22.7% / 24.9%; main before it had 36, 15, 30 and 70 buildings. The building floors sit above main's counts, so a change- /// that thins a city back to round 1's sparse handful fails here; the cover floors are about 10% under the measure.</summary>+ /// that thins a city back to round 1's sparse handful fails here; the cover floors are about 10% under the measure.+ /// Tel Aviv's row is #318's (owner ruling 2026-10-12): with its localities' landmarks at its street crossings it draws 55 /+ /// 25.2% / 25.6%, and its core floor is the ruling's 25%.</summary>internal static readonly Dictionary<string, (int buildings, float all, float core)> Floors = new Dictionary<string, (int, float, float)>{- ["tel_aviv"] = (40, 0.155f, 0.165f), ["jaffa"] = (28, 0.29f, 0.285f), ["haifa"] = (40, 0.19f, 0.185f), ["jerusalem"] = (95, 0.20f, 0.22f),+ ["tel_aviv"] = (50, 0.225f, 0.25f), ["jaffa"] = (28, 0.29f, 0.285f), ["haifa"] = (40, 0.19f, 0.185f), ["jerusalem"] = (95, 0.20f, 0.22f),};+ /// <summary>#318 (owner ruling 2026-10-12): Tel Aviv's 1948 localities keep their hearts (#291, review M8). Every locality+ /// whose centre lies inside Tel Aviv's footprint and whose kind has a landmark builds it, before any of the city's blocks.</summary>+ [Test]+ public void TelAvivsLocalitiesKeepTheirLandmarks()+ {+ var map = OpenMap();+ Census(map, out var placed, out var g);+ var ta = map.Settlements.First(s => s.Id == "tel_aviv");+ var w = map.Frame.ToWorld(ta.Lon, ta.Lat, 0); var c = new Vector2(w.x, w.z);+ float R = SettlementKits.FootprintRadiusM(ta, g.HexSizeM);+ var bad = new List<string>(); int checkedN = 0;+ foreach (var loc in map.Localities.Select(p => p.Settlement))+ {+ var lw = map.Frame.ToWorld(loc.Lon, loc.Lat, 0);+ if ((new Vector2(lw.x, lw.z) - c).magnitude > R) continue;+ if (Localities.LandmarkOf(loc.Id) == Landmark.None) continue;+ checkedN++;+ int firstBlock = placed.FindIndex(p => p.Id == "tel_aviv" && p.Kind == "building");+ int at = placed.FindIndex(p => p.Id == loc.Id && p.Kind != "building" && p.Kind != "wing");+ if (at < 0) bad.Add(loc.Id + " lost its landmark");+ else if (firstBlock >= 0 && at > firstBlock) bad.Add(loc.Id + "'s landmark came after Tel Aviv's blocks");+ }+ TestContext.WriteLine($"{checkedN} localities inside Tel Aviv's footprint checked");+ Assert.GreaterOrEqual(checkedN, 8, "Sheikh Muwannis, Jammasin, Salama, Ramat Gan, Givatayim, Bnei Brak... lie inside it");+ CollectionAssert.IsEmpty(bad);+ }+[Test]public void TheCitiesCoverTheirGround(){