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: MATKOT's Tegart fort, barracks and factory at their sourced places, at the train's scale (refs #707) (#1031)

Eyal Golan6ef26c92d381
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3a2faca30..708900658 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,13 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
civilians (#666) and wildlife (#670), with the kit trees over them left out.
They stand at the #700 buildings' one world scale (24x real: a tractor about a third of the steam train's locomotive,
a sheep about a seventh), stream after the first frame, and play their idle clip only at close zoom (40 km) (#667).
+- MATKOT's Tegart fort, military barracks and factory models stand at their sourced places from their sourced days,
+ close up only (#700's switch): the Latrun police fort from 15 May 1948, the Tzrifin camp from 19 May 1948, Camp 80
+ from 13 July 1948 and Netanya's industrial zone from 28 July 1950, clear of the towns, routes, unit tokens, civilians
+ (#666) and wildlife (#670), with the kit trees on them left out. They are sized at the #700 buildings' one world
+ scale (24x real, an 8.5 m house as long as the steam train's locomotive), and stream after the first frame in a new
+ `collection-special-buildings` bundle with the shikun and the workshop, which stay unplaced until a place and date are
+ sourced (refs #707).
- Kiryat Shmona (founded 18 July 1949) and Beit Shemesh (15 December 1950, the National Library's December 1950
under the monthly turn) join the yishuv sites in `content/sites.yaml`, each with a field site in its hex; the
founding days are the owner's (#785), and the rows stay draft. The reference player builds them in id order, so
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b11-shikun-housing-v2/b11-shikun-housing-v2-stream.prefab b/unity/Assets/Art/Settlements/Prototype/Models/b11-shikun-housing-v2/b11-shikun-housing-v2-stream.prefab
new file mode 100644
index 000000000..3d14b3d26
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b11-shikun-housing-v2/b11-shikun-housing-v2-stream.prefab
@@ -0,0 +1,63 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &7736103055382667988
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ serializedVersion: 3
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalPosition.x
+ value: -0.000000014901161
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalPosition.z
+ value: -0.000000029802322
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 0.7071067
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0.7071068
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -7511558181221131132, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: 'm_Materials.Array.data[0]'
+ value:
+ objectReference: {fileID: 2100000, guid: 57d4cd0fc74ad45638eacc0669b0bd2a, type: 2}
+ - target: {fileID: 919132149155446097, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
+ propertyPath: m_Name
+ value: b11-shikun-housing-v2-stream
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_RemovedGameObjects: []
+ m_AddedGameObjects: []
+ m_AddedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: ffb2571b53a734e8a8001742bb414535, type: 3}
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b11-shikun-housing-v2/b11-shikun-housing-v2-stream.prefab.meta b/unity/Assets/Art/Settlements/Prototype/Models/b11-shikun-housing-v2/b11-shikun-housing-v2-stream.prefab.meta
new file mode 100644
index 000000000..374502d30
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b11-shikun-housing-v2/b11-shikun-housing-v2-stream.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 6389c6fec10014102b7d29637dd90834
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b12-tegart-fort-v2/b12-tegart-fort-v2-stream.prefab b/unity/Assets/Art/Settlements/Prototype/Models/b12-tegart-fort-v2/b12-tegart-fort-v2-stream.prefab
new file mode 100644
index 000000000..69fb2f885
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b12-tegart-fort-v2/b12-tegart-fort-v2-stream.prefab
@@ -0,0 +1,63 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &1037178093937838390
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ serializedVersion: 3
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalPosition.x
+ value: -0.000000029802322
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalPosition.z
+ value: 0.000000014901161
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 0.7071067
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0.7071068
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -7511558181221131132, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: 'm_Materials.Array.data[0]'
+ value:
+ objectReference: {fileID: 2100000, guid: e5c41e72f25504972b32e8ce07bb3cc3, type: 2}
+ - target: {fileID: 919132149155446097, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
+ propertyPath: m_Name
+ value: b12-tegart-fort-v2-stream
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_RemovedGameObjects: []
+ m_AddedGameObjects: []
+ m_AddedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: 5fb90a4b27428410d9fb64eacec9ad3c, type: 3}
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b12-tegart-fort-v2/b12-tegart-fort-v2-stream.prefab.meta b/unity/Assets/Art/Settlements/Prototype/Models/b12-tegart-fort-v2/b12-tegart-fort-v2-stream.prefab.meta
new file mode 100644
index 000000000..928a9d80a
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b12-tegart-fort-v2/b12-tegart-fort-v2-stream.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: a3dccc365dc374f449be36a73ed70851
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b18-military-barracks-v2/b18-military-barracks-v2-stream.prefab b/unity/Assets/Art/Settlements/Prototype/Models/b18-military-barracks-v2/b18-military-barracks-v2-stream.prefab
new file mode 100644
index 000000000..b9d398faf
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b18-military-barracks-v2/b18-military-barracks-v2-stream.prefab
@@ -0,0 +1,63 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &6912449982862434975
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ serializedVersion: 3
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalPosition.x
+ value: 0.000000014901161
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalPosition.z
+ value: -0.000000022351742
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 0.7071067
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0.7071068
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -7511558181221131132, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: 'm_Materials.Array.data[0]'
+ value:
+ objectReference: {fileID: 2100000, guid: a9103dc309d4c4dc8929a8b769d9b89b, type: 2}
+ - target: {fileID: 919132149155446097, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
+ propertyPath: m_Name
+ value: b18-military-barracks-v2-stream
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_RemovedGameObjects: []
+ m_AddedGameObjects: []
+ m_AddedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: 5c381176082d441ae89066fc5b17e79f, type: 3}
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b18-military-barracks-v2/b18-military-barracks-v2-stream.prefab.meta b/unity/Assets/Art/Settlements/Prototype/Models/b18-military-barracks-v2/b18-military-barracks-v2-stream.prefab.meta
new file mode 100644
index 000000000..a74d98807
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b18-military-barracks-v2/b18-military-barracks-v2-stream.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 920f6904e75584d2faf7b8d9caff09de
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b21-artisan-workshop-v2/b21-artisan-workshop-v2-stream.prefab b/unity/Assets/Art/Settlements/Prototype/Models/b21-artisan-workshop-v2/b21-artisan-workshop-v2-stream.prefab
new file mode 100644
index 000000000..04b557725
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b21-artisan-workshop-v2/b21-artisan-workshop-v2-stream.prefab
@@ -0,0 +1,63 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &3583205660993987734
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ serializedVersion: 3
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalPosition.x
+ value: -0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalPosition.z
+ value: -0.000000014901161
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 0.7071067
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0.7071068
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -7511558181221131132, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: 'm_Materials.Array.data[0]'
+ value:
+ objectReference: {fileID: 2100000, guid: e2485eb9ea0174718ace8fdcdbfb5a29, type: 2}
+ - target: {fileID: 919132149155446097, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
+ propertyPath: m_Name
+ value: b21-artisan-workshop-v2-stream
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_RemovedGameObjects: []
+ m_AddedGameObjects: []
+ m_AddedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: 8f82f7b4f951e48cd87463e4987f3275, type: 3}
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b21-artisan-workshop-v2/b21-artisan-workshop-v2-stream.prefab.meta b/unity/Assets/Art/Settlements/Prototype/Models/b21-artisan-workshop-v2/b21-artisan-workshop-v2-stream.prefab.meta
new file mode 100644
index 000000000..db3395c1d
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b21-artisan-workshop-v2/b21-artisan-workshop-v2-stream.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f652e160cc2f64f4aa9a4df54e071d20
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b22-industrial-factory-v2/b22-industrial-factory-v2-stream.prefab b/unity/Assets/Art/Settlements/Prototype/Models/b22-industrial-factory-v2/b22-industrial-factory-v2-stream.prefab
new file mode 100644
index 000000000..431b03b39
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b22-industrial-factory-v2/b22-industrial-factory-v2-stream.prefab
@@ -0,0 +1,63 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1001 &1106697333429869360
+PrefabInstance:
+ m_ObjectHideFlags: 0
+ serializedVersion: 2
+ m_Modification:
+ serializedVersion: 3
+ m_TransformParent: {fileID: 0}
+ m_Modifications:
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalPosition.x
+ value: -0.00048823655
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalPosition.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalPosition.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalRotation.w
+ value: 0.7071067
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalRotation.x
+ value: -0.7071068
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalRotation.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalRotation.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.y
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -8679921383154817045, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_LocalEulerAnglesHint.z
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: -7511558181221131132, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: 'm_Materials.Array.data[0]'
+ value:
+ objectReference: {fileID: 2100000, guid: 053cb9f87bbc34c698392ab1cc43e2bd, type: 2}
+ - target: {fileID: 919132149155446097, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
+ propertyPath: m_Name
+ value: b22-industrial-factory-v2-stream
+ objectReference: {fileID: 0}
+ m_RemovedComponents: []
+ m_RemovedGameObjects: []
+ m_AddedGameObjects: []
+ m_AddedComponents: []
+ m_SourcePrefab: {fileID: 100100000, guid: 4d00510a6661b4f27b5b8da10e0f9b37, type: 3}
diff --git a/unity/Assets/Art/Settlements/Prototype/Models/b22-industrial-factory-v2/b22-industrial-factory-v2-stream.prefab.meta b/unity/Assets/Art/Settlements/Prototype/Models/b22-industrial-factory-v2/b22-industrial-factory-v2-stream.prefab.meta
new file mode 100644
index 000000000..197216e10
--- /dev/null
+++ b/unity/Assets/Art/Settlements/Prototype/Models/b22-industrial-factory-v2/b22-industrial-factory-v2-stream.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: beabc107d12e1463ca2457c99396e287
+PrefabImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Editor/CollectionImport.cs b/unity/Assets/Editor/CollectionImport.cs
index fd95ba8e6..ffb0022f8 100644
--- a/unity/Assets/Editor/CollectionImport.cs
+++ b/unity/Assets/Editor/CollectionImport.cs
@@ -24,13 +24,13 @@ namespace Statecraft.Game.EditorTools
public static void Run()
{
- foreach (var id in CollectionCatalog.Ids)
+ foreach (var id in CollectionCatalog.Ids.Where(id => CollectionCatalog.BundleOf(id) != CollectionCatalog.Buildings))
{
ImportModel(Model(id, CollectionDetail.Far), animated: false);
ImportModel(Model(id, CollectionDetail.Near), animated: CollectionCatalog.Animated.Contains(id));
ImportColourMap($"{Dir(id)}/{id}_basecolor.jpg");
}
- foreach (var id in CollectionCatalog.Ids)
+ foreach (var id in CollectionCatalog.Ids.Where(id => CollectionCatalog.BundleOf(id) != CollectionCatalog.Buildings))
{
var mat = AssetDatabase.LoadAssetAtPath<Material>($"{Dir(id)}/{id}.mat")
?? throw new InvalidOperationException($"{id}: no material");
@@ -39,7 +39,31 @@ namespace Statecraft.Game.EditorTools
MakePrefab(id, CollectionDetail.Near, mat, CollectionCatalog.Animated.Contains(id) ? IdleController(id) : null);
}
AssetDatabase.SaveAssets();
- Debug.Log($"CollectionImport: {CollectionCatalog.Ids.Count()} models");
+ MakeBuildingPrefabs();
+ Debug.Log($"CollectionImport: {CollectionCatalog.Ids.Count(id => CollectionCatalog.BundleOf(id) != CollectionCatalog.Buildings)} collection models");
+ }
+
+ /// <summary>Issue #707: the special-buildings bundle's prefabs, one per model, beside #675's imported model in its own
+ /// folder (CollectionCatalog.PrefabPath): the model with its own material on every renderer. The models' import
+ /// settings are #675's and are left as they are.</summary>
+ public static void MakeBuildingPrefabs()
+ {
+ foreach (var id in CollectionCatalog.Bundles.Single(b => b.Bundle == CollectionCatalog.Buildings).Ids)
+ {
+ string dir = $"{CollectionCatalog.BuildingsFolder}/{id}";
+ var model = AssetDatabase.LoadAssetAtPath<GameObject>($"{dir}/{id}.fbx") ?? throw new InvalidOperationException($"{id}: no model");
+ var mat = AssetDatabase.LoadAssetAtPath<Material>($"{dir}/{id}.mat") ?? throw new InvalidOperationException($"{id}: no material");
+ var go = (GameObject)PrefabUtility.InstantiatePrefab(model);
+ try
+ {
+ foreach (var r in go.GetComponentsInChildren<Renderer>(true))
+ r.sharedMaterials = Enumerable.Repeat(mat, Math.Max(1, r.sharedMaterials.Length)).ToArray();
+ PrefabUtility.SaveAsPrefabAsset(go, CollectionCatalog.PrefabPath(id, CollectionDetail.Near));
+ }
+ finally { UnityEngine.Object.DestroyImmediate(go); }
+ }
+ AssetDatabase.SaveAssets();
+ Debug.Log("CollectionImport: the five special-building prefabs (#707)");
}
static void ImportModel(string path, bool animated)
@@ -153,7 +177,7 @@ namespace Statecraft.Game.EditorTools
public static AssetBundleBuild[] Builds() => CollectionCatalog.Bundles.Select(b => new AssetBundleBuild
{
assetBundleName = b.Bundle,
- assetNames = b.Ids.SelectMany(id => new[] { CollectionCatalog.PrefabPath(id, CollectionDetail.Far), CollectionCatalog.PrefabPath(id, CollectionDetail.Near) }).ToArray(),
+ assetNames = b.Ids.SelectMany(id => new[] { CollectionCatalog.PrefabPath(id, CollectionDetail.Far), CollectionCatalog.PrefabPath(id, CollectionDetail.Near) }).Distinct().ToArray(),
}).ToArray();
/// <summary>Writes <see cref="CollectionCatalog.ChecksFile"/> into <paramref name="folder"/> for the built
diff --git a/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs b/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs
index d39df6304..84c8a252c 100644
--- a/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs
+++ b/unity/Assets/Scripts/Map/Collection/CollectionCatalog.cs
@@ -63,7 +63,7 @@ namespace Statecraft.Game.Map.Collection
}
public const string People = "collection-people", Vehicles = "collection-vehicles", Animals = "collection-animals",
- Towns = "collection-towns";
+ Towns = "collection-towns", Buildings = "collection-special-buildings";
/// <summary>Every bundle, with its models in a fixed order.</summary>
public static readonly IReadOnlyList<(string Bundle, string[] Ids)> Bundles = new (string, string[])[]
@@ -96,6 +96,11 @@ namespace Statecraft.Game.Map.Collection
"tel-aviv-white-city-v1", "jerusalem-stone-city-v1", "haifa-port-city-v1", "moshava-town-v1", "nahalal-moshav-v1",
"kibbutz-compound-v2", "stone-village-v1", "maabara-camp-v1", "shikun-housing-v1",
}),
+ (Buildings, new[]
+ {
+ "b11-shikun-housing-v2", "b12-tegart-fort-v2", "b18-military-barracks-v2",
+ "b21-artisan-workshop-v2", "b22-industrial-factory-v2",
+ }),
};
/// <summary>The models whose near prefab is skinned and plays its idle clip: every person but C05 (his only idle is
@@ -118,8 +123,14 @@ namespace Statecraft.Game.Map.Collection
return null;
}
+ /// <summary>Where #675 imported MATKOT's single-building models; the special-buildings bundle's prefabs (#707) sit
+ /// beside each model there, one prefab for both details (the buildings draw only close up).</summary>
+ public const string BuildingsFolder = "Assets/Art/Settlements/Prototype/Models";
+
/// <summary>The prefab's project path, which is also its name inside the bundle (lower case there).</summary>
public static string PrefabPath(string id, CollectionDetail detail) =>
- $"{Folder}/{id}/{id}-{(detail == CollectionDetail.Far ? "far" : "near")}.prefab";
+ BundleOf(id) == Buildings
+ ? $"{BuildingsFolder}/{id}/{id}-stream.prefab"
+ : $"{Folder}/{id}/{id}-{(detail == CollectionDetail.Far ? "far" : "near")}.prefab";
}
}
diff --git a/unity/Assets/Scripts/Map/Collection/SpecialBuildingModels.cs b/unity/Assets/Scripts/Map/Collection/SpecialBuildingModels.cs
new file mode 100644
index 000000000..5d0d643c6
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Collection/SpecialBuildingModels.cs
@@ -0,0 +1,207 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Statecraft.Game.Map.Routes;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace Statecraft.Game.Map.Collection
+{
+ /// <summary>Issue #707: MATKOT's single-building models at sourced places. They use the collection stream after the
+ /// first frame, draw only close up (#700's switch, TownModelLayer.CloseEnterM / CloseExitM), follow the game date and
+ /// fail open. b11 and b21 remain catalogued but unplaced until a named, dated shikun estate before 15 January 1952 and
+ /// an artisan-workshop location are sourced.</summary>
+ public sealed class SpecialBuildingModels : MonoBehaviour
+ {
+ public const string Name = "SpecialBuildingModels";
+ public const string Shikun = "b11-shikun-housing-v2", Tegart = "b12-tegart-fort-v2",
+ Barracks = "b18-military-barracks-v2", Workshop = "b21-artisan-workshop-v2",
+ Factory = "b22-industrial-factory-v2";
+
+ /// <summary>The house the world scale is set by (m, real): the middle of the kit's default house, 7.5 to 10 m long.</summary>
+ public const float ReferenceHouseM = 8.5f;
+ /// <summary>The one world scale of MATKOT's building models (the owner on v0.1.1, 18 October 2026: the buildings were
+ /// "way bigger then the train"): the reference house is as long as the locomotive's car of the steam train the map
+ /// runs (ServiceTrain: MATKOT's locomotive and tender at RouteTrain.Scale x ServiceTrain.ModelSize, about 816 m, in
+ /// ServiceTrain.Cars cars of about 204 m), so 204 / 8.5 = 24x a building's real size. The same rule as the #700
+ /// buildings' scale fix (branch map/town-models-world-scale, SettlementKits.ModelScale).</summary>
+ public const float WorldScale = RouteTrain.ModelRealLengthM * RouteTrain.Scale * ServiceTrain.ModelSize / ServiceTrain.Cars / ReferenceHouseM;
+
+ /// <summary>Design values, not sourced measurements: the real long side (m) each model stands for, so that at
+ /// <see cref="WorldScale"/> the fort, the barracks, the factory and the shikun block are each a few locomotive cars
+ /// long and shorter than the whole train, and the workshop is a little over one.</summary>
+ public static float RealLengthM(string model) => model switch
+ {
+ Tegart => 30f, Barracks => 25f, Factory => 30f, Shikun => 30f, Workshop => 12f,
+ _ => throw new ArgumentException($"'{model}' is not one of #707's models", nameof(model)),
+ };
+
+ /// <summary>The model's long side on the map (m), seen from above.</summary>
+ public static float SizeOf(string model) => RealLengthM(model) * WorldScale;
+
+ /// <summary>The disc a placed model keeps clear (m): its half diagonal, as if square.</summary>
+ public static float ClearanceOf(string model) => 0.71f * SizeOf(model);
+
+ // Design value: the bounded deterministic search around each sourced point.
+ public const int SpotAttempts = 24;
+
+ public readonly struct Want
+ {
+ public readonly string Key, Model, Source; public readonly DateTime From; public readonly double Lon, Lat;
+ public Want(string key, string model, DateTime from, double lon, double lat, string source)
+ { Key = key; Model = model; From = from; Lon = lon; Lat = lat; Source = source; }
+ }
+
+ /// <summary>Facts already sourced in the repository. Latrun's police fort (the Arab Legion's gun on the roof of "the
+ /// Latrun Tegart fort, 1948", unit-art sourcing note; the Legion held Latrun from 18 May 1948, routes_1948.yaml) stands
+ /// at the Latrun point of routes_1948.yaml (en.wiki Latrun), from the game's first day: it was built in the
+ /// Mandate's 1940-41 police-station programme (en.wiki Tegart fort, checked 18 October 2026). Tzrifin and Camp 80
+ /// use sites.yaml's sourced dates and coordinates. Netanya's industry: the Jerusalem Post report of 28 July 1950 in
+ /// the Phase 4 sourcing note (waypoint N5) puts "the area set aside for the new industrial zone" at the town's
+ /// entrance, and Netanya's Kiryat Eliezer Kaplan industrial zone was inaugurated in 1949 (en.wiki Netanya, checked
+ /// 18 October 2026).</summary>
+ static readonly Want[] All =
+ {
+ new Want("latrun_tegart", Tegart, new DateTime(1948, 5, 15), 34.98139, 31.83194,
+ "content/map/routes_1948.yaml; research_notes/GDD phase 5/unit-art-sourcing-1948.md"),
+ new Want("tzrifin_barracks", Barracks, new DateTime(1948, 5, 19), 34.8395, 31.9587, "content/sites.yaml: tzrifin"),
+ new Want("camp_80_barracks", Barracks, new DateTime(1948, 7, 13), 34.9866, 32.4628, "content/sites.yaml: camp_80"),
+ new Want("netanya_factory", Factory, new DateTime(1950, 7, 28), 34.8567, 32.3286,
+ "research_notes/gdd-phase-4-sourcing.md: N5; https://en.wikipedia.org/wiki/Netanya (checked 2026-10-18)"),
+ };
+
+ public static IReadOnlyList<Want> Placements(DateTime date) => All.Where(x => date >= x.From).ToList();
+
+ /// <summary>How far inside a town's footprint <paramref name="anchor"/> lies (m, 0 outside every footprint): a sourced
+ /// point at a town's edge (Netanya's entrance) is inside the kit's symbolic footprint, so the search starts that far
+ /// out.</summary>
+ public static float Inside(Vector2 anchor, IEnumerable<(Vector2 centre, float radius)> footprints)
+ {
+ float most = 0f;
+ foreach (var (c, r) in footprints) most = Mathf.Max(most, r - (anchor - c).magnitude);
+ return most;
+ }
+
+ /// <summary>A stable ring search, from <paramref name="from"/> m out. FNV-1a chooses the first bearing; no Unity
+ /// random stream or simulation state moves.</summary>
+ public static Vector2? SeededSpot(string key, Vector2 anchor, float clearance, Func<Vector2, float, bool> free, float from = 0f)
+ {
+ uint h = 2166136261;
+ foreach (char c in key) { h ^= c; h *= 16777619; }
+ int start = (int)(h % SpotAttempts);
+ for (int i = 0; i < SpotAttempts; i++)
+ {
+ int k = (start + i) % SpotAttempts;
+ float angle = 2f * Mathf.PI * k / SpotAttempts;
+ float radius = from + clearance * (1.5f + k / 8);
+ var p = anchor + new Vector2(Mathf.Cos(angle), Mathf.Sin(angle)) * radius;
+ if (free(p, clearance)) return p;
+ }
+ return null;
+ }
+
+ public static Quaternion Rotation(Quaternion prefabRotation, float yaw) =>
+ Quaternion.AngleAxis(yaw, Vector3.up) * prefabRotation;
+
+ internal static Action<string, CollectionDetail, Action<GameObject?>> Request = CollectionStream.Request;
+ readonly Dictionary<string, GameObject?> prefabs = new Dictionary<string, GameObject?>(StringComparer.Ordinal);
+ readonly HashSet<string> asked = new HashSet<string>(StringComparer.Ordinal);
+ readonly Dictionary<int, bool> closeFor = new Dictionary<int, bool>();
+ readonly List<Renderer> renderers = new List<Renderer>();
+ IReadOnlyList<Want> wants = Array.Empty<Want>();
+ MapScene? map; DateTime date; bool shown;
+ public readonly List<(string Key, string Model, Vector3 At)> Placed = new List<(string, string, Vector3)>();
+ public bool FailedOpen { get; private set; }
+ public bool LastClose { get; private set; }
+
+ public static SpecialBuildingModels? ShowAt(MapScene map, DateTime date)
+ {
+ if (map == null || map.Terrain == null || map.Hexes == null) return null;
+ var layer = map.Terrain.transform.Find(Name)?.GetComponent<SpecialBuildingModels>();
+ if (layer == null)
+ {
+ var go = new GameObject(Name); go.transform.SetParent(map.Terrain.transform, false);
+ layer = go.AddComponent<SpecialBuildingModels>(); layer.map = map;
+ }
+ // GameRoot calls this on every refresh: rebuild only when the game date changes (the dated list and the dated
+ // tokens' clearance both follow it).
+ if (layer.shown && layer.date == date) return layer;
+ layer.shown = true; layer.date = date; layer.Show(Placements(date)); return layer;
+ }
+
+ internal void ShowForTest(IReadOnlyList<Want> wants) => Show(wants);
+
+ void Show(IReadOnlyList<Want> wants)
+ {
+ this.wants = wants;
+ foreach (var w in wants)
+ if (asked.Add(w.Model)) { string model = w.Model; Request(model, CollectionDetail.Near, p => { if (this == null) return; prefabs[model] = p; if (p == null) { FailedOpen = true; Debug.LogWarning($"BUILDINGS: {model} did not stream; it stays off the map."); } Rebuild(); }); }
+ Rebuild();
+ }
+
+ void Rebuild()
+ {
+ if (map == null || map.Terrain == null) return;
+ for (int i = transform.childCount - 1; i >= 0; i--)
+ {
+ var old = transform.GetChild(i).gameObject;
+ if (Application.isPlaying) { old.transform.SetParent(null); Destroy(old); } else DestroyImmediate(old);
+ }
+ renderers.Clear(); Placed.Clear();
+ var ground = PlacementLayer.CampGround(map);
+ var footprints = map.KitFootprints.Select(f => (f.centre, f.radius)).ToList();
+ var taken = new List<(Vector2 centre, float radius)>();
+ // The civilian figures (#666, shown first by GameRoot) and the wildlife (#670) keep their ground too.
+ var people = map.Terrain.transform.Find(CivilianPeople.Name)?.GetComponent<CivilianPeople>();
+ if (people != null) foreach (var p in people.Wanted) taken.Add((new Vector2(p.At.x, p.At.z), CivilianPeople.FigureClearanceM));
+ foreach (var a in WildlifeLayer.Wants(map)) taken.Add((a.At, 0.5f * WildlifeLayer.SizeM));
+ bool Free(Vector2 p, float r) => TownLandmarks.Clear(p, r, taken) && TownLandmarks.Clear(p, r, footprints)
+ && ground.Inside(p.x - r, p.y - r) && ground.Inside(p.x + r, p.y + r)
+ && !ground.Water(p.x, p.y) && !ground.OnRoute(p, r) && !ground.OnToken(p, r, date);
+ var holes = new List<(Vector2 centre, float radius)>();
+ foreach (var w in wants)
+ {
+ if (!prefabs.TryGetValue(w.Model, out var prefab) || prefab == null) continue;
+ var anchor3 = map.Frame.ToWorld(w.Lon, w.Lat, 0); var anchor = new Vector2(anchor3.x, anchor3.z);
+ float clearance = ClearanceOf(w.Model);
+ var at = SeededSpot(w.Key, anchor, clearance, Free, Inside(anchor, footprints));
+ if (at == null) { Debug.LogWarning($"BUILDINGS: no clear ground near {w.Key}; its {w.Model} is not drawn."); continue; }
+ taken.Add((at.Value, clearance));
+ holes.Add((at.Value, clearance));
+ var go = Instantiate(prefab, transform, false); go.name = w.Key;
+ go.transform.localRotation = Rotation(prefab.transform.localRotation, 0f);
+ var b = Bounds(go); float edge = Mathf.Max(b.size.x, b.size.z);
+ go.transform.localScale *= edge > 1e-3f ? SizeOf(w.Model) / edge : 1f;
+ var pos = new Vector3(at.Value.x, ground.Y(at.Value.x, at.Value.y), at.Value.y);
+ go.transform.position = pos; b = Bounds(go);
+ go.transform.position += new Vector3(pos.x - b.center.x, pos.y - b.min.y, pos.z - b.center.z);
+ foreach (var r in go.GetComponentsInChildren<Renderer>(true)) { r.shadowCastingMode = ShadowCastingMode.On; r.forceRenderingOff = !LastClose; renderers.Add(r); }
+ Placed.Add((w.Key, w.Model, pos));
+ }
+ // No kit tree stands on a building: the trees whose crowns reach its ground are left out at draw time, as under
+ // the unit figures (Kits.VegetationLayer.Hide).
+ Units.UnitShowcase.HideTrees(map, Name, holes);
+ if (prefabs.Count > 0) Debug.Log($"BUILDINGS: {Placed.Count} of {wants.Count} special buildings placed ({string.Join(", ", Placed.Select(p => p.Key))})");
+ }
+
+ static Bounds Bounds(GameObject go)
+ {
+ var rs = go.GetComponentsInChildren<Renderer>(true); if (rs.Length == 0) return new Bounds(go.transform.position, Vector3.zero);
+ var b = rs[0].bounds; foreach (var r in rs) b.Encapsulate(r.bounds); return b;
+ }
+
+ /// <summary>#700's close-zoom switch with its hysteresis: on at TownModelLayer.CloseEnterM and nearer, off beyond
+ /// TownModelLayer.CloseExitM.</summary>
+ public static bool CloseAt(float distance, bool? was) =>
+ was == true ? distance <= Statecraft.Game.Map.Kits.TownModelLayer.CloseExitM : distance <= Statecraft.Game.Map.Kits.TownModelLayer.CloseEnterM;
+ void OnEnable() => RenderPipelineManager.beginCameraRendering += Choose;
+ void OnDisable() => RenderPipelineManager.beginCameraRendering -= Choose;
+ internal void Choose(ScriptableRenderContext context, Camera cam)
+ {
+ if (cam.cameraType == CameraType.Preview || cam.cameraType == CameraType.Reflection) return;
+ int id = cam.GetInstanceID(); bool close = CloseAt(TownLandmarks.ViewDistance(cam), closeFor.TryGetValue(id, out var was) ? was : (bool?)null);
+ closeFor[id] = close; LastClose = close; foreach (var r in renderers) if (r != null) r.forceRenderingOff = !close;
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Collection/SpecialBuildingModels.cs.meta b/unity/Assets/Scripts/Map/Collection/SpecialBuildingModels.cs.meta
new file mode 100644
index 000000000..9b41a7468
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Collection/SpecialBuildingModels.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 8e3d271bd5124e08b8eb5cbf62b886b9
diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.cs
index e981b272c..9092ccc5e 100644
--- a/unity/Assets/Scripts/UI/GameRoot.cs
+++ b/unity/Assets/Scripts/UI/GameRoot.cs
@@ -452,6 +452,8 @@ namespace Statecraft.Game.UI
Statecraft.Game.Map.Collection.CivilianPeople.ShowAt(map, Bridge.State.Date, Bridge.State.Placements, Bridge.Content);
// MATKOT's period-generic farm and village scenery, streamed after the first frame (#667); never game units.
Statecraft.Game.Map.Collection.RuralLife.Show(map);
+ // MATKOT's Tegart fort, barracks and factory at their sourced places and dates, close up only, streamed (#707).
+ Statecraft.Game.Map.Collection.SpecialBuildingModels.ShowAt(map, Bridge.State.Date);
RenderSitesIfChanged();
var now = Bridge.State.Placements.Select(p => (p.Action, p.Q, p.R, p.Date)).ToList();
if (drawn != null && drawn.SequenceEqual(now)) return;
diff --git a/unity/Assets/Tests/EditMode/BuildingModelImportTests.cs b/unity/Assets/Tests/EditMode/BuildingModelImportTests.cs
index bb3f8b130..b63c7d6e2 100644
--- a/unity/Assets/Tests/EditMode/BuildingModelImportTests.cs
+++ b/unity/Assets/Tests/EditMode/BuildingModelImportTests.cs
@@ -32,11 +32,18 @@ public class BuildingModelImportTests
static bool UnderResources(string path) => path.Split('/').Any(s => s.Equals("Resources", StringComparison.OrdinalIgnoreCase));
+ /// <summary>The 23 buildings (model, material, colour map), and beside each of #707's five the prefab its streamed
+ /// bundle carries (CollectionImport.MakeBuildingPrefabs).</summary>
[Test]
public void TheFolderHoldsTheTwentyThreeBuildingsAndNothingElse()
{
Assert.AreEqual(23, Ids.Length);
+ var streamed = Statecraft.Game.Map.Collection.CollectionCatalog.Bundles
+ .Single(b => b.Bundle == Statecraft.Game.Map.Collection.CollectionCatalog.Buildings).Ids;
+ Assert.AreEqual(5, streamed.Length);
+ CollectionAssert.IsSubsetOf(streamed, Ids);
var expected = Ids.SelectMany(id => new[] { Model(id), $"{Folder}/{id}/{id}.mat", ColourMap(id) })
+ .Concat(streamed.Select(id => Statecraft.Game.Map.Collection.CollectionCatalog.PrefabPath(id, Statecraft.Game.Map.Collection.CollectionDetail.Near)))
.OrderBy(p => p, StringComparer.Ordinal);
var found = AssetDatabase.FindAssets("", new[] { Folder }).Select(AssetDatabase.GUIDToAssetPath)
.Where(p => !AssetDatabase.IsValidFolder(p)).Distinct().OrderBy(p => p, StringComparer.Ordinal);
diff --git a/unity/Assets/Tests/EditMode/CollectionImportTests.cs b/unity/Assets/Tests/EditMode/CollectionImportTests.cs
index 8346e8168..463829a4f 100644
--- a/unity/Assets/Tests/EditMode/CollectionImportTests.cs
+++ b/unity/Assets/Tests/EditMode/CollectionImportTests.cs
@@ -24,7 +24,7 @@ public class CollectionImportTests
static string Dir(string id) => $"{Folder}/{id}";
static string Model(string id, string level) => $"{Dir(id)}/{id}-{level}.fbx";
static string ColourMap(string id) => $"{Dir(id)}/{id}_basecolor.jpg";
- static IEnumerable<string> Ids => CollectionCatalog.Ids;
+ static IEnumerable<string> Ids => CollectionCatalog.Ids.Where(id => CollectionCatalog.BundleOf(id) != CollectionCatalog.Buildings);
static bool Animated(string id) => CollectionCatalog.Animated.Contains(id);
static bool UnderResources(string path) => path.Split('/').Any(s => s.Equals("Resources", StringComparison.OrdinalIgnoreCase));
@@ -61,12 +61,12 @@ public class CollectionImportTests
}
[Test]
- public void TheCatalogHasThe31ModelsOfIssue664AndTheNineTownsInFourBundles()
+ public void TheCatalogHasThe31ModelsNineTownsAndFiveSpecialBuildingsInFiveBundles()
{
- var ids = Ids.ToList();
- Assert.AreEqual(40, ids.Count);
+ var ids = CollectionCatalog.Ids.ToList();
+ Assert.AreEqual(45, ids.Count);
Assert.AreEqual(ids.Count, ids.Distinct().Count(), "an id in two bundles");
- CollectionAssert.AreEqual(new[] { 12, 13, 6, 9 }, CollectionCatalog.Bundles.Select(b => b.Ids.Length), "people, vehicles, animals, towns");
+ CollectionAssert.AreEqual(new[] { 12, 13, 6, 9, 5 }, CollectionCatalog.Bundles.Select(b => b.Ids.Length), "people, vehicles, animals, towns, special buildings");
Assert.AreEqual(13, CollectionCatalog.Animated.Count);
CollectionAssert.IsSubsetOf(CollectionCatalog.Animated, ids);
CollectionAssert.DoesNotContain(CollectionCatalog.Animated, "figure-c05-pioneer-veteran-v2", "C05's only idle is a walk");
@@ -74,6 +74,21 @@ public class CollectionImportTests
Assert.IsNull(CollectionCatalog.BundleOf("b07-kibbutz-dining-hall-v2"), "the buildings are #659's");
}
+ [Test]
+ public void TheFiveSpecialBuildingsUsePrototypeAssetsInTheirOwnStreamedBundle()
+ {
+ var ids = new[] { "b11-shikun-housing-v2", "b12-tegart-fort-v2", "b18-military-barracks-v2", "b21-artisan-workshop-v2", "b22-industrial-factory-v2" };
+ CollectionAssert.AreEqual(ids, CollectionCatalog.Bundles.Single(b => b.Bundle == CollectionCatalog.Buildings).Ids);
+ foreach (var id in ids)
+ {
+ Assert.AreEqual(CollectionCatalog.Buildings, CollectionCatalog.BundleOf(id));
+ var path = CollectionCatalog.PrefabPath(id, CollectionDetail.Near);
+ StringAssert.StartsWith("Assets/Art/Settlements/Prototype/Models/", path);
+ Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(path), path);
+ Assert.IsFalse(UnderResources(path));
+ }
+ }
+
/// <summary>Issue #663, owner ruling of 17 October 2026: "The nine whole-town models ship ... slimmed, streamed after the
/// first frame, and pass the load gate". MATKOT's nine from #507 are the towns bundle, streamed like
/// the rest; the Jerusalem 3denhance variant is #336's only, under its custom licence, so it is not here (#708).</summary>
@@ -285,7 +300,8 @@ public class CollectionImportTests
{
var entries = ids.SelectMany(id => new[] { CollectionDetail.Far, CollectionDetail.Near }.Select(d => CollectionCatalog.PrefabPath(id, d))).ToArray();
foreach (var e in entries) Assert.IsNotNull(AssetDatabase.LoadAssetAtPath<GameObject>(e), e);
- var folders = ids.Select(id => Dir(id) + "/").ToArray();
+ var folders = ids.Select(id => CollectionCatalog.BundleOf(id) == CollectionCatalog.Buildings
+ ? $"Assets/Art/Settlements/Prototype/Models/{id}/" : Dir(id) + "/").ToArray();
var deps = AssetDatabase.GetDependencies(entries, true);
var outside = deps.Where(d => !folders.Any(f => d.StartsWith(f, StringComparison.Ordinal))
&& !d.StartsWith("Packages/com.unity.render-pipelines.", StringComparison.Ordinal)).ToArray();
@@ -303,7 +319,7 @@ public class CollectionImportTests
var builds = (AssetBundleBuild[])t!.GetMethod("Builds")!.Invoke(null, null)!;
CollectionAssert.AreEqual(CollectionCatalog.Bundles.Select(b => b.Bundle), builds.Select(b => b.assetBundleName));
foreach (var (b, (bundle, ids)) in builds.Zip(CollectionCatalog.Bundles, (b, c) => (b, c)))
- CollectionAssert.AreEquivalent(ids.SelectMany(id => new[] { CollectionCatalog.PrefabPath(id, CollectionDetail.Far), CollectionCatalog.PrefabPath(id, CollectionDetail.Near) }),
+ CollectionAssert.AreEquivalent(ids.SelectMany(id => new[] { CollectionCatalog.PrefabPath(id, CollectionDetail.Far), CollectionCatalog.PrefabPath(id, CollectionDetail.Near) }).Distinct(),
b.assetNames, bundle);
}
}
diff --git a/unity/Assets/Tests/EditMode/SpecialBuildingModelsTests.cs b/unity/Assets/Tests/EditMode/SpecialBuildingModelsTests.cs
new file mode 100644
index 000000000..3e3b933b8
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/SpecialBuildingModelsTests.cs
@@ -0,0 +1,245 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+using NUnit.Framework;
+using Statecraft.Game.Map;
+using Statecraft.Game.Map.Collection;
+using Statecraft.Game.Map.Routes;
+using UnityEditor;
+using UnityEditor.SceneManagement;
+using UnityEngine;
+using UnityEngine.TestTools;
+
+namespace Statecraft.Game.Tests
+{
+ /// <summary>Issue #707: MATKOT's five remaining single-building models use the streamed collection path.</summary>
+ public sealed class SpecialBuildingModelsTests
+ {
+ [Test]
+ public void SourcedPlacementsHaveTheExpectedCountsAndDates()
+ {
+ Assert.AreEqual(0, SpecialBuildingModels.Placements(new DateTime(1948, 5, 14)).Count);
+ var opening = SpecialBuildingModels.Placements(new DateTime(1948, 5, 15));
+ Assert.AreEqual(1, opening.Count(x => x.Model == SpecialBuildingModels.Tegart));
+ Assert.AreEqual(0, opening.Count(x => x.Model == SpecialBuildingModels.Barracks));
+
+ var camps = SpecialBuildingModels.Placements(new DateTime(1948, 7, 13));
+ Assert.AreEqual(2, camps.Count(x => x.Model == SpecialBuildingModels.Barracks), "Tzrifin and Camp 80");
+ var industry = SpecialBuildingModels.Placements(new DateTime(1950, 7, 28));
+ Assert.AreEqual(1, industry.Count(x => x.Model == SpecialBuildingModels.Factory), "Netanya's sourced industrial zone");
+ CollectionAssert.DoesNotContain(industry.Select(x => x.Model), SpecialBuildingModels.Workshop, "no sourced workshop placement");
+ CollectionAssert.DoesNotContain(industry.Select(x => x.Model), SpecialBuildingModels.Shikun, "no sourced named estate");
+ }
+
+ [Test]
+ public void SeededSpotsAreDeterministicAndRespectClearance()
+ {
+ var anchor = new Vector2(1200f, 3400f);
+ bool Free(Vector2 p, float r) => p.x > anchor.x;
+ var a = SpecialBuildingModels.SeededSpot("latrun", anchor, 100f, Free);
+ var b = SpecialBuildingModels.SeededSpot("latrun", anchor, 100f, Free);
+ Assert.AreEqual(a, b);
+ Assert.IsTrue(a.HasValue);
+ Assert.IsTrue(Free(a!.Value, 100f));
+ Assert.IsNull(SpecialBuildingModels.SeededSpot("blocked", anchor, 100f, (_, __) => false));
+ }
+
+ [Test]
+ public void MapYawIsComposedOnTopOfThePrefabsAxisConversion()
+ {
+ var own = Quaternion.Euler(-90f, 17f, 0f);
+ var got = SpecialBuildingModels.Rotation(own, 35f);
+ var up = got * Vector3.up;
+ var want = Quaternion.AngleAxis(35f, Vector3.up) * (own * Vector3.up);
+ Assert.Less(Vector3.Angle(want, up), 0.001f);
+ Assert.Greater(Mathf.Abs(got.x), 0.1f, "the FBX root's -90 degree X conversion was not discarded");
+ }
+
+ [Test]
+ public void ModelsDrawOnlyAtTheCloseZoomWithHysteresis()
+ {
+ Assert.IsTrue(SpecialBuildingModels.CloseAt(39000f, null));
+ Assert.IsFalse(SpecialBuildingModels.CloseAt(41000f, null));
+ Assert.IsTrue(SpecialBuildingModels.CloseAt(43000f, true));
+ Assert.IsFalse(SpecialBuildingModels.CloseAt(43000f, false));
+ Assert.IsFalse(SpecialBuildingModels.CloseAt(46000f, true));
+ }
+
+ // ---- on the real map, with the real prefabs ----
+
+ Action<string, CollectionDetail, Action<GameObject?>> saved = null!;
+ readonly List<(string id, Action<GameObject?> done)> asked = new List<(string, Action<GameObject?>)>();
+
+ [SetUp]
+ public void Seam()
+ {
+ saved = SpecialBuildingModels.Request;
+ asked.Clear();
+ SpecialBuildingModels.Request = (id, detail, done) => asked.Add((id, done));
+ }
+
+ [TearDown]
+ public void Restore()
+ {
+ SpecialBuildingModels.Request = saved;
+ EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
+ }
+
+ static MapScene OpenMap()
+ {
+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);
+ var map = UnityEngine.Object.FindFirstObjectByType<MapScene>();
+ map.Build();
+ return map;
+ }
+
+ void AnswerAll(bool found = true)
+ {
+ var pending = asked.ToList(); asked.Clear();
+ foreach (var (id, done) in pending)
+ done(found ? AssetDatabase.LoadAssetAtPath<GameObject>(CollectionCatalog.PrefabPath(id, CollectionDetail.Near)) : null);
+ }
+
+ static readonly DateTime After = new DateTime(1950, 8, 1);
+
+ /// <summary>Each sourced model stands near its sourced point, clear of the towns' footprints (and so their labels),
+ /// the routes, the unit tokens present from that day and each other, upright on the prefab's own axis conversion,
+ /// on the ground, and hidden until the close zoom.</summary>
+ [Test]
+ public void OnTheMapEachSourcedModelStandsNearItsPlaceClearAndUpright()
+ {
+ var map = OpenMap();
+ // The civilians first, as GameRoot shows them (#666): the buildings keep off their ground.
+ var savedPeople = CivilianPeople.Request;
+ CivilianPeople.Request = (id, detail, done) => { };
+ CivilianPeople people;
+ try { people = CivilianPeople.ShowAt(map, After, Array.Empty<Statecraft.Sim.Placement>(), Statecraft.Sim.ContentLoader.Load(Statecraft.Game.Paths.Content))!; }
+ finally { CivilianPeople.Request = savedPeople; }
+ Assert.Greater(people.Wanted.Count, 0);
+ var props = people.Wanted.Select(w => (new Vector2(w.At.x, w.At.z), CivilianPeople.FigureClearanceM))
+ .Concat(WildlifeLayer.Wants(map).Select(w => (w.At, 0.5f * WildlifeLayer.SizeM))).ToList();
+ var layer = SpecialBuildingModels.ShowAt(map, After)!;
+ CollectionAssert.AreEquivalent(new[] { SpecialBuildingModels.Tegart, SpecialBuildingModels.Barracks, SpecialBuildingModels.Factory },
+ asked.Select(a => a.id), "one request per placed model");
+ AnswerAll();
+ CollectionAssert.AreEquivalent(new[] { "latrun_tegart", "tzrifin_barracks", "camp_80_barracks", "netanya_factory" }, layer.Placed.Select(p => p.Key));
+ var ground = PlacementLayer.CampGround(map);
+ var footprints = map.KitFootprints.Select(f => (f.centre, f.radius)).ToList();
+ var wants = SpecialBuildingModels.Placements(After).ToDictionary(w => w.Key);
+ var spots = new List<(Vector2, float)>();
+ foreach (var p in layer.Placed)
+ {
+ var w = wants[p.Key]; var flat = new Vector2(p.At.x, p.At.z); float r = SpecialBuildingModels.ClearanceOf(p.Model);
+ var a3 = map.Frame.ToWorld(w.Lon, w.Lat, 0);
+ float off = (flat - new Vector2(a3.x, a3.z)).magnitude;
+ TestContext.WriteLine($"{p.Key}: {off:0} m from its sourced point");
+ float inside = SpecialBuildingModels.Inside(new Vector2(a3.x, a3.z), footprints);
+ TestContext.WriteLine($"{p.Key}: {inside:0} m inside a town's footprint");
+ Assert.Less(off, inside + 4f * r, p.Key + " stands near its sourced point (beyond the town's footprint)");
+ Assert.IsTrue(TownLandmarks.Clear(flat, r, footprints), p.Key + " clear of the towns");
+ Assert.IsFalse(ground.OnRoute(flat, r), p.Key + " clear of the routes");
+ Assert.IsFalse(ground.OnToken(flat, r, After), p.Key + " clear of the unit tokens");
+ Assert.IsTrue(TownLandmarks.Clear(flat, r, spots), p.Key + " clear of the others");
+ Assert.IsTrue(TownLandmarks.Clear(flat, r, props), p.Key + " clear of the civilians and the wildlife");
+ spots.Add((flat, r));
+ var go = layer.transform.Find(p.Key)!;
+ var prefab = AssetDatabase.LoadAssetAtPath<GameObject>(CollectionCatalog.PrefabPath(p.Model, CollectionDetail.Near));
+ Assert.Less(Quaternion.Angle(prefab.transform.localRotation, go.localRotation), 0.01f, p.Key + " keeps the FBX axis conversion");
+ var rs = go.GetComponentsInChildren<Renderer>(true);
+ var b = rs.Select(x => x.bounds).Aggregate((x, y) => { x.Encapsulate(y); return x; });
+ Assert.AreEqual(p.At.y, b.min.y, 1f, p.Key + " stands on the ground");
+ Assert.Less(b.size.y, Mathf.Max(b.size.x, b.size.z), p.Key + " upright: lower than it is long");
+ Assert.IsTrue(rs.All(x => x.forceRenderingOff), p.Key + " hidden until the close zoom");
+ }
+ var veg = map.GetComponentInChildren<Statecraft.Game.Map.Kits.VegetationLayer>(true);
+ Assert.IsNotNull(veg);
+ foreach (var p in layer.Placed)
+ {
+ float r = SpecialBuildingModels.ClearanceOf(p.Model);
+ int n = veg.Drawable().Count(t =>
+ {
+ var q = t.m.GetColumn(3); float reach = r + Statecraft.Game.Map.Kits.VegetationLayer.CrownRadius(t.kind, t.m);
+ return (new Vector2(q.x, q.z) - new Vector2(p.At.x, p.At.z)).sqrMagnitude < reach * reach;
+ });
+ Assert.AreEqual(0, n, p.Key + ": kit trees on the building");
+ }
+
+ var cam = Camera.main!;
+ cam.transform.SetPositionAndRotation(new Vector3(0f, Statecraft.Game.Map.Kits.TownModelLayer.CloseEnterM, 0f), Quaternion.Euler(90f, 0f, 0f));
+ layer.Choose(default, cam);
+ Assert.IsTrue(layer.GetComponentsInChildren<Renderer>(true).All(x => !x.forceRenderingOff), "drawn at the close zoom");
+ cam.transform.position = new Vector3(0f, Statecraft.Game.Map.Kits.TownModelLayer.CloseExitM + 1f, 0f);
+ layer.Choose(default, cam);
+ Assert.IsTrue(layer.GetComponentsInChildren<Renderer>(true).All(x => x.forceRenderingOff), "hidden beyond the close zoom's exit");
+ }
+
+ /// <summary>The owner on v0.1.1 (18 October 2026): MATKOT's buildings were "way bigger then the train". The #707
+ /// buildings stand at the #700 buildings' one world scale (an 8.5 m house as long as the steam train's locomotive car,
+ /// about 204 m: 24x real): the fort and the factory are 3 to 4 locomotive cars long, the barracks 2.5 to 3.25, and
+ /// none is longer than the whole service train (about 816 m).</summary>
+ [Test]
+ public void EveryModelIsSizedAgainstTheLocomotive()
+ {
+ float train = RouteTrain.ModelRealLengthM * RouteTrain.Scale * ServiceTrain.ModelSize, loco = train / ServiceTrain.Cars;
+ Assert.AreEqual(204f, loco, 1f, "the locomotive's car");
+ Assert.AreEqual(24f, SpecialBuildingModels.WorldScale, 0.01f, "the #700 buildings' world scale");
+ var map = OpenMap();
+ var layer = SpecialBuildingModels.ShowAt(map, After)!;
+ AnswerAll();
+ var bands = new Dictionary<string, (float lo, float hi)>
+ {
+ [SpecialBuildingModels.Tegart] = (3f, 4f), [SpecialBuildingModels.Factory] = (3f, 4f), [SpecialBuildingModels.Barracks] = (2.5f, 3.25f),
+ };
+ Assert.AreEqual(4, layer.Placed.Count);
+ foreach (var p in layer.Placed)
+ {
+ var b = layer.transform.Find(p.Key)!.GetComponentsInChildren<Renderer>(true).Select(x => x.bounds).Aggregate((x, y) => { x.Encapsulate(y); return x; });
+ float side = Mathf.Max(b.size.x, b.size.z), cars = side / loco;
+ TestContext.WriteLine($"{p.Key} ({p.Model}): {side:0} m long, {cars:0.00} locomotive cars, {b.size.y:0} m tall");
+ var (lo, hi) = bands[p.Model];
+ Assert.That(cars, Is.InRange(lo, hi), p.Key + " in locomotive cars");
+ Assert.Less(side, train, p.Key + " shorter than the whole train");
+ Assert.Less(b.size.y, train, p.Key + " lower than the train is long");
+ }
+ }
+
+ /// <summary>The models follow the game date (each from its sourced day; an earlier save shows fewer), and the layer
+ /// does not rebuild on GameRoot's every refresh at one date.</summary>
+ [Test]
+ public void TheModelsFollowTheGameDateAndDoNotRebuildOnEveryRefresh()
+ {
+ var map = OpenMap();
+ var layer = SpecialBuildingModels.ShowAt(map, new DateTime(1948, 5, 15))!;
+ AnswerAll();
+ CollectionAssert.AreEqual(new[] { "latrun_tegart" }, layer.Placed.Select(p => p.Key));
+ var fort = layer.transform.Find("latrun_tegart")!.gameObject;
+ SpecialBuildingModels.ShowAt(map, new DateTime(1948, 5, 15));
+ Assert.IsTrue(fort != null && fort.transform.parent == layer.transform, "the same date keeps the same models");
+ SpecialBuildingModels.ShowAt(map, After);
+ AnswerAll();
+ Assert.AreEqual(4, layer.Placed.Count);
+ SpecialBuildingModels.ShowAt(map, new DateTime(1948, 5, 16));
+ CollectionAssert.AreEqual(new[] { "latrun_tegart" }, layer.Placed.Select(p => p.Key), "an earlier date shows only what stood then");
+ Assert.AreEqual(1, layer.transform.childCount);
+ }
+
+ [Test]
+ public void ABundleThatDoesNotStreamLeavesTheMapRunning()
+ {
+ var map = OpenMap();
+ var layer = SpecialBuildingModels.ShowAt(map, After)!;
+ int n = asked.Count;
+ Assert.Greater(n, 0);
+ for (int i = 0; i < n; i++) LogAssert.Expect(LogType.Warning, new Regex("^BUILDINGS: .* did not stream"));
+ AnswerAll(found: false);
+ Assert.AreEqual(0, layer.Placed.Count);
+ Assert.AreEqual(0, layer.transform.childCount);
+ Assert.IsTrue(layer.FailedOpen);
+ Assert.DoesNotThrow(() => SpecialBuildingModels.ShowAt(map, new DateTime(1951, 1, 1)));
+ Assert.AreEqual(0, asked.Count, "a failed model is not asked for again");
+ Assert.IsNotNull(map.Terrain);
+ }
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/SpecialBuildingModelsTests.cs.meta b/unity/Assets/Tests/EditMode/SpecialBuildingModelsTests.cs.meta
new file mode 100644
index 000000000..3d3a46aa7
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/SpecialBuildingModelsTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: c4a3596ad39149d39165e3ba0b021707