A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Camera: open at about 30 km over the central coast, like the promo (owner ruling) (#2370)
Eyal Golanccd9ef220814
diff --git a/changelog.d/e21-open-30km.md b/changelog.d/e21-open-30km.mdnew file mode 100644index 000000000..fd81fc53b--- /dev/null+++ b/changelog.d/e21-open-30km.md@@ -0,0 +1,4 @@+### Changed+- The game now opens at about 30 km (31 km, was 90 km) with Tel Aviv and Jaffa near the middle of the view, the sea to+ the left (owner ruling, 3 November 2026: like the promo). Tal Heuberger's building models show from the first frame.+ The whole country is still one click away: the minimap's whole-map button.diff --git a/unity/Assets/Map.unity b/unity/Assets/Map.unityindex b80b3038a..fd88a8ff2 100644--- a/unity/Assets/Map.unity+++ b/unity/Assets/Map.unity@@ -531,7 +531,7 @@ MonoBehaviour:m_Name:m_EditorClassIdentifier: Statecraft.Game::Statecraft.Game.Map.CameraRigLookAt: {x: 0, y: 0, z: 0}- Distance: 90000+ Distance: 31000Yaw: 0--- !u!81 &1996827303AudioListener:diff --git a/unity/Assets/Scripts/Map/CameraRig.cs b/unity/Assets/Scripts/Map/CameraRig.csindex 1e1861014..56f8866bf 100644--- a/unity/Assets/Scripts/Map/CameraRig.cs+++ b/unity/Assets/Scripts/Map/CameraRig.cs@@ -11,9 +11,21 @@ namespace Statecraft.Game.Mappublic sealed class CameraRig : MonoBehaviour{public const float Pitch = 50f, Fov = 35f;- // The opening zoom: under the ~106 km where a 16:9 view grows wider than the map and CameraController centres it- // (issue #1062: at 120 km the map could not be panned left or right).- public Vector3 LookAt; public float Distance = 90000f; public float Yaw;+ /// <summary>The opening zoom (Map.unity's rig carries the same value). The owner, 3 November 2026: "Open at ~30 km, like+ /// the promo"; PromoPose.Gameplay03 notes that promo 03's geography needs a 25-30 km view. Below TownModelLayer.CloseEnterM,+ /// so Tal Heuberger's building models draw from the first frame; 1 km above the 30 km where RoadVehicles and the+ /// collection layers (ProductionResidency) come in, so the opening is not on a switch's edge. Well under the ~106 km where+ /// a 16:9 view grows wider than the map and CameraController centres it (issue #1062: at 120 km the map could not be+ /// panned left or right). The whole country is the minimap's whole-map button (CameraController.MaxDistance).</summary>+ public const float StartDistance = 31000f;+ /// <summary>The opening look-at (MapScene.Build): Tel Aviv and Jaffa near the middle of the view. The latitude is the+ /// midpoint of Tel Aviv (32.08N) and Jaffa (32.0522N), content/map/settlements_1948.yaml:32 and :46. The longitude is+ /// Jaffa's (34.7531E, :45) moved inland by a sixth of the 16:9 view's width at StartDistance (34.75 km / 6 = 5.79 km,+ /// 0.0614 degrees at this latitude), so Jaffa sits at the left edge of the middle third and Tel Aviv (34.78E, :31) about+ /// 3 km left of the middle, without half the view being sea. TopInset already puts the look-at in the middle of the+ /// map area below the top bar.</summary>+ public const double StartLon = 34.8145, StartLat = 32.0661;+ public Vector3 LookAt; public float Distance = StartDistance; public float Yaw;/// <summary>Share of the screen height (0..1) the UI covers at the top. The view is shifted so LookAt sits in the/// middle of the map area below it (an off-centre frustum: picking rays and WorldToScreenPoint follow it).</summary>public float TopInset;diff --git a/unity/Assets/Scripts/Map/FrameProfile.cs b/unity/Assets/Scripts/Map/FrameProfile.csindex 935a238c0..ec7a5cb4d 100644--- a/unity/Assets/Scripts/Map/FrameProfile.cs+++ b/unity/Assets/Scripts/Map/FrameProfile.cs@@ -41,7 +41,8 @@ namespace Statecraft.Game.Mapwebgl ? UrlFlags.Has(url, "vmoving") : args.Contains("-vmoving");/// <summary>Issue #659: "vclose" with "vprofile" in the WebGL URL (or -vclose on desktop) also prices the close views- /// (PromoPose.CloseUps), where the towns are Tal Heuberger's building models; their lines carry those poses' names.</summary>+ /// (PromoPose.CloseUps) and the game's opening view ("opening"), where the towns are Tal Heuberger's building models;+ /// their lines carry those poses' names.</summary>public static bool CloseRequested() =>CloseRequested(Application.absoluteURL, Environment.GetCommandLineArgs(), Application.platform == RuntimePlatform.WebGLPlayer);@@ -89,7 +90,13 @@ namespace Statecraft.Game.Mapconfigs.Add(("none", "*"));bool first = true;var poses = new List<PromoPose>(PromoPose.All);- if (CloseRequested()) poses.AddRange(PromoPose.CloseUps);+ // With vclose, also the game's own opening view (CameraRig's start; owner, 3 November 2026), where every player+ // meets the building models first.+ if (CloseRequested())+ {+ poses.AddRange(PromoPose.CloseUps);+ poses.Add(new PromoPose("opening", CameraRig.StartLon, CameraRig.StartLat, CameraRig.StartDistance, 0f));+ }foreach (var pose in poses){pose.Apply(rig, frame);diff --git a/unity/Assets/Scripts/Map/MapScene.cs b/unity/Assets/Scripts/Map/MapScene.csindex a3c7f9d4f..1c2248744 100644--- a/unity/Assets/Scripts/Map/MapScene.cs+++ b/unity/Assets/Scripts/Map/MapScene.cs@@ -861,7 +861,9 @@ namespace Statecraft.Game.Map}if (!cam.TryGetComponent(out CameraRig rig)) rig = cam.gameObject.AddComponent<CameraRig>();- rig.LookAt = Frame.ToWorld(34.95, 31.95, 0); rig.Init(); // central Israel: Tel Aviv–Jerusalem corridor+ // The opening: Tel Aviv and Jaffa near the middle (CameraRig.StartLon/StartLat) at CameraRig.StartDistance (owner,+ // 3 November 2026: "Open at ~30 km, like the promo").+ rig.LookAt = Frame.ToWorld(CameraRig.StartLon, CameraRig.StartLat, 0); rig.Init();rig.Volume.transform.SetParent(transform, true);// VolumeProfile's own teardown only releases its components, it does not destroy them (Core RP 17.3), so own both.var assets = terrainGo.GetComponent<MapRuntimeAssets>();diff --git a/unity/Assets/Tests/EditMode/CameraInputTests.cs b/unity/Assets/Tests/EditMode/CameraInputTests.csindex 95692428d..05711fdf9 100644--- a/unity/Assets/Tests/EditMode/CameraInputTests.cs+++ b/unity/Assets/Tests/EditMode/CameraInputTests.cs@@ -405,6 +405,20 @@ public class CameraInputTestsfinally { Object.DestroyImmediate(rig.gameObject); }}+ /// <summary>The owner, 3 November 2026: "Open at ~30 km, like the promo". The opening zoom is about 30 km, close enough+ /// for the building models (TownModelLayer.CloseAt), clear of the 30 km edge where RoadVehicles and the collection+ /// layers switch (so the first frame does not depend on rounding), and under the minimap's whole-map zoom+ /// (CameraController.MaxDistance, where the view is wider than the map: AViewWiderThanTheMapIsCentredAndZoomingOutNeverJumps).</summary>+ [Test]+ public void TheGameOpensAtAbout30KmWithTheBuildingModels()+ {+ float start = CameraRig.StartDistance;+ Assert.That(start, Is.InRange(25000f, 35000f), "about 30 km (owner, 3 November 2026)");+ Assert.IsTrue(Statecraft.Game.Map.Kits.TownModelLayer.CloseAt(start, null), "the building models draw at the opening");+ Assert.GreaterOrEqual(Mathf.Abs(start - Statecraft.Game.Map.Routes.RoadVehicles.CloseEnterM), 500f, "not on the road vehicles' edge");+ Assert.Less(start, CameraController.MaxDistance, "the whole-map zoom is farther out");+ }+/// <summary>Issue #174: over low ground the look-at point stays on y = 0 (the approved framing); over ground high enough/// to come within MinClearanceShare of the camera, it is lifted just enough, and dropped again on the way back down.</summary>[Test]diff --git a/unity/Assets/Tests/EditMode/FarMapWideResidencyTests.cs b/unity/Assets/Tests/EditMode/FarMapWideResidencyTests.csindex fa91eca5e..84165776d 100644--- a/unity/Assets/Tests/EditMode/FarMapWideResidencyTests.cs+++ b/unity/Assets/Tests/EditMode/FarMapWideResidencyTests.cs@@ -313,7 +313,7 @@ public sealed class FarMapWideResidencyTestsvar towns = TownLandmarks.ShowAt(map, new DateTime(1949, 1, 1), Array.Empty<Placement>(), content)!;var mapped = towns.Wanted.Where(w => w.OnTown).ToList();CollectionAssert.AreEquivalent(mapped.Select(w => w.Model).Distinct().ToList(), requested,- "the 90 km start view requests every wanted whole-town Far model map-wide");+ "the map's build requests every wanted whole-town Far model map-wide");CollectionAssert.AreEquivalent(mapped.Select(w => w.Key).ToList(), towns.Seats.Keys.ToList(),"every mapped town draws even when towns share one requested model");@@ -325,7 +325,7 @@ public sealed class FarMapWideResidencyTeststowns.Choose(default, camera);foreach (var want in mapped)Assert.IsFalse(towns.transform.Find(want.Key).GetComponentsInChildren<Renderer>(true).All(r => r.forceRenderingOff),- want.Key + " draws at the 90 km start view");+ want.Key + " draws at the 90 km view");camera.transform.position = new Vector3(focus.At.x, 10000f, focus.At.y);towns.Choose(default, camera);diff --git a/unity/Assets/Tests/EditMode/TalModelsShots.cs b/unity/Assets/Tests/EditMode/TalModelsShots.csindex 7ad8ea4de..737d50ca8 100644--- a/unity/Assets/Tests/EditMode/TalModelsShots.cs+++ b/unity/Assets/Tests/EditMode/TalModelsShots.cs@@ -317,7 +317,7 @@ public class TalModelsShots}/// <summary>Owner ruling, 2 November 2026, "Yes, small buildings at every zoom": Tel Aviv, Jerusalem, Haifa and Jaffa from- /// the opening view (the game's own camera, 90 km), the widest zoom (diorama02, 250 km), and each city at 90 km and+ /// the opening view (the game's own camera, CameraRig.StartDistance), the widest zoom (diorama02, 250 km), and each city at 90 km and/// 30 km, with the town layers' requests (whole towns and buildings) answered with the editor's prefabs, as the player's/// stream would answer them. Each frame logs its draw cost: the building models' instances, triangles and instanced/// draws (TownModelLayer), the whole-town models in view and their triangles (TownLandmarks), and the median render time.diff --git a/unity/Assets/Tests/EditMode/TiltShiftTests.cs b/unity/Assets/Tests/EditMode/TiltShiftTests.csindex 836c42828..249b4c79c 100644--- a/unity/Assets/Tests/EditMode/TiltShiftTests.cs+++ b/unity/Assets/Tests/EditMode/TiltShiftTests.cs@@ -94,7 +94,7 @@ public class TiltShiftTestspublic void TheFarBandIsLighterAtTheGameplayZoom(){Assert.AreEqual(TiltShift.FarGameplayStrength, TiltShift.FarStrength(PromoPose.Gameplay03.Distance), 1e-6f);- Assert.AreEqual(TiltShift.FarGameplayStrength, TiltShift.FarStrength(90000f), 1e-6f, "CameraRig's starting zoom");+ Assert.AreEqual(TiltShift.FarGameplayStrength, TiltShift.FarStrength(CameraRig.StartDistance), 1e-6f, "CameraRig's starting zoom");Assert.AreEqual(1f, TiltShift.FarStrength(CameraController.MaxDistance), 1e-6f, "the overview keeps it in full");Assert.Less(TiltShift.FarStrength(200000f), 1f); Assert.Greater(TiltShift.FarStrength(200000f), TiltShift.FarGameplayStrength);var p = TiltShift.Params(0.09f, 60000f);@@ -109,7 +109,7 @@ public class TiltShiftTests{Assert.That(TiltShift.NearGameplayStrength, Is.InRange(0.5f, 0.9f), "lighter than before, but a tilt-shift");Assert.AreEqual(TiltShift.NearGameplayStrength, TiltShift.NearStrength(PromoPose.Gameplay03.Distance), 1e-6f);- Assert.AreEqual(TiltShift.NearGameplayStrength, TiltShift.NearStrength(90000f), 1e-6f, "CameraRig's starting zoom");+ Assert.AreEqual(TiltShift.NearGameplayStrength, TiltShift.NearStrength(CameraRig.StartDistance), 1e-6f, "CameraRig's starting zoom");Assert.AreEqual(0f, TiltShift.NearStrength(CameraController.MaxDistance), 1e-6f, "none at the overview");Assert.Less(TiltShift.NearStrength(200000f), TiltShift.NearGameplayStrength); Assert.Greater(TiltShift.NearStrength(200000f), 0f);Assert.AreEqual(0.35f, TiltShift.FarGameplayStrength, "the far band is the #390 ruling's");@@ -181,7 +181,8 @@ public class TiltShiftTests/// <summary>Issue #390, the owner's ruling (2026-10-13): a lighter tilt-shift at the gameplay zoom, so the far towns and/// tokens stay readable, as on promo 03, whose far edge is only gently soft. At gameplay03 (60 km), the starting zoom- /// (CameraRig's 90 km, #1062) and the README map's 120 km, under the web tier's top bar, the far band keeps at least+ /// (CameraRig.StartDistance, 31 km since the owner's 3 November 2026 ruling), 90 km (the starting zoom before it, #1062)+ /// and the README map's 120 km, under the web tier's top bar, the far band keeps at least/// 60% of its local contrast (4abb64f kept 14-25%: a smear). Promo 03's far band, measured against its own focus band and/// compared with the same ratio on a sharp frame of ours, keeps about 37%, so 60% is at least as readable.</summary>[UnityTest]@@ -193,7 +194,7 @@ public class TiltShiftTestsvar cam = Camera.main; var rig = cam.GetComponent<CameraRig>();try{- foreach (var distance in new[] { PromoPose.Gameplay03.Distance, 90000f, 120000f }) // 90 km: CameraRig's starting zoom; 120 km: the README map+ foreach (var distance in new[] { PromoPose.Gameplay03.Distance, CameraRig.StartDistance, 90000f, 120000f }) // 120 km: the README map{PromoPose.Gameplay03.Apply(rig, map.Frame); rig.Distance = distance; rig.TopInset = 0.09f; rig.Apply();TiltShift.Enabled = false; var sharp = RenderSample.Render(cam, 960, 540);diff --git a/unity/Assets/Tests/EditMode/TownLandmarksTests.cs b/unity/Assets/Tests/EditMode/TownLandmarksTests.csindex 3a38460d5..8bdf93223 100644--- a/unity/Assets/Tests/EditMode/TownLandmarksTests.cs+++ b/unity/Assets/Tests/EditMode/TownLandmarksTests.cs@@ -309,8 +309,8 @@ public class TownLandmarksTests/// <summary>The swap with #700's building models: the landmarks draw where TownModelLayer draws the kits' far view and/// hide where it draws the building models (TownModelLayer.CloseAt: in below CloseEnterM, out above CloseExitM), with- /// the same hysteresis, at the start view (90 km), the gameplay view (60 km), both sides of the band and the closest- /// zoom.</summary>+ /// the same hysteresis, at the start view (CameraRig.StartDistance, 31 km), 90 km, the gameplay view (60 km), both sides+ /// of the band and the closest zoom.</summary>[Test]public void TheLandmarksSwapWithTheBuildingModelsAtTheThreshold(){@@ -323,7 +323,8 @@ public class TownLandmarksTestsvar tel = map.KitFootprints.First(f => f.id == "tel_aviv").centre;foreach (var (d, close, why) in new[]{- (90000f, false, "the start view"), (60000f, false, "the gameplay view"),+ (CameraRig.StartDistance, true, "the start view (owner, 3 November 2026: open at ~30 km)"),+ (90000f, false, "90 km"), (60000f, false, "the gameplay view"),(TownModelLayer.CloseEnterM + 1000f, false, "inside the band, coming in"), (TownModelLayer.CloseEnterM - 1000f, true, "past the threshold"),(TownModelLayer.CloseExitM - 2000f, true, "inside the band, going out"), (TownModelLayer.CloseExitM + 1000f, false, "out of the band"),(CameraController.MinDistance, true, "the closest zoom"),diff --git a/unity/Assets/Tests/EditMode/UnitRosterFallbackTests.cs b/unity/Assets/Tests/EditMode/UnitRosterFallbackTests.csindex 385d11c16..802b464e1 100644--- a/unity/Assets/Tests/EditMode/UnitRosterFallbackTests.cs+++ b/unity/Assets/Tests/EditMode/UnitRosterFallbackTests.cs@@ -75,7 +75,7 @@ public class UnitRosterFallbackTestsvar pending = new Dictionary<string, Action<GameObject?>>(StringComparer.Ordinal);UnitFigures.Source = (id, detail, done) =>{- Assert.AreEqual(CollectionDetail.Far, detail, "no Near request at the start view");+ Assert.AreEqual(CollectionDetail.Far, detail, "no Near request at the 90 km view");pending[id] = done;};return pending;diff --git a/unity/Assets/Tests/EditMode/UnitRosterResidencyTests.cs b/unity/Assets/Tests/EditMode/UnitRosterResidencyTests.csindex 17c5e5494..fcb9f2710 100644--- a/unity/Assets/Tests/EditMode/UnitRosterResidencyTests.cs+++ b/unity/Assets/Tests/EditMode/UnitRosterResidencyTests.cs@@ -20,7 +20,9 @@ using Object = UnityEngine.Object;/// controls Near only, so leaving the approved unit band retires close detail without leaving a drawn bare plinth.</summary>public class UnitRosterResidencyTests{- const float StartViewM = 90000f;+ // A strategic view outside camera residency (ProductionResidency: in at 30 km, out at 40 km); the game opened here until+ // the owner's 3 November 2026 ruling (CameraRig.StartDistance).+ const float StrategicViewM = 90000f;const float DisplacedViewM = 11800f;const int DeferredRetirementSteps = 3;const int NoOwners = 0;@@ -159,7 +161,7 @@ public class UnitRosterResidencyTestsforeach (var holder in holders)Assert.AreEqual(OneOwnerPerFarKey, holder.ResidencySnapshot().ownedLeases,$"{holder.transform.parent.name}/{holder.name}: one owner for its one retained (model, Far) key");- // These holder-count equalities assume the fixture's 90 km start view, where no Near lease is requested.+ // These holder-count equalities assume the fixture's 90 km view, where no Near lease is requested.Assert.AreEqual(holders.Length, UnitFigures.OwnedRefCount, "no extra model owner remains beside the drawn holders");Assert.AreEqual(holders.Length, UnitFigures.OwnedDetailRefCount, "no extra detail owner remains beside the drawn holders");@@ -222,7 +224,7 @@ public class UnitRosterResidencyTests{var map = BuildMap();var pending = PendingSource();- var camera = TopDownCamera(StartViewM, Vector3.zero);+ var camera = TopDownCamera(StrategicViewM, Vector3.zero);try{var rows = Rows;@@ -238,7 +240,7 @@ public class UnitRosterResidencyTestsvar layer = UnitLayer.Create(map, rows, C.Hexes, still: true);layer.Show(C, state);foreach (var holder in layer.GetComponentsInChildren<UnitFigureResidency>(true)) holder.Choose(default, camera);- Assert.AreEqual(StartViewM, TownModelLayer.ViewDistance(camera), 1f, "the verified 90 km start view");+ Assert.AreEqual(StrategicViewM, TownModelLayer.ViewDistance(camera), 1f, "the verified 90 km view");AnswerAll(pending);@@ -364,7 +366,7 @@ public class UnitRosterResidencyTestsAssert.IsNotNull(piece.transform.Find(UnitFigures.ModelName + "/" + UnitFigureDetail.NearName),"enter creates the Near clone");- camera.transform.position = new Vector3(0f, StartViewM, 0f);+ camera.transform.position = new Vector3(0f, StrategicViewM, 0f);owner.Choose(default, camera);detail.Choose(default, camera);Assert.IsNull(piece.transform.Find(UnitFigures.ModelName + "/" + UnitFigureDetail.NearName),@@ -401,7 +403,7 @@ public class UnitRosterResidencyTests}var policy = ProductionResidency.Approved().Units;var close = TopDownCamera(DisplacedViewM, Vector3.zero);- var strategic = TopDownCamera(StartViewM, Vector3.zero);+ var strategic = TopDownCamera(StrategicViewM, Vector3.zero);try{var owner = piece.AddComponent<UnitFigureResidency>();