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 unit tokens wear the 1948 Collection's figures, with the 65 mm gun and the jeep (refs #665) (#992)

Eyal Golan281af799df6c
diff --git a/ASSETS.yaml b/ASSETS.yaml
index cdff73501..7b35fd542 100644
--- a/ASSETS.yaml
+++ b/ASSETS.yaml
@@ -574,7 +574,7 @@ rules:
- glob: "unity/Assets/Art/Collection/*"
licence: CC0-1.0
ai_generated: true
- source: "Tripo Studio (tripo3d.ai), paid Max plan, made 10-13 October 2026 from concept images generated in the same studio, by MATKOT (PR #507 at 3ef0a7a5a36887aee7a24fd11ddf722507695f3c): the 31 non-building models of The 1948 Collection (12 people, 9 road and rail vehicles, 4 ships and aircraft, 6 animals), and its nine whole-town models (issue #663: 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; byte-identical to the same files in #336). Slimmed for the repository by tools/slim_collection.py (Blender 5.2.2, issue #664): a far mesh of at most 1,500 triangles (4,500 for vehicles, ships, aircraft and whole towns) and a near mesh of at most 8,000 per model, the near mesh keeping its rig and only the idle clip on the 13 models that have one, every other clip dropped; colour maps 1024 px resized to 512 px. The masters, #507's full-detail FBX files and the per-model records (prompts, task ids, credits) are kept outside the repository."
+ source: "Tripo Studio (tripo3d.ai), paid Max plan, made 10-13 October 2026 from concept images generated in the same studio, by MATKOT (PR #507 at 3ef0a7a5a36887aee7a24fd11ddf722507695f3c): the 31 non-building models of The 1948 Collection (12 people, 9 road and rail vehicles, 4 ships and aircraft, 6 animals), and its nine whole-town models (issue #663: 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; byte-identical to the same files in #336). Slimmed for the repository by tools/slim_collection.py (Blender 5.2.2, issue #664): a far mesh of at most 1,500 triangles (4,500 for vehicles, ships, aircraft and whole towns) and a near mesh of at most 8,000 per model, the near mesh keeping its rig and only the idle clip on the 13 models that have one, every other clip dropped (C05, which has no idle clip, has both static meshes posed at the first frame of his walk instead of his T-pose rest, issue #665); colour maps 1024 px resized to 512 px. The masters, #507's full-detail FBX files and the per-model records (prompts, task ids, credits) are kept outside the repository."
status: verified
artist: "MATKOT"
note: "Issue #664 (umbrella #663). Tripo Terms of User Agreement (last updated 11 July 2025), s. 5.2.2: paid users have all rights in their Outputs, including to distribute and license them; s. 3.2 allows commercial and non-commercial use. CC0 / no rights claimed, as for the other AI-only assets (D1). Decided (owner, 2026-10-15, issues #659 and #663): 'they are ok to use'. The whole-town models: owner ruling 2026-10-17 on #663, 'The nine whole-town models ship (this reverses the 15 Oct 'layout references only' ruling)'; their author offered them under CC0 in #507 itself (its ASSETS.yaml rule for Settlements/Prototype/Models/*). Owner ruling 2026-10-15 on repository size: plain git, slimmed first, no masters and no Git LFS. The prefabs, controllers and materials beside the models are under the code row of LICENSING.md."
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 98001a6a2..6ac2ee093 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,14 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
while the player's works at the Hula are in progress (R-SWAMP-002, Q-SWAMP-2); its text, options and sources are
unchanged. The reference player drains no swamp, so the card no longer fires in its run and `hash1952` and `mvp-end`
move (docs/determinism.md). The loader refuses a swamp site that is also a field, yishuv or camp site.
+- Map: the army tokens wear MATKOT's figures from The 1948 Collection, streamed after the first frame (#665). Israeli
+ riflemen are the sabra pioneer, the young recruit and the veteran fighter by their headgear, with the pioneer
+ veteran as the third figure and the Palmach scout as Harel's. The 65 mm gun stands with the brigades given guns in
+ the 11 July 1948 distribution, and the Willys jeep with Harel (from 1 June 1948) and Negev (from 2 June 1948), each
+ from its sourced day. The Arab Legion and the Arab Liberation Army are drawn with their own figures under a neutral
+ pennant, only once those figures arrive; the other Arab forces stay data only. Until a model arrives, and if its
+ bundle is missing, the code-built Israeli figures stay. The pioneer veteran's model now stands at his walk's first
+ frame instead of a T-pose.
### Fixed
- The Unity golden checks play every golden in `sim/Statecraft.Sim.Tests/golden/manifest.txt` (`hash1950`, `hash1952`,
diff --git a/content/map/units_1948.yaml b/content/map/units_1948.yaml
index 0e91de496..821760a38 100644
--- a/content/map/units_1948.yaml
+++ b/content/map/units_1948.yaml
@@ -33,11 +33,15 @@
# Sword, 1961) or the IDF and Defense Establishment Archives. The card computes the same note per anchor.
# headgear: the riflemen's headgear, only where a source ties it to the unit (otherwise the uniform default: bush hat,
# steel helmet, bush hat; docs/units.md).
+# vehicles: equipment a source puts with an army unit from a day, drawn on its token beside the figures (issue #665):
+# gun_65mm, the 65 mm mountain gun (the "Napoleonchik"), or jeep. Each gives type, from ('YYYY-MM-DD', the first day a
+# source puts it with the unit; it stays for the rest of the unit's windows), a note quoting the source, and sources.
# side: whose formation it is: israel, or egypt, jordan, syria, iraq, lebanon, ala (the Arab Liberation Army) or
# local_arab_forces (Q-START-4, owner, 15 October 2026: "Armies + ALA + local forces"; #226). The token flies that side's
-# flag where the repo has a sourced one (Israel's only, for now; docs/units.md, "The plinth and the flag"). Data only:
-# the map draws Israel's rows alone until Phase 5 PR 17's figures land, after its sensitivity review (owner, 17 October
-# 2026, #740: "Nothing is drawn with IDF figures, and there is no placeholder art").
+# flag where the repo has a sourced one (Israel's only, for now; docs/units.md, "The plinth and the flag"). The map draws
+# Israel's rows and the sides with a 1948 Collection figure, the Arab Legion (jordan) and the ALA (ala), each only with its
+# own figure (issue #665); every other side's rows are data only (owner, 17 October 2026, #740: "Nothing is drawn with
+# IDF figures, and there is no placeholder art").
# echelon: the formation's level: force (a state's whole force in the field, or the ALA), division, brigade, battalion or
# company. Every row of a side other than israel gives it, with the formations in `number` and their sources in the
# row's `sources`.
@@ -108,6 +112,13 @@ units:
sector: "The Haifa area and the Zevulun district, that is Haifa and the Western Galilee (split from the Levanoni Brigade in February 1948). It took Acre in Operation Ben-Ami (from 13 May 1948; Acre surrendered on the night of 17-18 May), led Operation Brosh against the Syrian bridgehead at Mishmar HaYarden (9-18 July 1948) and fought in Operation Hiram."
wikipedia_only: false
status: draft
+ vehicles:
+ - type: gun_65mm
+ from: '1948-07-11'
+ note: "Ben-Gurion's diary for 11 July 1948 lists 4+4 of the 65 mm guns opposite the Syrian bridgehead, where this row stands from 9 July."
+ sources:
+ # Ben-Gurion's diary, 11 July 1948, the cannon distribution, 65 mm guns on every front, as the research note gives it: 4+4 opposite the Syrian bridgehead, 4 in the Acre sector, 4+4 Danny, 4+4 Harel, 3+3+4 Givati, 4 Negev (research_notes/M4 war mode/war-1948.md, section 8, Q-ART-2, read 2026-10-16).
+ - {url: 'https://bengurionarchive.bgu.ac.il/en/node/14176', checked: '2026-10-16'}
anchors:
- place: Facing the Syrian bridgehead at Mishmar HaYarden
lon: 35.59972
@@ -216,6 +227,13 @@ units:
sector: "Moved to the south as the war entered its second stage, concentrated mainly around Gedera, Gan Yavne and Be'er Tuvia."
wikipedia_only: false
status: draft
+ vehicles:
+ - type: gun_65mm
+ from: '1948-07-11'
+ note: "Ben-Gurion's diary for 11 July 1948 lists 3+3+4 of the 65 mm guns with Givati."
+ sources:
+ # Ben-Gurion's diary, 11 July 1948, the cannon distribution, 65 mm guns on every front, as the research note gives it: 4+4 opposite the Syrian bridgehead, 4 in the Acre sector, 4+4 Danny, 4+4 Harel, 3+3+4 Givati, 4 Negev (research_notes/M4 war mode/war-1948.md, section 8, Q-ART-2, read 2026-10-16).
+ - {url: 'https://bengurionarchive.bgu.ac.il/en/node/14176', checked: '2026-10-16'}
anchors:
- place: Gedera
lon: 34.77722
@@ -382,6 +400,18 @@ units:
sector: "All units in the Jerusalem corridor and hills; in the first half of May 1948 it took the corridor and opened the road to Sha'ar HaGai. Later it fought in Operation Horev."
wikipedia_only: false
status: draft
+ vehicles:
+ - type: jeep
+ from: '1948-06-01'
+ note: "On the night of 31 May to 1 June 1948 a jeep convoy under Harel's operations officer reached the brigade over the Burma Road, 'the unofficial breakthrough' (Isseroff); the first, of 10 jeeps from Hulda on the night of 30-31 May, turned back."
+ sources:
+ - {url: 'https://web.archive.org/web/20210415133543/https://zionism-israel.com/dic/Burma_Road.htm', checked: '2026-10-18'}
+ - type: gun_65mm
+ from: '1948-07-11'
+ note: "Ben-Gurion's diary for 11 July 1948 lists 4+4 of the 65 mm guns with Harel."
+ sources:
+ # Ben-Gurion's diary, 11 July 1948, the cannon distribution, 65 mm guns on every front, as the research note gives it: 4+4 opposite the Syrian bridgehead, 4 in the Acre sector, 4+4 Danny, 4+4 Harel, 3+3+4 Givati, 4 Negev (research_notes/M4 war mode/war-1948.md, section 8, Q-ART-2, read 2026-10-16).
+ - {url: 'https://bengurionarchive.bgu.ac.il/en/node/14176', checked: '2026-10-16'}
anchors:
- place: "Sha'ar HaGai"
lon: 35.03333
@@ -420,6 +450,13 @@ units:
wikipedia_only: false
status: draft
disbanded: {date: '1949-05-01', precision: month, sources: [{url: 'https://en.wikipedia.org/wiki/Yiftach_Brigade', checked: '2026-10-11'}]}
+ vehicles:
+ - type: gun_65mm
+ from: '1948-07-11'
+ note: "Ben-Gurion's diary for 11 July 1948 lists 4+4 of the 65 mm guns with Danny, the operation Yiftach fought at Lydda."
+ sources:
+ # Ben-Gurion's diary, 11 July 1948, the cannon distribution, 65 mm guns on every front, as the research note gives it: 4+4 opposite the Syrian bridgehead, 4 in the Acre sector, 4+4 Danny, 4+4 Harel, 3+3+4 Givati, 4 Negev (research_notes/M4 war mode/war-1948.md, section 8, Q-ART-2, read 2026-10-16).
+ - {url: 'https://bengurionarchive.bgu.ac.il/en/node/14176', checked: '2026-10-16'}
anchors:
- place: Lydda
lon: 34.88806
@@ -453,6 +490,18 @@ units:
headgear_sources:
- {url: 'https://commons.wikimedia.org/wiki/File:Palmach-negev-instructed2operation.jpg', checked: '2026-10-11'}
- {url: 'https://commons.wikimedia.org/wiki/File:Negev_Brigade_soldiers_1948.jpg', checked: '2026-10-11'}
+ vehicles:
+ - type: jeep
+ from: '1948-06-02'
+ note: "en.wiki Battles of Negba: in the Egyptian attack of 2 June 1948 'a jeep unit from the Negev Beasts Battalion was sent to the west of the kibbutz to harass the Egyptian flank' (the paragraph cites Wallach 1978, p. 32)."
+ sources:
+ - {url: 'https://en.wikipedia.org/wiki/Battles_of_Negba', checked: '2026-10-18'}
+ - type: gun_65mm
+ from: '1948-07-11'
+ note: "Ben-Gurion's diary for 11 July 1948 lists 4 of the 65 mm guns with Negev; a Commons photograph has Negev Brigade soldiers with a field gun on 20 October 1948 (docs/units.md, Sources)."
+ sources:
+ # Ben-Gurion's diary, 11 July 1948, the cannon distribution, 65 mm guns on every front, as the research note gives it: 4+4 opposite the Syrian bridgehead, 4 in the Acre sector, 4+4 Danny, 4+4 Harel, 3+3+4 Givati, 4 Negev (research_notes/M4 war mode/war-1948.md, section 8, Q-ART-2, read 2026-10-16).
+ - {url: 'https://bengurionarchive.bgu.ac.il/en/node/14176', checked: '2026-10-16'}
anchors:
- place: Nir Am (Mekorot camp)
lon: 34.58083
diff --git a/docs/ai-disclosure.md b/docs/ai-disclosure.md
index 9ce02ae97..c3eff1533 100644
--- a/docs/ai-disclosure.md
+++ b/docs/ai-disclosure.md
@@ -43,5 +43,5 @@ This is not a licence clearance or a completed store content survey. owner-verif
| Asset pattern | Manifest | Recorded source | Review status |
| --- | --- | --- | --- |
-| unity/Assets/Art/Collection/* | ASSETS.yaml | Tripo Studio (tripo3d.ai), paid Max plan, made 10-13 October 2026 from concept images generated in the same studio, by MATKOT (PR #507 at 3ef0a7a5a36887aee7a24fd11ddf722507695f3c): the 31 non-building models of The 1948 Collection (12 people, 9 road and rail vehicles, 4 ships and aircraft, 6 animals), and its nine whole-town models (issue #663: 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; byte-identical to the same files in #336). Slimmed for the repository by tools/slim_collection.py (Blender 5.2.2, issue #664): a far mesh of at most 1,500 triangles (4,500 for vehicles, ships, aircraft and whole towns) and a near mesh of at most 8,000 per model, the near mesh keeping its rig and only the idle clip on the 13 models that have one, every other clip dropped; colour maps 1024 px resized to 512 px. The masters, #507's full-detail FBX files and the per-model records (prompts, task ids, credits) are kept outside the repository. | verified |
+| unity/Assets/Art/Collection/* | ASSETS.yaml | Tripo Studio (tripo3d.ai), paid Max plan, made 10-13 October 2026 from concept images generated in the same studio, by MATKOT (PR #507 at 3ef0a7a5a36887aee7a24fd11ddf722507695f3c): the 31 non-building models of The 1948 Collection (12 people, 9 road and rail vehicles, 4 ships and aircraft, 6 animals), and its nine whole-town models (issue #663: 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; byte-identical to the same files in #336). Slimmed for the repository by tools/slim_collection.py (Blender 5.2.2, issue #664): a far mesh of at most 1,500 triangles (4,500 for vehicles, ships, aircraft and whole towns) and a near mesh of at most 8,000 per model, the near mesh keeping its rig and only the idle clip on the 13 models that have one, every other clip dropped (C05, which has no idle clip, has both static meshes posed at the first frame of his walk instead of his T-pose rest, issue #665); colour maps 1024 px resized to 512 px. The masters, #507's full-detail FBX files and the per-model records (prompts, task ids, credits) are kept outside the repository. | verified |
| unity/Assets/Art/Settlements/Prototype/Models/b* | ASSETS.yaml | Tripo Studio (tripo3d.ai), paid Max plan, made 10-13 October 2026 from concept images generated in the same studio, by MATKOT (PR #507). Building modules decimated to 3,608-8,000 triangles in Blender 4.4; colour maps made at 1024 px and committed at 512 px (2x2 box average, JPEG quality 90, issue #659; owner ruling of 15 October 2026: plain git, only what ships, no masters). The masters and per-model records (prompts, task ids, credits) are kept outside the repository. The texture paths from the author's machine inside each FBX are blanked to same-length placeholders (owner ruling, 15 October 2026, PR #675). | verified |
diff --git a/docs/units.md b/docs/units.md
index af64c3b27..8e21852e8 100644
--- a/docs/units.md
+++ b/docs/units.md
@@ -116,7 +116,7 @@ After the staff review the controller ruled:
asks for them (`&units`, `-units`). The editor's promo renders draw them only with `-units`.
- **The promo's badge, a wider trio, sourced headgear; the ring stays selection-only (I6).** See "Look".
-### The Arab forces: data only
+### The Arab forces: two drawn, the rest data only
The file also holds the Arab forces of 15 May and 11 June 1948 (#740, Phase 5 PR 1), one row per force, with `side`,
`echelon` and one `strength` (owner's decision on #570). The source is `research_notes/GDD phase 5/arab-forces-1948.md`,
@@ -140,11 +140,19 @@ ruled (al-Malikiyya on 15 May is the ALA's, #226 ruling 2).
- **Two places at once.** At the first truce the Egyptian row stands at both its forward base (Isdud) and its rear base
(Majdal) (owner, 17 October 2026, on #860). Its two anchors overlap in time. Only a row the map does not draw may do
that: a drawn row has one token, at one place at a time. How PR 17 draws such a row is its decision.
-- **Not drawn** (owner, 17 October 2026, #740): "Data only. PR 1 adds the sourced Arab rows to `units_1948.yaml` and
- filters them off the map in `UnitRoster` until Phase 5 PR 17's figures land, after its sensitivity review. Nothing is
- drawn with IDF figures, and there is no placeholder art." `UnitRoster.OnMap` (not hidden, and `side: israel`) keeps
- both the roster and the placer to Israel's rows, so the Arab rows give no token, take no spot and clear no ground for
- the kits; the goldens do not move. Test: `UnitsInPlayTests.OnlyIsraelsRowsAreDrawnTheArabForcesAreDataOnly`.
+- **Drawn only with their own figures** (owner, 17 October 2026, #740): "Data only. PR 1 adds the sourced Arab rows to
+ `units_1948.yaml` and filters them off the map in `UnitRoster` until Phase 5 PR 17's figures land, after its
+ sensitivity review. Nothing is drawn with IDF figures, and there is no placeholder art." MATKOT's 1948 Collection has
+ figures for two forces, and MATKOT's unit models count as reviewed and approved (owner, 17 October 2026, #756), so
+ those two are drawn (issue #665; see "The 1948 Collection on the tokens"): the Arab Legion and the Arab Liberation
+ Army. `UnitRoster.OnMap` (not hidden, and `side: israel` or a side with a figure) keeps the roster and the placer to
+ those rows; the Egyptian, Syrian, Iraqi and Lebanese rows give no token, take no spot and clear no ground for the kits.
+ A drawn force's token has no code-built figure: it is drawn only once its figure has arrived, so a missing or damaged
+ bundle draws nothing. Three figures (Q-UI-3 at full strength: the rows give only the sourced 15 May strength; owner,
+ 17 October 2026, #226), under the neutral pennant (Q-ART-1). Its spot never stands on ground Israel held on its
+ window's first day (#226, ruling 9; `control_hexes_1948_49.yaml`). The card leaves out Israel's call-up line. The
+ goldens do not move. Tests: `UnitsInPlayTests.OnlyTheForcesWithAFigureAreDrawnAndOnlyOnceItHasArrived`,
+ `UnitFiguresTests.TheArabForcesAreDrawnOnlyWithTheirOwnFiguresOnceTheyArrive`.
- **Not in the file yet:** the local Arab forces (the note places them only beside places its "Conventions" lists as
sensitive and does not describe), the Legion's Jerusalem battalions, the Egyptian eastern force, the ALA and
the Lebanese Army on 11 June (al-Malikiyya's holder is contested), and the Saudi, Sudanese and Yemeni contingents (not
@@ -153,6 +161,36 @@ ruled (al-Malikiyya on 15 May is the ALA's, #226 ruling 2).
`test_strength_has_one_value_and_a_source`, `test_no_anchor_rests_on_one_source_where_the_note_says_contested`,
`test_the_arab_rows_name_no_sensitive_place`).
+### The 1948 Collection on the tokens (#665)
+
+The tokens wear MATKOT's figures from The 1948 Collection (#507, #680), streamed after the first frame
+(`CollectionStream`, the people and vehicles bundles); nothing is fetched before it, and nothing sits in `Resources/`.
+`UnitFigures` holds the table. Each model is the far (strategic-zoom) static mesh, put under the figure with the prefab's
+own root rotation kept (the FBX axis turn, -90 degrees about X), so the camera's yaw composes on top of it.
+
+| Model | Where | Source | From |
+|---|---|---|---|
+| C04 sabra pioneer | an Israeli rifleman in the bush hat (the uniform default's first figure; the showcase trio's first) | #507's pairing | always |
+| C06 young recruit | an Israeli rifleman in the Mk II steel helmet (every token's second figure) | #507's pairing | always |
+| C07 veteran fighter | an Israeli rifleman in the knitted stocking cap: the Negev Brigade's first and third, the showcase's third | the Negev headgear photographs (Sources) | always |
+| C05 pioneer veteran | the third figure of every Israeli brigade with the uniform default, except Harel | a presentation choice: the default's third figure is not sourced | always |
+| C12F Palmach scout | Harel's third figure, at Sha'ar HaGai on the convoy road | Harel's row (a Palmach brigade escorting the convoys, Izkor); en.wiki Netiva Ben-Yehuda (a Palmach woman's duties included "escorting convoys") | always |
+| C08 Arab Legion | the Arab Legion's three figures | the row; owner, #756 (MATKOT's models approved) | the row's windows |
+| C09 irregular | the Arab Liberation Army's three figures | en.wiki Arab Liberation Army: "an irregular army" of volunteers | the row's windows |
+| H02 65 mm gun ("Napoleonchik") | on the base behind the trio: Carmeli, Givati, Harel, Yiftach, Negev | Ben-Gurion's diary, 11 July 1948 (the cannon distribution) | 11 July 1948 |
+| H03 Willys jeep | on the base behind the trio: Harel, Negev | Harel: the Burma Road jeep convoy (Isseroff); Negev: the Negev Beasts' jeep unit at Negba (en.wiki Battles of Negba) | 1 June and 2 June 1948 |
+
+- **The vehicles are data:** `vehicles` in `units_1948.yaml` (`type`, `from`, `note`, `sources`), checked by
+ `UnitData.Parse` and `tools/tests/test_units_1948.py`. A vehicle stays for the rest of the row's windows.
+- **Size:** a figure takes the code-built figure's height; a vehicle is drawn 0.7 of a figure's height long, sized against
+ the figures as the aircraft and the ship are, not to scale, so it fits on the base.
+- **C05's pose:** he had no idle clip and shipped in his rest pose, a T-pose. His static meshes are now posed at the first
+ frame of his own walk (`tools/slim_collection.py`, `POSE_CLIP`).
+- **Fail open:** an Israeli figure keeps its code-built mesh until its model arrives, and for good if the bundle is
+ missing or damaged; a vehicle and an Arab force's token are not drawn until their model arrives.
+- Tests: `UnitFiguresTests` (every one of the nine is placed on some day of the war; the table; the swap; arms down;
+ fail open).
+
### What the player sees
| Unit | Positions (dated, from the sources) | Ends |
@@ -382,8 +420,9 @@ figures tall standing at the base's back edge. `UnitPlinth` and `UnitFlags` draw
before measuring ours. The figures read darker than their base, as T29's (0.5–0.9 of its luma), at those looks and at
gameplay03 (`TheFiguresReadDarkerThanTheirBaseAsT29`, #645: the shirts at 0.9 of #559's paint, read beside the chest
brace, which #559's sample point hit).
-- **Flag:** by the unit's `side` in `units_1948.yaml` (`israel` on every row the map draws; the Arab forces' rows are
- data only, see "The Arab forces: data only"). The cloth is 0.52 of a figure's height tall and 0.72 wide, on a pole 1.5 tall at 0.9 of the base's
+- **Flag:** by the unit's `side` in `units_1948.yaml`. Israel's is the only sourced flag; the two Arab forces the map
+ draws fly the neutral pennant (Q-ART-1, owner, 15 October 2026: "a neutral pennant now, replaced by a sourced emblem
+ when one is found"): a plain grey triangle, in no side's colours and not white (`UnitFlags.BuildPennant`). The cloth is 0.52 of a figure's height tall and 0.72 wide, on a pole 1.5 tall at 0.9 of the base's
radius, behind the trio and east of the badge (`TheFlagIsAboutHalfAFigureTallOnTheBasesEdge`). The cloth is drawn
unlit (white, and a blue standing for the proclamation's "dark sky-blue"), so it reads white under the map's light and
grade as T29's. Owner ruling (2026-10-15): the flag turns about its pole to face the camera (`UnitFlagFacing`), so it
diff --git a/tools/slim_collection.py b/tools/slim_collection.py
index 00b234916..6d7255a3a 100644
--- a/tools/slim_collection.py
+++ b/tools/slim_collection.py
@@ -12,10 +12,11 @@ The source is #507 at 3ef0a7a5a36887aee7a24fd11ddf722507695f3c:
For each model it writes, into <out>/<id>/:
<id>-far.fbx the strategic zoom: one static mesh of at most FAR_TRIS triangles (FAR_TRIS_VEHICLE for vehicles, ships
- and aircraft, FAR_TRIS_TOWN for a whole town), no rig, no animation (posed at the idle clip's first frame when the model has one);
+ and aircraft, FAR_TRIS_TOWN for a whole town), no rig, no animation (posed at the idle clip's first frame when the model has one,
+ or at the first frame of its POSE_CLIP);
<id>-near.fbx the close zoom, at most NEAR_TRIS triangles: for a model with an "idle" clip, the skinned mesh, its rig
and that one clip sampled every ANIM_STEP frames (every other clip is dropped); for any other model one
- static mesh (#507 has those stand still too);
+ static mesh (#507 has those stand still too), posed as the far mesh;
<id>_basecolor.jpg the colour map at TEX_PX px (Unity imports it crunched).
A model's parts (a vehicle's wheels) are joined into one mesh, so it draws as one instanced mesh. Decimation is
Blender's collapse decimator, which keeps the vertex weights, so the cut mesh still follows its rig.
@@ -69,6 +70,10 @@ TOWNS = [
"kibbutz-compound-v2", "stone-village-v1", "maabara-camp-v1", "shikun-housing-v1",
]
IDS = PEOPLE + VEHICLES + ANIMALS + TOWNS
+# A model with no "idle" clip whose rest pose is a T-pose has its static meshes posed at the first frame of this clip of its
+# own instead (issue #665): C05's only clips are a walk and a run, and the walk's first frame stands with the arms down,
+# mid-step. Without it he stood on the army tokens with his arms straight out.
+POSE_CLIP = {"figure-c05-pioneer-veteran-v2": "idle_walk"}
def tris(mesh) -> int:
@@ -205,6 +210,17 @@ def find_idle(bpy, arms):
return next((a for a in bpy.data.actions if a.name.split("|")[-1] == "idle"), None) if arms else None
+def find_pose(bpy, arms, mid: str):
+ """The clip whose first frame poses the static meshes: the idle clip, else the model's POSE_CLIP, else none (rest)."""
+ idle = find_idle(bpy, arms)
+ if idle is not None or mid not in POSE_CLIP:
+ return idle
+ pose = next((a for a in bpy.data.actions if a.name.split("|")[-1] == POSE_CLIP[mid]), None) if arms else None
+ if pose is None:
+ raise SystemExit(f"{mid}: no clip {POSE_CLIP[mid]!r} to pose it")
+ return pose
+
+
def slim(bpy, src: Path, out: Path, mid: str) -> dict:
fbx = src / mid / f"{mid}.fbx"
dest = out / mid
@@ -228,14 +244,14 @@ def slim(bpy, src: Path, out: Path, mid: str) -> dict:
report["near"] = f"{tris(meshes[0].data)}tris+idle"
export(bpy, dest / f"{mid}-near.fbx", src, [meshes[0], arms[0]], animated=True)
else:
- near = join_static(bpy, meshes, arms, None)
+ near = join_static(bpy, meshes, arms, find_pose(bpy, arms, mid))
decimate(bpy, near, NEAR_TRIS)
near.name = mid
report["near"] = f"{tris(near.data)}tris"
export(bpy, dest / f"{mid}-near.fbx", src, [near], animated=False)
meshes, arms = load(bpy, fbx) # the far mesh starts again from the full mesh
- far = join_static(bpy, meshes, arms, find_idle(bpy, arms))
+ far = join_static(bpy, meshes, arms, find_pose(bpy, arms, mid))
decimate(bpy, far, FAR_TRIS_TOWN if mid in TOWNS else FAR_TRIS_VEHICLE if mid in VEHICLES else FAR_TRIS)
far.name = mid
report["far"] = f"{tris(far.data)}tris"
diff --git a/tools/tests/test_slim_collection.py b/tools/tests/test_slim_collection.py
index 66575c6c6..7e541cf2a 100644
--- a/tools/tests/test_slim_collection.py
+++ b/tools/tests/test_slim_collection.py
@@ -37,6 +37,14 @@ def test_the_nine_whole_town_models_are_the_ones_matkot_offered_in_507():
assert "jerusalem-stone-city-v1-3denhance" not in slim.IDS
+def test_a_pose_clip_poses_only_a_person_without_an_idle_clip():
+ # Issue #665: C05 has no idle clip and a T-pose rest, so his static meshes stand at his walk's first frame.
+ assert slim.POSE_CLIP == {"figure-c05-pioneer-veteran-v2": "idle_walk"}
+ animated = re.search(r"Animated = new HashSet<string>.*?\{(.*?)\};", CATALOG.read_text(encoding="utf-8"), re.S).group(1)
+ for mid in slim.POSE_CLIP:
+ assert mid in slim.PEOPLE and f'"{mid}"' not in animated, mid
+
+
def test_the_caps_match_the_unity_import_tests():
text = IMPORT_TESTS.read_text(encoding="utf-8")
assert f"FarTriangles = {slim.FAR_TRIS}," in text
diff --git a/tools/tests/test_units_1948.py b/tools/tests/test_units_1948.py
index 94ff6bc18..931038581 100644
--- a/tools/tests/test_units_1948.py
+++ b/tools/tests/test_units_1948.py
@@ -27,6 +27,8 @@ def sources(u):
for t in u.get('aircraft') or []:
out += t['sources']
out += u.get('headgear_sources') or []
+ for v in u.get('vehicles') or []:
+ out += v['sources']
out += (u.get('disbanded') or {}).get('sources') or []
out += (u.get('strength') or {}).get('sources') or []
return out
@@ -86,6 +88,20 @@ def test_hidden_brigades_and_headgear():
assert u['service'] == 'army' and len(u['headgear']) == 3 and u['headgear_sources'], u['id']
+def test_a_vehicle_is_a_known_type_from_a_sourced_day_on_an_army_unit():
+ # Issue #665: the 65 mm gun and the jeep stand on a token only where a source puts them with the unit, from that day.
+ placed = {}
+ for u in UNITS:
+ for v in u.get('vehicles') or []:
+ assert u['service'] == 'army' and u['side'] == 'israel', u['id']
+ assert v['type'] in ('gun_65mm', 'jeep'), (u['id'], v)
+ assert day(v['from']) >= GAME_START and v['note'].strip() and v['sources'], (u['id'], v)
+ placed.setdefault(v['type'], set()).add(u['id'])
+ types = [v['type'] for v in u.get('vehicles') or []]
+ assert len(types) == len(set(types)), u['id']
+ assert placed == {'gun_65mm': {'carmeli', 'givati', 'harel', 'yiftach', 'negev'}, 'jeep': {'harel', 'negev'}}
+
+
def test_a_toward_point_is_sourced_and_says_why():
for u in UNITS:
for a in u['anchors']:
diff --git a/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-far.fbx b/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-far.fbx
index ee0acc5d1..dcaad0c32 100644
Binary files a/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-far.fbx and b/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-far.fbx differ
diff --git a/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-near.fbx b/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-near.fbx
index 37f9aea7c..641fd8796 100644
Binary files a/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-near.fbx and b/unity/Assets/Art/Collection/figure-c05-pioneer-veteran-v2/figure-c05-pioneer-veteran-v2-near.fbx differ
diff --git a/unity/Assets/Scripts/Map/Units/UnitData.cs b/unity/Assets/Scripts/Map/Units/UnitData.cs
index 05568b0e7..f2480ff20 100644
--- a/unity/Assets/Scripts/Map/Units/UnitData.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitData.cs
@@ -75,6 +75,16 @@ namespace Statecraft.Game.Map.Units
public List<UnitSource> Sources { get; set; } = new List<UnitSource>();
}
+ /// <summary>Equipment a source puts with an army unit from a day (issue #665): <see cref="UnitData.Gun65mm"/> or
+ /// <see cref="UnitData.Jeep"/>, drawn on its token beside the figures from <see cref="From"/> for the rest of its windows.</summary>
+ public sealed class UnitVehicle
+ {
+ public string Type { get; set; } = "";
+ public string From { get; set; } = "";
+ public string Note { get; set; } = "";
+ public List<UnitSource> Sources { get; set; } = new List<UnitSource>();
+ }
+
/// <summary>A unit's sourced disbandment: no window may run past it.</summary>
public sealed class UnitDisbanded
{
@@ -123,6 +133,8 @@ namespace Statecraft.Game.Map.Units
/// <summary>The riflemen's headgear (<see cref="UnitData.Headgears"/>), only where a source ties it to the unit.</summary>
public List<string>? Headgear { get; set; }
public List<UnitSource>? HeadgearSources { get; set; }
+ /// <summary>The sourced equipment drawn on the token (<see cref="UnitVehicle"/>), or null.</summary>
+ public List<UnitVehicle>? Vehicles { get; set; }
public UnitDisbanded? Disbanded { get; set; }
public List<UnitAnchor> Anchors { get; set; } = new List<UnitAnchor>();
public List<UnitAircraft>? Aircraft { get; set; }
@@ -135,8 +147,8 @@ namespace Statecraft.Game.Map.Units
foreach (var s in FactSources()) yield return s;
}
- /// <summary>The sources of the row's facts: its own, its anchors', its aircraft's, its headgear's, its disbandment's
- /// and its strength's. A Hebrew name's source is not one: it does not check a fact, so it never clears
+ /// <summary>The sources of the row's facts: its own, its anchors', its aircraft's, its headgear's, its vehicles',
+ /// its disbandment's and its strength's. A Hebrew name's source is not one: it does not check a fact, so it never clears
/// wikipedia_only (#902).</summary>
public IEnumerable<UnitSource> FactSources()
{
@@ -148,6 +160,7 @@ namespace Statecraft.Game.Map.Units
}
if (Aircraft != null) foreach (var t in Aircraft) foreach (var s in t.Sources) yield return s;
if (HeadgearSources != null) foreach (var s in HeadgearSources) yield return s;
+ if (Vehicles != null) foreach (var v in Vehicles) foreach (var s in v.Sources) yield return s;
if (Disbanded != null) foreach (var s in Disbanded.Sources) yield return s;
if (Strength != null) foreach (var s in Strength.Sources) yield return s;
}
@@ -163,8 +176,8 @@ namespace Statecraft.Game.Map.Units
public const string Army = "army", Air = "air", Navy = "navy";
/// <summary>The sides of 1948 a unit can belong to (Q-START-4, owner, 15 October 2026: "Armies + ALA + local
/// forces"): Israel, the Arab states whose armies entered the war (the fronts of <see cref="FrontArmistice"/>, and
- /// Iraq), the Arab Liberation Army and the local Arab forces, each under its own name. The map draws only Israel's
- /// rows (<see cref="UnitRoster.OnMap"/>; owner, 17 October 2026, #740).</summary>
+ /// Iraq), the Arab Liberation Army and the local Arab forces, each under its own name. The map draws Israel's rows
+ /// and those of a side with a Collection figure (<see cref="UnitRoster.OnMap"/>; owner, 17 October 2026, #740; #665).</summary>
public const string Israel = "israel";
public static readonly IReadOnlyList<string> Sides = new[] { Israel, "egypt", "jordan", "syria", "iraq", "lebanon", "ala", "local_arab_forces" };
/// <summary>The levels a row's formation can be: a state's whole force in the field, or one formation of it.</summary>
@@ -173,6 +186,10 @@ namespace Statecraft.Game.Map.Units
public const string EndBySource = "source", EndByFrontArmistice = "front_armistice";
public const string SlouchHat = "slouch_hat", SteelHelmet = "steel_helmet", WoolCap = "wool_cap";
public static readonly IReadOnlyList<string> Headgears = new[] { SlouchHat, SteelHelmet, WoolCap };
+ /// <summary>The equipment a row can put on its token (<see cref="UnitVehicle"/>): the 65 mm mountain gun (the
+ /// "Napoleonchik") and the jeep.</summary>
+ public const string Gun65mm = "gun_65mm", Jeep = "jeep";
+ public static readonly IReadOnlyList<string> VehicleTypes = new[] { Gun65mm, Jeep };
/// <summary>The uniform default where no source ties headgear to a unit: the 1948 photographs' bush hat and Mk II
/// steel helmet (docs/units.md, "Sources").</summary>
public static readonly IReadOnlyList<string> DefaultHeadgear = new[] { SlouchHat, SteelHelmet, SlouchHat };
@@ -296,6 +313,19 @@ namespace Statecraft.Game.Map.Units
throw new InvalidDataException($"{at} headgear must be three of {string.Join(", ", Headgears)}, on an army unit");
if (u.HeadgearSources == null || u.HeadgearSources.Count == 0) throw new InvalidDataException($"{at} headgear has no source");
}
+ if (u.Vehicles != null)
+ {
+ var types = new HashSet<string>();
+ foreach (var v in u.Vehicles)
+ {
+ if (v == null || u.Service != Army || !((IList<string>)VehicleTypes).Contains(v.Type) || !types.Add(v.Type))
+ throw new InvalidDataException($"{at} vehicles must be one each of {string.Join(", ", VehicleTypes)}, on an army unit");
+ try { Day(v.From); }
+ catch (FormatException e) { throw new InvalidDataException($"{at} vehicle '{v.Type}' from: {e.Message}", e); }
+ v.Sources ??= new List<UnitSource>();
+ if (string.IsNullOrWhiteSpace(v.Note) || v.Sources.Count == 0) throw new InvalidDataException($"{at} vehicle '{v.Type}' needs a note and a source");
+ }
+ }
foreach (var s in u.AllSources())
{
if (s == null || string.IsNullOrWhiteSpace(s.Url) || !s.Url.StartsWith("https://", StringComparison.Ordinal))
diff --git a/unity/Assets/Scripts/Map/Units/UnitFigures.cs b/unity/Assets/Scripts/Map/Units/UnitFigures.cs
new file mode 100644
index 000000000..68515e374
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Units/UnitFigures.cs
@@ -0,0 +1,214 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using Statecraft.Game.Map.Collection;
+using UnityEngine;
+using UnityEngine.Rendering;
+
+namespace Statecraft.Game.Map.Units
+{
+ /// <summary>The 1948 Collection on the army tokens (issue #665, part of #663; models by MATKOT, #507): the figures and the
+ /// vehicles each token draws, streamed after the first frame (<see cref="CollectionStream"/>). Which model goes where is
+ /// in the tables below (docs/units.md, "The 1948 Collection on the tokens").
+ /// An Israeli token is built with its code-built riflemen as before; each figure then asks for its model, and when the
+ /// model arrives it goes under the figure and the code-built renderer is switched off, in the same callback, so nothing
+ /// else moves (the figure's transform, which the camera's yaw turns (#644), its mesh, which the labels' keep-clear boxes
+ /// read, and the badge and flag). It fails open: until a model arrives, and for ever when its bundle is missing or
+ /// damaged, the code-built figure stays. An Arab force's token has no code-built figure at all (owner, 17 October 2026,
+ /// #740: "Nothing is drawn with IDF figures, and there is no placeholder art"): the roster draws it only once its model
+ /// has arrived (<see cref="Arrived"/>). A vehicle has no code-built model either: it appears when it arrives. A model
+ /// that has arrived once is put on new tokens at once (a roster change rebuilds them), so a rebuild never shows the
+ /// code-built figures for a frame.</summary>
+ public static class UnitFigures
+ {
+ /// <summary>The name of the model's object under its figure or vehicle.</summary>
+ public const string ModelName = "CollectionModel";
+
+ public const string SabraPioneer = "figure-c04-sabra-pioneer-v3", PioneerVeteran = "figure-c05-pioneer-veteran-v2",
+ YoungRecruit = "figure-c06-young-recruit-v2", VeteranFighter = "figure-c07-veteran-fighter-v2",
+ PalmachScout = "figure-c12f-palmach-scout-v2", ArabLegion = "figure-c08-arab-legion-v2", Irregular = "figure-c09-irregular-v2",
+ Napoleonchik = "figure-vehicle-napoleonchik-65mm-1948-v2", WillysJeep = "figure-vehicle-willys-jeep-1948-v2";
+
+ /// <summary>An Israeli rifleman's figure by his headgear (the sourced <see cref="UnitEntry.Headgear"/>, or the uniform
+ /// default), as MATKOT's figures wear them and #507 paired them: the bush (slouch) hat is the sabra pioneer (C04), the
+ /// Mk II steel helmet the young recruit (C06), the Palmach's knitted stocking cap the veteran fighter (C07).</summary>
+ public static readonly IReadOnlyDictionary<string, string> ByHeadgear = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ [UnitData.SlouchHat] = SabraPioneer, [UnitData.SteelHelmet] = YoungRecruit, [UnitData.WoolCap] = VeteranFighter,
+ };
+
+ /// <summary>The third figure of an Israeli token whose headgear is the uniform default (no source ties headgear to
+ /// it), in place of the default's second bush hat: the pioneer veteran (C05), bareheaded, except where a row is named
+ /// here. Harel's is the Palmach scout (C12F): Harel was a Palmach brigade (its row's number, palmach.org.il) whose
+ /// battalions escorted the convoys between Sha'ar HaGai, where its token stands, and Saris (its anchor, Izkor);
+ /// a Palmach woman's duties included "escorting convoys" (https://en.wikipedia.org/wiki/Netiva_Ben-Yehuda, checked
+ /// 2026-10-18), and the Palmach memorial site records 34 of its women killed, seventeen in action
+ /// (https://en.wikipedia.org/wiki/Palmach, checked 2026-10-18).</summary>
+ public static readonly IReadOnlyDictionary<string, string> ThirdFigure = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ ["harel"] = PalmachScout,
+ };
+
+ /// <summary>An Arab force's figures, by its side: the Arab Legion (C08) for Transjordan's army, the irregular (C09) for
+ /// the Arab Liberation Army, "an irregular army" of volunteers (https://en.wikipedia.org/wiki/Arab_Liberation_Army,
+ /// checked 2026-10-18). Unit models by MATKOT count as reviewed and approved (owner, 17 October 2026, #756, Q-ART-3).
+ /// No other side has a figure, so its rows stay off the map (<see cref="UnitRoster.OnMap"/>).</summary>
+ public static readonly IReadOnlyDictionary<string, string> BySide = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ ["jordan"] = ArabLegion, ["ala"] = Irregular,
+ };
+
+ /// <summary>A vehicle's model by its type (<see cref="UnitVehicle"/>): the 65 mm gun is H02, the "Napoleonchik"
+ /// (owner, 17 October 2026, #756: MATKOT's H02 is the gun), the jeep H03, the Willys.</summary>
+ public static readonly IReadOnlyDictionary<string, string> ByVehicle = new Dictionary<string, string>(StringComparer.Ordinal)
+ {
+ [UnitData.Gun65mm] = Napoleonchik, [UnitData.Jeep] = WillysJeep,
+ };
+
+ /// <summary>The figure of an Arab force's side, or null (that side's rows stay off the map).</summary>
+ public static string? SideFigure(string side) => BySide.TryGetValue(side, out var id) ? id : null;
+
+ /// <summary>The model for figure <paramref name="index"/> (0 to 2) of <paramref name="u"/>'s token, wearing
+ /// <paramref name="headgear"/> on an Israeli token (ignored on another side's).</summary>
+ public static string? FigureFor(UnitEntry u, int index, string? headgear)
+ {
+ if (u.Side != UnitData.Israel) return SideFigure(u.Side);
+ if (index == 2 && u.Headgear == null) return ThirdFigure.TryGetValue(u.Id, out var third) ? third : PioneerVeteran;
+ return headgear != null && ByHeadgear.TryGetValue(headgear, out var id) ? id : null;
+ }
+
+ /// <summary>The vehicles <paramref name="u"/>'s token draws on <paramref name="date"/>: each sourced one from its day,
+ /// in the data's order, as model ids.</summary>
+ public static IReadOnlyList<string> VehiclesAt(UnitEntry u, DateTime date)
+ {
+ if (u.Vehicles == null) return Array.Empty<string>();
+ var list = new List<string>();
+ foreach (var v in u.Vehicles)
+ if (date >= UnitData.Day(v.From)) list.Add(ByVehicle[v.Type]);
+ return list;
+ }
+
+ /// <summary>How a model is asked for: the game's stream in a player or in play mode. In edit mode nothing is asked for
+ /// (the stream's coroutine never runs there), unless a caller sets <see cref="Source"/>: the editor's captures load the
+ /// prefabs at once, and the tests answer by hand.</summary>
+ public static Action<string, CollectionDetail, Action<GameObject?>>? Source { get; set; }
+
+ static Action<string, CollectionDetail, Action<GameObject?>>? Requester =>
+ Source ?? (Application.isPlaying ? new Action<string, CollectionDetail, Action<GameObject?>>(CollectionStream.Request) : null);
+
+ /// <summary>The models that have arrived, by id, and the ids asked for and not yet answered.</summary>
+ static readonly Dictionary<string, GameObject> arrived = new Dictionary<string, GameObject>(StringComparer.Ordinal);
+ static readonly HashSet<string> asked = new HashSet<string>(StringComparer.Ordinal);
+ /// <summary>The figures and vehicles waiting for each asked-for model.</summary>
+ static readonly Dictionary<string, List<Transform>> waiting = new Dictionary<string, List<Transform>>(StringComparer.Ordinal);
+
+ /// <summary>Raised once for each model when it first arrives (the unit layer then draws the tokens that waited for it).</summary>
+ public static event Action<string>? ModelArrived;
+
+ /// <summary>Forgets every model and request (tests, and a change of <see cref="Source"/>).</summary>
+ public static void Forget() { arrived.Clear(); asked.Clear(); waiting.Clear(); }
+
+ /// <summary>True when model <paramref name="id"/> has arrived (and its prefab still exists).</summary>
+ public static bool Arrived(string id) => arrived.TryGetValue(id, out var p) && p != null;
+
+ /// <summary>Asks for model <paramref name="id"/> once, without a figure to put it on (an Arab force's token waits for it).</summary>
+ public static void Prefetch(string id) => Ask(id);
+
+ /// <summary>Puts model <paramref name="id"/> on <paramref name="piece"/> (a figure or a vehicle's holder, in real metres
+ /// scaled by <see cref="UnitShowcase.FigureScale"/>): at once when it has arrived, else when it arrives. Nothing for a
+ /// null id.</summary>
+ public static void Dress(Transform piece, string? id)
+ {
+ if (id == null || piece == null) return;
+ if (arrived.TryGetValue(id, out var have) && have != null) { Swap(piece, id, have); return; }
+ if (!waiting.TryGetValue(id, out var list)) waiting[id] = list = new List<Transform>();
+ list.Add(piece);
+ Ask(id);
+ }
+
+ static void Ask(string id)
+ {
+ if (Arrived(id) || asked.Contains(id)) return;
+ var ask = Requester;
+ if (ask == null) return;
+ asked.Add(id);
+ ask(id, CollectionDetail.Far, prefab =>
+ {
+ asked.Remove(id);
+ var pieces = waiting.TryGetValue(id, out var l) ? l : null;
+ waiting.Remove(id);
+ if (prefab == null) return; // fail open: the code-built figure stays (the stream has warned once)
+ if (arrived.Count == 0 && Application.isPlaying) Debug.Log("UNITS figures: the Collection's figures streamed in");
+ arrived[id] = prefab;
+ if (pieces != null) foreach (var p in pieces) if (p != null) Swap(p, id, prefab); // a token rebuilt meanwhile is gone
+ ModelArrived?.Invoke(id);
+ });
+ }
+
+ /// <summary>A vehicle's length (its longest side, seen from above) as a share of a drawn figure's height: the models
+ /// are sized against the figures as Civ draws them, not to scale (as the aircraft and the ship, docs/units.md), so a
+ /// vehicle fits on the token's base behind the trio.</summary>
+ public const float VehicleLengthShare = 0.7f;
+
+ /// <summary>The swap: the model under the piece, in its frame (facing +Z, feet or wheels on the origin), and the
+ /// code-built mesh's renderer off, together. A figure takes the code-built figure's height (or, with none, a man's
+ /// height); a vehicle takes <see cref="VehicleLengthShare"/>.</summary>
+ static void Swap(Transform piece, string id, GameObject prefab)
+ {
+ if (piece.Find(ModelName) != null) return;
+ // The model under a holder in the piece's frame: the prefab keeps its own root transform (every Collection far
+ // prefab's root carries the FBX's axis turn, -90 degrees about X; resetting it would lay the model on its back).
+ // The piece's yaw (the camera's turn, #644) is its parent's, so it composes on top of that rotation.
+ var holder = new GameObject(ModelName).transform;
+ holder.SetParent(piece, false);
+ var model = UnityEngine.Object.Instantiate(prefab, holder, false);
+ var code = piece.TryGetComponent<MeshRenderer>(out var mr) ? mr : null;
+ var renderers = model.GetComponentsInChildren<Renderer>(true);
+ if (renderers.Length > 0)
+ {
+ // The box in the holder's frame, from each mesh's own bounds (Renderer.bounds is empty while the layer is off).
+ var inv = holder.worldToLocalMatrix;
+ Bounds? box = null;
+ foreach (var f in model.GetComponentsInChildren<MeshFilter>(true))
+ {
+ if (f.sharedMesh == null) continue;
+ var b = f.sharedMesh.bounds; var m = inv * f.transform.localToWorldMatrix;
+ for (int c = 0; c < 8; c++)
+ {
+ var p = m.MultiplyPoint3x4(new Vector3((c & 1) == 0 ? b.min.x : b.max.x, (c & 2) == 0 ? b.min.y : b.max.y, (c & 4) == 0 ? b.min.z : b.max.z));
+ if (box is Bounds bb) { bb.Encapsulate(p); box = bb; } else box = new Bounds(p, Vector3.zero);
+ }
+ }
+ if (box is Bounds have && have.size.y > 1e-6f)
+ {
+ float k;
+ bool vehicle = ByVehicleId(id);
+ if (vehicle) k = VehicleLengthShare * UnitBadge.FigureHeightM / Mathf.Max(have.size.x, have.size.z, 1e-6f);
+ else
+ {
+ // An Arab force's figure has no code-built mesh (no MeshFilter: TryGetComponent, as ?. skips Unity's null).
+ var codeMesh = piece.TryGetComponent<MeshFilter>(out var mf) ? mf.sharedMesh : null;
+ k = (codeMesh != null ? codeMesh.bounds.size.y : UnitBadge.FigureHeightM) / have.size.y;
+ }
+ model.transform.localPosition -= new Vector3(have.center.x, have.min.y, have.center.z); // centred, feet on the origin
+ holder.localScale = Vector3.one * k;
+ }
+ }
+ foreach (var r in renderers)
+ {
+ if (code != null) { r.shadowCastingMode = code.shadowCastingMode; r.receiveShadows = code.receiveShadows; }
+ r.lightProbeUsage = LightProbeUsage.Off; r.reflectionProbeUsage = ReflectionProbeUsage.Off;
+ }
+ if (code != null) code.enabled = false;
+ }
+
+ static bool ByVehicleId(string id) => id == Napoleonchik || id == WillysJeep;
+
+ /// <summary>True when <paramref name="piece"/> shows its Collection model (and not a code-built mesh).</summary>
+ public static bool Dressed(Transform piece)
+ {
+ var code = piece.TryGetComponent<MeshRenderer>(out var mr) ? mr : null;
+ return piece.Find(ModelName) != null && (code == null || !code.enabled);
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Units/UnitFigures.cs.meta b/unity/Assets/Scripts/Map/Units/UnitFigures.cs.meta
new file mode 100644
index 000000000..58929054e
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Units/UnitFigures.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: eea3eda570b5d40168a136d627b5601b
\ No newline at end of file
diff --git a/unity/Assets/Scripts/Map/Units/UnitFlags.cs b/unity/Assets/Scripts/Map/Units/UnitFlags.cs
index 42dd7e6a0..8ec700ef8 100644
--- a/unity/Assets/Scripts/Map/Units/UnitFlags.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitFlags.cs
@@ -22,7 +22,11 @@ namespace Statecraft.Game.Map.Units
/// Israel", https://en.wikipedia.org/wiki/Israeli_Declaration_of_Independence, checked 2026-10-14), so it flies from
/// the game's first day. The gazette says only "dark sky-blue" (tkhelet kehe); the cloth's blue
/// (<see cref="BlueColour"/>) is a choice, a little brighter than the roundel's so it reads unlit.
- /// - Egypt, Jordan, Syria, Iraq, Lebanon: no sourced flag in the repo yet, so none (#226 brings the Arab forces).
+ /// - Egypt, Jordan, Syria, Iraq, Lebanon: no sourced flag in the repo yet, so none. A side the map draws without one (the
+ /// Arab Legion and the Arab Liberation Army, issue #665) flies a neutral pennant instead (<see cref="BuildPennant"/>):
+ /// Q-ART-1, decided by the owner on 15 October 2026 ("2+3"): "a neutral pennant now, replaced by a sourced emblem when
+ /// one is found" (docs/superpowers/plans/2026-10-15-gdd-phase-5.md, PR 17). Never the ALA's dagger emblem (#226,
+ /// ruling 8).
/// Proportions on the token follow T29: the cloth about half a figure's height, the pole about one and a half.</summary>
public static class UnitFlags
{
@@ -41,6 +45,26 @@ namespace Statecraft.Game.Map.Units
public static bool Has(string? side) => side != null && Sourced.Contains(side);
+ /// <summary>True when <paramref name="side"/>'s tokens fly the neutral pennant: a side the map draws with no sourced flag.</summary>
+ public static bool HasPennant(string? side) => side != null && !Has(side) && UnitFigures.SideFigure(side) != null;
+
+ public const string PennantMeshName = "UnitFlag/pennant";
+ /// <summary>The pennant's cloth: a plain triangle from the pole's top, <see cref="FlagWidth"/> long and
+ /// <see cref="PennantHeight"/> at the pole (figure heights), in the palette's neutral grey (<see cref="UnitPalette.HullGrey"/>):
+ /// no colour of any side, and not white.</summary>
+ public const float PennantHeight = 0.36f;
+
+ /// <summary>The pole and the neutral pennant, one submesh in the units' palette.</summary>
+ public static Mesh BuildPennant()
+ {
+ var m = new MiniatureMesh();
+ m.Rod(Vector3.zero, new Vector3(0, PoleHeight, 0), PoleRadius, PoleRadius * 0.8f, P.RifleWood, segments: 8, shade: 0.7f);
+ m.Ellipsoid(Matrix4x4.TRS(new Vector3(0, PoleHeight + 0.02f, 0), Quaternion.identity, Vector3.one * 0.035f), P.RifleWood, 8, 4, shade: 0.9f);
+ var cloth = new List<Vector2> { new Vector2(FlagLeft, FlagTop - PennantHeight), new Vector2(FlagLeft + FlagWidth, FlagTop - PennantHeight / 2f), new Vector2(FlagLeft, FlagTop) };
+ m.Plate(Plane(0f), cloth, P.HullGrey, shade: 0.9f);
+ return m.Build(PennantMeshName);
+ }
+
public static string MeshName(string side) => "UnitFlag/" + side;
/// <summary>The pole and flag of <paramref name="side"/>, or null when the side has no sourced flag.</summary>
diff --git a/unity/Assets/Scripts/Map/Units/UnitLayer.cs b/unity/Assets/Scripts/Map/Units/UnitLayer.cs
index 81e552e34..025616e02 100644
--- a/unity/Assets/Scripts/Map/Units/UnitLayer.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitLayer.cs
@@ -37,6 +37,10 @@ namespace Statecraft.Game.Map.Units
/// destroyed when the tokens are rebuilt and with the layer, so no roster change leaks them (review of #559, M1).</summary>
readonly List<Mesh> tokenMeshes = new List<Mesh>();
List<UnitToken>? roster;
+ /// <summary>What <see cref="Show"/> last drew from, so a Collection model's arrival can draw the tokens that waited for
+ /// it (an Arab force's, issue #665).</summary>
+ Content? shownContent;
+ GameState? shownState;
List<PlacedToken> placed = new List<PlacedToken>();
Transform tokensRoot = null!;
readonly List<Transform> badges = new List<Transform>();
@@ -133,6 +137,12 @@ namespace Statecraft.Game.Map.Units
// off: a plain screenshot run (HiddenInCaptures) keeps every tree, so its checkpoints stay comparable.
layer.assets.OnTeardown(() => UnitShowcase.HideTrees(map, ToggleName, Array.Empty<(Vector2, float)>()));
layer.assets.OnTeardown(layer.FreeTokenMeshes);
+ // The Collection's figures (issue #665): an Arab force's token waits for its figure, so ask for each one the map
+ // can draw (nothing is fetched before the frame after the request, CollectionStream), and draw again when one arrives.
+ UnitFigures.ModelArrived += layer.OnModelArrived;
+ layer.assets.OnTeardown(() => UnitFigures.ModelArrived -= layer.OnModelArrived);
+ foreach (var u in units)
+ if (UnitRoster.OnMap(u) && u.Side != UnitData.Israel) UnitFigures.Prefetch(UnitFigures.SideFigure(u.Side)!);
layer.assets.OnTeardown(VisualToggles.Register(ToggleName, on =>
{
if (root != null) root.SetActive(on);
@@ -227,7 +237,8 @@ namespace Statecraft.Game.Map.Units
/// changed; returns true when it did. A selected unit that is no longer drawn is deselected.</summary>
public bool Show(Content content, GameState state)
{
- var now = UnitRoster.Build(units, content, state);
+ shownContent = content; shownState = state;
+ var now = UnitRoster.Build(units, content, state, UnitFigures.Arrived);
if (roster != null && roster.SequenceEqual(now)) return false;
roster = now;
placed = UnitPlacer.Place(now, spots);
@@ -236,6 +247,18 @@ namespace Statecraft.Game.Map.Units
return true;
}
+ /// <summary>A Collection model arrived: draws the tokens again if it lets a new one show (an Arab force's figure).</summary>
+ void OnModelArrived(string id)
+ {
+ if (this == null || shownContent == null || shownState == null) return;
+ Show(shownContent, shownState);
+ }
+
+ /// <summary>Where a token's vehicles stand on its base (shares of the base's radius, x east and z north, for camera
+ /// yaw 0) and their headings: on the front of the base, before the trio, side-on to the camera, so the figures do
+ /// not hide them (behind the trio they were hidden at 30 km; issue #665). The first on the west, a second on the east.</summary>
+ internal static readonly (Vector2 at, float heading)[] VehicleSlots = { (new Vector2(-0.42f, -0.55f), 270f), (new Vector2(0.42f, -0.55f), 90f) };
+
/// <summary>What a click on hex (q, r) selects: the unit standing there, unless it is already selected (a second
/// click shows the hex, so a token never hides the hex's map actions) or the "units" toggle hides the layer; null
/// means show the hex.</summary>
@@ -335,19 +358,37 @@ namespace Statecraft.Game.Map.Units
treeHoles.Add((new Vector2(centre.x, centre.z), plinth * UnitPlinth.RimOuter));
var offsets = UnitShowcase.FigureOffsets(t.Figures);
float highest = foot.y; // the badge clears the highest figure (on a slope the uphill one stands higher)
- figures = new (Transform, Vector3, float)[offsets.Length];
+ bool israel = t.Unit.Side == UnitData.Israel;
+ int vehicles = Mathf.Min(t.Vehicles.Count, VehicleSlots.Length);
+ figures = new (Transform, Vector3, float)[offsets.Length + vehicles];
for (int i = 0; i < offsets.Length; i++)
{
// The pose and heading are the trio position's; the headgear is the unit's (sourced, or the default).
var (_, _, pose, faded, heading) = UnitShowcase.Trio[i];
- var hat = Hat(t.Headgear[i]);
- var type = UnitRoster.RiflemanType(t.Headgear[i]);
var at = centre + new Vector3(offsets[i].x, 0, offsets[i].y) * k;
at.y = UnitPlinth.FigureY(map, plinth, at.x, at.z);
highest = Mathf.Max(highest, at.y);
- var figure = UnitShowcase.Piece(go.transform, $"Rifleman{i}", type, () => MeshFor($"{type}/{pose}", () => UnitModels.Rifleman(hat, pose, faded, type)),
- paint, at, Quaternion.Euler(0, heading, 0), UnitShowcase.FigureScale, out _);
- figures[i] = (figure.transform, new Vector3(offsets[i].x, 0, offsets[i].y) * k, heading);
+ Transform figure;
+ if (israel)
+ {
+ var hat = Hat(t.Headgear[i]);
+ var type = UnitRoster.RiflemanType(t.Headgear[i]);
+ figure = UnitShowcase.Piece(go.transform, $"Rifleman{i}", type, () => MeshFor($"{type}/{pose}", () => UnitModels.Rifleman(hat, pose, faded, type)),
+ paint, at, Quaternion.Euler(0, heading, 0), UnitShowcase.FigureScale, out _).transform;
+ }
+ else figure = EmptyPiece(go.transform, $"Figure{i}", at, heading); // no code-built figure for another side (#740)
+ UnitFigures.Dress(figure, UnitFigures.FigureFor(t.Unit, i, israel ? t.Headgear[i] : null)); // the Collection's figure, once streamed (#665)
+ figures[i] = (figure, new Vector3(offsets[i].x, 0, offsets[i].y) * k, heading);
+ }
+ for (int j = 0; j < vehicles; j++)
+ {
+ var (slot, heading) = VehicleSlots[j];
+ var offset = new Vector3(slot.x, 0f, slot.y) * plinth;
+ var at = centre + offset;
+ at.y = UnitPlinth.FigureY(map, plinth, at.x, at.z);
+ var vehicle = EmptyPiece(go.transform, $"Vehicle{j}", at, heading);
+ UnitFigures.Dress(vehicle, t.Vehicles[j]); // the gun or the jeep: drawn only once streamed (#665)
+ figures[offsets.Length + j] = (vehicle, offset, heading);
}
foot.y = highest;
top = UnitBadge.FigureHeightM * UnitShowcase.FigureScale;
@@ -418,6 +459,16 @@ namespace Statecraft.Game.Map.Units
return box;
}
+ /// <summary>A piece with no code-built model (an Arab force's figure, a vehicle): the Collection's model goes under it.</summary>
+ static Transform EmptyPiece(Transform parent, string name, Vector3 at, float heading)
+ {
+ var piece = new GameObject(name).transform;
+ piece.SetParent(parent, false);
+ piece.SetPositionAndRotation(at, Quaternion.Euler(0, heading, 0));
+ piece.localScale = Vector3.one * UnitShowcase.FigureScale;
+ return piece;
+ }
+
static void AddRenderer(Transform parent, string name, Mesh mesh, Material mat, float z)
{
var go = new GameObject(name);
diff --git a/unity/Assets/Scripts/Map/Units/UnitPlinth.cs b/unity/Assets/Scripts/Map/Units/UnitPlinth.cs
index eddca48e1..a9c2c40e9 100644
--- a/unity/Assets/Scripts/Map/Units/UnitPlinth.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitPlinth.cs
@@ -247,7 +247,8 @@ namespace Statecraft.Game.Map.Units
public static Mesh Upload(Mesh m) { if (!KeepMeshesReadable) m.UploadMeshData(true); return m; }
/// <summary>Builds the draped base, its lip and its ring, of radius <paramref name="radius"/> at
- /// <paramref name="centre"/> under <paramref name="token"/>, and <paramref name="side"/>'s flag when it has one.
+ /// <paramref name="centre"/> under <paramref name="token"/>, and <paramref name="side"/>'s flag when it has one (the neutral
+ /// pennant when the map draws the side without one, <see cref="UnitFlags.HasPennant"/>).
/// <paramref name="own"/> takes ownership of each per-token mesh; <paramref name="shared"/> returns the shared flag
/// mesh for a key. Returns the base's top at its centre.</summary>
public static float Build(MapScene map, Transform token, Vector3 centre, float radius, string side, Func<Mesh, Mesh> own,
@@ -261,16 +262,19 @@ namespace Statecraft.Game.Map.Units
ring.transform.localScale = scale;
var r = ring.GetComponent<MeshRenderer>();
r.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; r.receiveShadows = false;
- if (UnitFlags.Has(side))
+ bool pennant = UnitFlags.HasPennant(side);
+ if (UnitFlags.Has(side) || pennant)
{
float edge = FlagEdgeShare * radius;
float east = Mathf.Min(edge * 0.95f, Mathf.Max(FlagEastShare * radius, UnitBadge.SizeM / 2f + FlagClearOfBadgeM));
float north = Mathf.Sqrt(edge * edge - east * east);
var foot = new Vector3(centre.x + east, 0f, centre.z + north);
foot.y = FigureY(map, radius, foot.x, foot.z);
- var flag = UnitShowcase.Piece(token, FlagName, shared("unit-flag-" + side, () => UnitFlags.Build(side)!), paint, foot, Quaternion.identity,
- UnitBadge.FigureHeightM * UnitShowcase.FigureScale);
- flag.GetComponent<MeshRenderer>().sharedMaterials = new[] { paint, flagWhite, flagBlue };
+ var flag = pennant
+ ? UnitShowcase.Piece(token, FlagName, shared("unit-pennant", UnitFlags.BuildPennant), paint, foot, Quaternion.identity, UnitBadge.FigureHeightM * UnitShowcase.FigureScale)
+ : UnitShowcase.Piece(token, FlagName, shared("unit-flag-" + side, () => UnitFlags.Build(side)!), paint, foot, Quaternion.identity,
+ UnitBadge.FigureHeightM * UnitShowcase.FigureScale);
+ if (!pennant) flag.GetComponent<MeshRenderer>().sharedMaterials = new[] { paint, flagWhite, flagBlue };
flag.AddComponent<UnitFlagFacing>(); // owner ruling, 2026-10-15: the cloth turns about the pole to face the camera
var cam = Camera.main; if (cam != null) UnitFlagFacing.Face(flag.transform, cam.transform.position);
}
diff --git a/unity/Assets/Scripts/Map/Units/UnitRoster.cs b/unity/Assets/Scripts/Map/Units/UnitRoster.cs
index 79e2576ea..3c25de27c 100644
--- a/unity/Assets/Scripts/Map/Units/UnitRoster.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitRoster.cs
@@ -20,25 +20,31 @@ namespace Statecraft.Game.Map.Units
/// <summary>An army token's riflemen's headgear, one per figure in the trio's order (<see cref="UnitData.Headgears"/>);
/// empty for aircraft and ships.</summary>
public IReadOnlyList<string> Headgear { get; }
+ /// <summary>The Collection vehicles the token draws beside its figures (model ids, <see cref="UnitFigures.VehiclesAt"/>;
+ /// issue #665); empty for most.</summary>
+ public IReadOnlyList<string> Vehicles { get; }
- public UnitToken(UnitEntry unit, UnitAnchor anchor, int figures, string artType, bool flying, IReadOnlyList<string>? headgear = null)
+ public UnitToken(UnitEntry unit, UnitAnchor anchor, int figures, string artType, bool flying, IReadOnlyList<string>? headgear = null,
+ IReadOnlyList<string>? vehicles = null)
{
Unit = unit; Anchor = anchor; Figures = figures; ArtType = artType; Flying = flying;
Headgear = headgear ?? Array.Empty<string>();
+ Vehicles = vehicles ?? Array.Empty<string>();
}
public bool Equals(UnitToken? o) => o != null && ReferenceEquals(Unit, o.Unit) && ReferenceEquals(Anchor, o.Anchor)
- && Figures == o.Figures && ArtType == o.ArtType && Flying == o.Flying && Headgear.SequenceEqual(o.Headgear);
+ && Figures == o.Figures && ArtType == o.ArtType && Flying == o.Flying && Headgear.SequenceEqual(o.Headgear)
+ && Vehicles.SequenceEqual(o.Vehicles);
public override bool Equals(object? o) => Equals(o as UnitToken);
public override int GetHashCode() => HashCode.Combine(Unit.Id, Anchor.Place, Figures, ArtType, Flying);
- public override string ToString() => $"{Unit.Id}@{Anchor.Place}:{ArtType}x{Figures}{(Headgear.Count > 0 ? "[" + string.Join("/", Headgear) + "]" : "")}{(Flying ? " flying" : "")}";
+ public override string ToString() => $"{Unit.Id}@{Anchor.Place}:{ArtType}x{Figures}{(Headgear.Count > 0 ? "[" + string.Join("/", Headgear) + "]" : "")}{(Vehicles.Count > 0 ? "+" + string.Join("+", Vehicles) : "")}{(Flying ? " flying" : "")}";
}
/// <summary>Which units the map draws, from the sim's state and the map-only unit data (docs/units.md, "Units in play").
/// Pure and read-only: it reads the date, the security level and the reserve call-up, and never writes the state, so
/// the sim and its goldens cannot move (UnitsInPlayTests). Rules (owner, 2026-10-11):
- /// a unit shows while the date is inside one of its sourced anchor windows, and never when its row is hidden or is not
- /// Israel's (<see cref="OnMap"/>);
+ /// a unit shows while the date is inside one of its sourced anchor windows, and never when its row is hidden or is another
+ /// side's with no Collection figure (<see cref="OnMap"/>); an Arab force's token shows only once its figure has arrived;
/// an army token has 3 figures at a call-up of at least the security-level-4 floor (rules.yaml rung_min_mobilization,
/// 0.4), 2 at the level-3 floor (0.15), else 1; an air unit flies at security level 4 or 5 and stands parked below it,
/// as the aircraft type of its dated window (the Avia S-199, then the Spitfire).</summary>
@@ -46,21 +52,30 @@ namespace Statecraft.Game.Map.Units
{
public const int FlyingFromRung = 4;
- /// <summary>Whether the map draws <paramref name="u"/> at all: not hidden, and Israel's. The Arab forces' rows are
- /// data only until Phase 5 PR 17's figures land, after its sensitivity review (owner, 17 October 2026, #740: "Nothing
- /// is drawn with IDF figures, and there is no placeholder art"). The roster and the placer both skip every other
- /// row, so such a row draws no token, takes no spot and clears no ground for the kits.</summary>
- public static bool OnMap(UnitEntry u) => u.Hidden == null && u.Side == UnitData.Israel;
+ /// <summary>Whether the map draws <paramref name="u"/> at all: not hidden, and Israel's or a side with a Collection
+ /// figure (<see cref="UnitFigures.SideFigure"/>: the Arab Legion and the Arab Liberation Army, issue #665). The Arab
+ /// forces' rows were data only until their figures landed, after the sensitivity review (owner, 17 October 2026,
+ /// #740: "Nothing is drawn with IDF figures, and there is no placeholder art"); MATKOT's unit models count as reviewed
+ /// and approved (owner, 17 October 2026, #756). Every other side's rows stay data only. The roster and the placer both
+ /// skip a row that is not on the map, so it draws no token, takes no spot and clears no ground for the kits.</summary>
+ public static bool OnMap(UnitEntry u) => u.Hidden == null && (u.Side == UnitData.Israel || UnitFigures.SideFigure(u.Side) != null);
- public static List<UnitToken> Build(IReadOnlyList<UnitEntry> units, Content content, GameState state)
+ /// <summary>An Arab force's token has three figures: Q-UI-3 gives 3 at two thirds of full strength or more (owner,
+ /// 17 October 2026, #226), and the rows give only the sourced 15 May strength, so every force stands at full strength.</summary>
+ public const int SideFigures = 3;
+
+ /// <param name="arrived">Whether a Collection model has arrived (<see cref="UnitFigures.Arrived"/>): an Arab force's
+ /// token is drawn only once its figure has (it has no code-built figure). Null: none has.</param>
+ public static List<UnitToken> Build(IReadOnlyList<UnitEntry> units, Content content, GameState state, Func<string, bool>? arrived = null)
{
if (units == null) throw new ArgumentNullException(nameof(units));
if (content == null) throw new ArgumentNullException(nameof(content));
if (state == null) throw new ArgumentNullException(nameof(state));
- return Build(units, content.RulesAt(state.Date), state.Date, state.Rung, state.Mobilization);
+ return Build(units, content.RulesAt(state.Date), state.Date, state.Rung, state.Mobilization, arrived);
}
- public static List<UnitToken> Build(IReadOnlyList<UnitEntry> units, Rules rules, DateTime date, int rung, double mobilization)
+ public static List<UnitToken> Build(IReadOnlyList<UnitEntry> units, Rules rules, DateTime date, int rung, double mobilization,
+ Func<string, bool>? arrived = null)
{
var list = new List<UnitToken>();
foreach (var u in units)
@@ -68,12 +83,19 @@ namespace Statecraft.Game.Map.Units
if (!OnMap(u)) continue;
var anchor = AnchorAt(u, date);
if (anchor == null) continue;
+ if (u.Side != UnitData.Israel)
+ {
+ var figure = UnitFigures.SideFigure(u.Side)!;
+ if (u.Service == UnitData.Army && arrived != null && arrived(figure))
+ list.Add(new UnitToken(u, anchor, SideFigures, figure, false));
+ continue;
+ }
switch (u.Service)
{
case UnitData.Army:
int figures = FiguresFor(rules, mobilization);
var hats = (u.Headgear ?? (IReadOnlyList<string>)UnitData.DefaultHeadgear).Take(figures).ToList();
- list.Add(new UnitToken(u, anchor, figures, RiflemanType(hats[0]), false, hats));
+ list.Add(new UnitToken(u, anchor, figures, RiflemanType(hats[0]), false, hats, UnitFigures.VehiclesAt(u, date)));
break;
case UnitData.Air:
var type = AircraftAt(u, date);
diff --git a/unity/Assets/Scripts/Map/Units/UnitShowcase.cs b/unity/Assets/Scripts/Map/Units/UnitShowcase.cs
index f1e2fadc8..9a49b963b 100644
--- a/unity/Assets/Scripts/Map/Units/UnitShowcase.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitShowcase.cs
@@ -151,8 +151,10 @@ namespace Statecraft.Game.Map.Units
var (type, hat, pose, faded, heading) = looks[i];
var p = centre + new Vector3(offsets[i].x, 0, offsets[i].y) * DrawSpread * hex;
p.y = UnitPlinth.FigureY(map, plinth, p.x, p.z);
- Piece(root.transform, $"Rifleman{i}", type, () => Built(UnitModels.Rifleman(hat, pose, faded, $"Rifleman1948-{i}")),
+ var figure = Piece(root.transform, $"Rifleman{i}", type, () => Built(UnitModels.Rifleman(hat, pose, faded, $"Rifleman1948-{i}")),
paint, p, Quaternion.Euler(0, heading, 0), FigureScale);
+ var headgear = UnitData.Headgears.First(h => UnitRoster.RiflemanType(h) == type);
+ UnitFigures.Dress(figure.transform, UnitFigures.ByHeadgear[headgear]); // the Collection's soldier, once streamed (#665)
}
Ring(map, assets, ringTemplate, root.transform, centre, RingRadius * hex);
diff --git a/unity/Assets/Scripts/UI/UnitCard.cs b/unity/Assets/Scripts/UI/UnitCard.cs
index ba8baa44c..37d75d903 100644
--- a/unity/Assets/Scripts/UI/UnitCard.cs
+++ b/unity/Assets/Scripts/UI/UnitCard.cs
@@ -10,9 +10,9 @@ namespace Statecraft.Game.UI
/// <summary>The info panel's text for a selected unit (read only; no orders: the panel links to the Defence screen):
/// its name, number and service; where it stands, and since when only from a sourced start (the anchor's `since`,
/// never the game's first day: review I1); its formation and first commander where sourced; the sector in the
- /// source's words; the national values its token reflects (the reserve call-up sets its figures, the security level
- /// whether its aircraft fly); and its sources, with a draft note that says "Wikipedia only" when the position's own
- /// sources are (review M8).</summary>
+ /// source's words; on Israel's units, the national values its token reflects (the reserve call-up sets its figures, the
+ /// security level whether its aircraft fly); and its sources, with a draft note that says "Wikipedia only" when the
+ /// position's own sources are (review M8).</summary>
public sealed class UnitCard
{
public string Title = "", Subtitle = "", Body = "", Footer = "", Note = "";
@@ -36,7 +36,9 @@ namespace Statecraft.Game.UI
Title = u.Name,
Subtitle = text.Format("unit.subtitle", u.Number, text["unit.service." + u.Service]),
Body = string.Join("\n", lines),
- Footer = text.Format("unit.national", PlayerText.Percent(state.Mobilization), state.Rung) + "\n" + text.Format("unit.sources", string.Join(", ", hosts)),
+ // Israel's call-up and security level set only Israel's tokens; an Arab force's token reflects neither (#665).
+ Footer = (u.Side == UnitData.Israel ? text.Format("unit.national", PlayerText.Percent(state.Mobilization), state.Rung) + "\n" : "")
+ + text.Format("unit.sources", string.Join(", ", hosts)),
Note = UnitData.IsWikipediaOnly(a.Sources) ? text["unit.draft_wikipedia"] : text["unit.draft"],
};
}
diff --git a/unity/Assets/Tests/EditMode/UnitFiguresTests.cs b/unity/Assets/Tests/EditMode/UnitFiguresTests.cs
new file mode 100644
index 000000000..4d72f3100
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/UnitFiguresTests.cs
@@ -0,0 +1,352 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text.RegularExpressions;
+using NUnit.Framework;
+using Statecraft.Game;
+using Statecraft.Game.Map;
+using Statecraft.Game.Map.Collection;
+using Statecraft.Game.Map.Units;
+using Statecraft.Sim;
+using UnityEditor;
+using UnityEditor.SceneManagement;
+using UnityEngine;
+using UnityEngine.TestTools;
+
+/// <summary>Issue #665: the 1948 Collection (MATKOT, #507) on the army tokens, streamed after the first frame. Every one of
+/// the nine unit models is placed (owner, 17 October 2026, #663: every model is used): the five Israeli figures, the Arab
+/// Legion and the irregular on their forces' tokens, and the 65 mm gun and the jeep where a source puts them. Until a model
+/// arrives, and when its bundle is missing or damaged, an Israeli token keeps its code-built figures (fail open); an Arab
+/// force's token is not drawn at all (#740: no IDF figures, no placeholder).</summary>
+public class UnitFiguresTests
+{
+ static readonly Content C = ContentLoader.Load(Paths.Content);
+ static List<UnitEntry> Units => UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));
+ static readonly DateTime May20 = new DateTime(1948, 5, 20), July12 = new DateTime(1948, 7, 12), LastArmistice = new DateTime(1949, 7, 20);
+
+ /// <summary>The nine unit models of #665.</summary>
+ static readonly string[] Nine =
+ {
+ "figure-c04-sabra-pioneer-v3", "figure-c05-pioneer-veteran-v2", "figure-c06-young-recruit-v2", "figure-c07-veteran-fighter-v2",
+ "figure-c12f-palmach-scout-v2", "figure-c08-arab-legion-v2", "figure-c09-irregular-v2",
+ "figure-vehicle-napoleonchik-65mm-1948-v2", "figure-vehicle-willys-jeep-1948-v2",
+ };
+
+ [SetUp] public void Fresh() { UnitFigures.Source = null; UnitFigures.Forget(); }
+ [TearDown] public void Restore() { UnitFigures.Source = null; UnitFigures.Forget(); }
+
+ static GameState StateAt(DateTime date, double mobilization)
+ {
+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical).Clone();
+ s.Date = date; s.Rung = 5; s.Mobilization = mobilization;
+ return s;
+ }
+
+ static MapScene BuildMap()
+ {
+ EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single);
+ var map = new GameObject("MapScene").AddComponent<MapScene>();
+ map.Configure(Load("Terrain"), Load("SettlementMarker"), Load("HexSelection"), Load("Sea"), Load("MapFrame"));
+ Statecraft.Game.Map.Kits.KitPopulation.Use(Statecraft.Game.Map.Kits.KitPopulation.Parse(
+ File.ReadAllText(Path.Combine(Paths.Content, "map", Statecraft.Game.Map.Kits.KitPopulation.FileName))));
+ map.Build();
+ return map;
+ }
+
+ static Material Load(string name) => AssetDatabase.LoadAssetAtPath<Material>($"Assets/Materials/{name}.mat");
+
+ static Transform Tokens(MapScene map) => map.Terrain.transform.Find(UnitLayer.RootName).Find("Tokens");
+
+ /// <summary>Every figure and vehicle piece of the drawn tokens (code-built riflemen, an Arab force's figures, vehicles).</summary>
+ static List<Transform> Pieces(MapScene map, params string[] prefixes) => Tokens(map).Cast<Transform>()
+ .SelectMany(t => t.Cast<Transform>().Where(x => prefixes.Any(x.name.StartsWith))).ToList();
+
+ static GameObject Prefab(string id) => AssetDatabase.LoadAssetAtPath<GameObject>(CollectionCatalog.PrefabPath(id, CollectionDetail.Far));
+
+ /// <summary>The model ids a token draws: its figures', then its vehicles'.</summary>
+ static IEnumerable<string> ModelsOf(UnitToken t) =>
+ Enumerable.Range(0, t.Figures).Select(i => UnitFigures.FigureFor(t.Unit, i, i < t.Headgear.Count ? t.Headgear[i] : null)).Concat(t.Vehicles);
+
+ /// <summary>The box of a piece's Collection model in the piece's own frame (real metres before FigureScale).</summary>
+ static Bounds ModelBox(Transform piece)
+ {
+ var model = piece.Find(UnitFigures.ModelName);
+ Bounds? box = null;
+ foreach (var f in model.GetComponentsInChildren<MeshFilter>(true))
+ {
+ var b = f.sharedMesh.bounds; var m = piece.worldToLocalMatrix * f.transform.localToWorldMatrix;
+ for (int c = 0; c < 8; c++)
+ {
+ var p = m.MultiplyPoint3x4(new Vector3((c & 1) == 0 ? b.min.x : b.max.x, (c & 2) == 0 ? b.min.y : b.max.y, (c & 4) == 0 ? b.min.z : b.max.z));
+ if (box is Bounds bb) { bb.Encapsulate(p); box = bb; } else box = new Bounds(p, Vector3.zero);
+ }
+ }
+ return box!.Value;
+ }
+
+ /// <summary>Steps a coroutine (nested enumerators included) by hand, for at most <paramref name="frames"/> frames.</summary>
+ static void Step(IEnumerator run, int frames)
+ {
+ var stack = new Stack<IEnumerator>(); stack.Push(run); int seen = 0;
+ while (stack.Count > 0 && seen < frames)
+ {
+ var top = stack.Peek();
+ if (!top.MoveNext()) { stack.Pop(); continue; }
+ if (top.Current is IEnumerator nested) stack.Push(nested); else seen++;
+ }
+ }
+
+ /// <summary>The owner: "make sure we are using all of [his] models" (#663). Over every day of the war, with every model
+ /// arrived and the full call-up, the tokens draw exactly the nine, each in the Collection's streamed bundles with its far
+ /// prefab on main.</summary>
+ [Test]
+ public void EveryOneOfTheNineModelsStandsOnATokenSomeDayOfTheWar()
+ {
+ var units = Units;
+ var used = new HashSet<string>();
+ for (var d = C.Rules.Start; d < LastArmistice; d = d.AddDays(1))
+ foreach (var t in UnitRoster.Build(units, C.Rules, d, 5, 0.8, id => true).Where(t => t.Unit.Service == UnitData.Army))
+ foreach (var id in ModelsOf(t)) { Assert.IsNotNull(id, $"{d:yyyy-MM-dd} {t}: every figure has a model"); used.Add(id); }
+ CollectionAssert.AreEquivalent(Nine, used);
+ foreach (var id in Nine)
+ {
+ Assert.IsNotNull(CollectionCatalog.BundleOf(id), $"{id}: streamed");
+ Assert.IsNotNull(Prefab(id), $"{id}: its far prefab is on main");
+ }
+ }
+
+ /// <summary>The mapping table (docs/units.md, "The 1948 Collection on the tokens").</summary>
+ [Test]
+ public void TheTableGivesEachTokenItsFiguresAndVehicles()
+ {
+ var units = Units.ToDictionary(u => u.Id);
+ string[] Trio(string id) => Enumerable.Range(0, 3).Select(i => UnitFigures.FigureFor(units[id], i, (units[id].Headgear ?? UnitData.DefaultHeadgear.ToList())[i])).ToArray();
+ // By headgear, as #507 paired them: bush hat C04, steel helmet C06, stocking cap C07.
+ CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.VeteranFighter },
+ UnitData.Headgears.Select(h => UnitFigures.ByHeadgear[h]).ToArray());
+ // The uniform default's third figure is the pioneer veteran, Harel's the Palmach scout; Negev's headgear is sourced.
+ CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.PioneerVeteran }, Trio("givati"));
+ CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.PalmachScout }, Trio("harel"));
+ CollectionAssert.AreEqual(new[] { UnitFigures.VeteranFighter, UnitFigures.YoungRecruit, UnitFigures.VeteranFighter }, Trio("negev"));
+ CollectionAssert.AreEqual(Enumerable.Repeat(UnitFigures.ArabLegion, 3), Trio("arab_legion"));
+ CollectionAssert.AreEqual(Enumerable.Repeat(UnitFigures.Irregular, 3), Trio("arab_liberation_army"));
+ foreach (var side in UnitData.Sides.Where(s => s != UnitData.Israel && s != "jordan" && s != "ala"))
+ Assert.IsNull(UnitFigures.SideFigure(side), $"{side}: no figure, so its rows stay data only");
+ // The vehicles from their sourced days.
+ CollectionAssert.IsEmpty(UnitFigures.VehiclesAt(units["harel"], new DateTime(1948, 5, 31)));
+ CollectionAssert.AreEqual(new[] { UnitFigures.WillysJeep }, UnitFigures.VehiclesAt(units["harel"], new DateTime(1948, 6, 1)), "the Burma Road jeeps");
+ CollectionAssert.AreEqual(new[] { UnitFigures.WillysJeep, UnitFigures.Napoleonchik }, UnitFigures.VehiclesAt(units["harel"], July12));
+ CollectionAssert.AreEqual(new[] { UnitFigures.WillysJeep }, UnitFigures.VehiclesAt(units["negev"], new DateTime(1948, 6, 2)), "the Negev Beasts' jeeps");
+ foreach (var id in new[] { "carmeli", "givati", "yiftach" })
+ {
+ CollectionAssert.IsEmpty(UnitFigures.VehiclesAt(units[id], new DateTime(1948, 7, 10)), id);
+ CollectionAssert.AreEqual(new[] { UnitFigures.Napoleonchik }, UnitFigures.VehiclesAt(units[id], new DateTime(1948, 7, 11)), $"{id}: the 11 July distribution");
+ }
+ CollectionAssert.IsEmpty(UnitFigures.VehiclesAt(units["golani"], July12), "no source puts either with Golani");
+ // A token's vehicles change the roster on their day, so the tokens are rebuilt with them.
+ var before = UnitRoster.Build(Units, C.Rules, new DateTime(1948, 5, 31), 5, 0.8);
+ var after = UnitRoster.Build(Units, C.Rules, new DateTime(1948, 6, 1), 5, 0.8);
+ Assert.IsFalse(before.SequenceEqual(after), "Harel's jeep arrives on 1 June 1948");
+ }
+
+ /// <summary>Every figure on a token stands with its arms down in its far prefab, the one the tokens draw (C05 shipped in
+ /// his T-pose: his static meshes are now posed at his walk's first frame, tools/slim_collection.py POSE_CLIP).</summary>
+ [Test]
+ public void EveryFigureOnATokenStandsWithItsArmsDown()
+ {
+ foreach (var id in Nine.Where(i => i.StartsWith("figure-c")))
+ {
+ var go = (GameObject)PrefabUtility.InstantiatePrefab(Prefab(id));
+ try
+ {
+ var rs = go.GetComponentsInChildren<Renderer>();
+ var b = rs[0].bounds; foreach (var r in rs) b.Encapsulate(r.bounds);
+ Debug.Log($"UNITS figures {id}: {b.size.x:0.000} x {b.size.z:0.000}, {b.size.y:0.000} tall");
+ Assert.Less(Mathf.Max(b.size.x, b.size.z), 0.55f * b.size.y, $"{id}: arms down, not a T-pose (wider than half his height)");
+ }
+ finally { UnityEngine.Object.DestroyImmediate(go); }
+ }
+ }
+
+ /// <summary>The tokens are built with the code-built figures and ask for their models; nothing changes in the frame of
+ /// the request. When the models arrive every figure shows its model in its own frame, upright, as tall as the code-built
+ /// figure, with the code-built renderer off and the figure where it stood; the vehicles arrive on their bases, side-on
+ /// and lower than a figure. A roster rebuild dresses the new pieces at once, without asking again.</summary>
+ [Test]
+ public void TheFiguresAndVehiclesSwapInWhenTheModelsArrive()
+ {
+ var map = BuildMap();
+ var asked = new List<(string id, CollectionDetail detail, Action<GameObject> done)>();
+ UnitFigures.Source = (id, d, done) => asked.Add((id, d, done));
+ try
+ {
+ var layer = UnitLayer.Create(map, Units, C.Hexes, still: true);
+ layer.Show(C, StateAt(July12, 0.8));
+ var figures = Pieces(map, "Rifleman");
+ var vehicles = Pieces(map, "Vehicle");
+ Assert.Greater(figures.Count, 10, "the riflemen of 12 July 1948 (not a vacuous pass)");
+ CollectionAssert.AreEquivalent(new[] { "carmeli", "givati", "harel", "harel", "yiftach", "negev", "negev" }, vehicles.Select(v => v.parent.name),
+ "the guns of the 11 July distribution and the Harel and Negev jeeps");
+ Assert.IsTrue(asked.All(a => a.detail == CollectionDetail.Far), "the strategic-zoom mesh");
+ CollectionAssert.AreEquivalent(Nine, asked.Select(a => a.id), "each model once: the seven on the tokens, and the two forces' figures asked for ahead");
+ Assert.IsTrue(figures.All(f => !UnitFigures.Dressed(f) && f.GetComponent<MeshRenderer>().enabled), "the code-built figures until the models arrive");
+ Assert.IsTrue(vehicles.All(v => v.childCount == 0 && v.GetComponentsInChildren<Renderer>().Length == 0), "no vehicle is drawn before it arrives");
+ var before = figures.ToDictionary(f => f, f => (f.position, f.rotation));
+ foreach (var (id, _, done) in asked.ToList()) done(Prefab(id));
+ float man = UnitBadge.FigureHeightM;
+ foreach (var f in figures)
+ {
+ Assert.IsTrue(UnitFigures.Dressed(f), $"{f.parent.name}/{f.name} shows its model");
+ Assert.AreEqual(1, f.Cast<Transform>().Count(c => c.name == UnitFigures.ModelName), $"{f.name}: one model");
+ Assert.AreEqual(before[f].position, f.position, $"{f.name}: the figure did not move");
+ Assert.AreEqual(before[f].rotation, f.rotation, $"{f.name}: nor turned");
+ var holder = f.Find(UnitFigures.ModelName);
+ var prefab = Prefab(UnitFigures.FigureFor(Units.Single(u => u.Id == f.parent.name), int.Parse(f.name.Substring(8)),
+ layer.Tokens.Single(t => t.Token.Unit.Id == f.parent.name).Token.Headgear[int.Parse(f.name.Substring(8))]));
+ Assert.AreEqual(prefab.transform.localRotation, holder.GetChild(0).localRotation, $"{f.name}: the prefab keeps its own rotation (the FBX axis turn)");
+ var b = ModelBox(f); float want = f.GetComponent<MeshFilter>().sharedMesh.bounds.size.y;
+ Assert.AreEqual(want, b.size.y, 0.02f * want, $"{f.name}: as tall as the code-built figure");
+ Assert.Less(Mathf.Max(b.size.x, b.size.z), 0.55f * b.size.y, $"{f.name}: standing upright, arms down");
+ Assert.AreEqual(0f, b.min.y, 0.01f, $"{f.name}: feet on the figure's origin");
+ }
+ foreach (var v in vehicles)
+ {
+ Assert.IsTrue(UnitFigures.Dressed(v), $"{v.parent.name}/{v.name} shows its vehicle");
+ var b = ModelBox(v);
+ Assert.AreEqual(UnitFigures.VehicleLengthShare * man, Mathf.Max(b.size.x, b.size.z), 0.01f, $"{v.parent.name}/{v.name}: sized against the figures");
+ Assert.Less(b.size.y, 0.6f * man, $"{v.parent.name}/{v.name}: upright (lower than a man), not on its end");
+ Assert.AreEqual(0f, b.min.y, 0.01f, $"{v.parent.name}/{v.name}: on its wheels");
+ var plinth = v.parent.Find(UnitPlinth.PlinthName).localScale.x;
+ var centre = v.parent.Find(UnitPlinth.PlinthName).position;
+ Assert.Less(new Vector2(v.position.x - centre.x, v.position.z - centre.z).magnitude, 0.75f * plinth, $"{v.parent.name}/{v.name}: on its base");
+ }
+ // A roster change rebuilds the tokens: the new pieces are dressed at once, with no new request.
+ int n = asked.Count;
+ Assert.IsTrue(layer.Show(C, StateAt(July12, 0.3)), "the call-up changes the roster");
+ Assert.Greater(Pieces(map, "Rifleman").Count, 5);
+ Assert.IsTrue(Pieces(map, "Rifleman", "Vehicle").All(UnitFigures.Dressed), "the rebuilt pieces are dressed in the frame of the rebuild");
+ Assert.AreEqual(n, asked.Count, "a model that has arrived is not asked for again");
+ }
+ finally { UnityEngine.Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>The Arab Legion and the Arab Liberation Army are drawn only once their own figure has arrived, three of it on
+ /// a base under the neutral pennant, never an IDF figure, and on ground no Israeli force held on the window's first day
+ /// (#226, ruling 9). A figure that never comes (null: a missing or damaged bundle) draws nothing, and warns nothing more.</summary>
+ [Test]
+ public void TheArabForcesAreDrawnOnlyWithTheirOwnFiguresOnceTheyArrive()
+ {
+ var map = BuildMap();
+ var asked = new Dictionary<string, Action<GameObject>>();
+ UnitFigures.Source = (id, d, done) => asked[id] = done;
+ try
+ {
+ var units = Units;
+ var layer = UnitLayer.Create(map, units, C.Hexes, still: true);
+ layer.Show(C, StateAt(May20, 0.8));
+ Assert.IsTrue(asked.ContainsKey(UnitFigures.ArabLegion) && asked.ContainsKey(UnitFigures.Irregular), "the two forces' figures are asked for");
+ Assert.IsFalse(layer.Tokens.Any(t => t.Token.Unit.Side != UnitData.Israel), "no Arab force before its figure arrives");
+ asked[UnitFigures.Irregular](null); // the ALA's figure never comes
+ Assert.IsFalse(layer.Tokens.Any(t => t.Token.Unit.Side != UnitData.Israel), "a figure that never comes draws nothing");
+ asked[UnitFigures.ArabLegion](Prefab(UnitFigures.ArabLegion));
+ var legion = layer.Tokens.Where(t => t.Token.Unit.Side != UnitData.Israel).ToList();
+ CollectionAssert.AreEqual(new[] { "arab_legion" }, legion.Select(t => t.Token.Unit.Id), "the Legion, drawn when its figure arrives");
+ var go = Tokens(map).Find("arab_legion");
+ Assert.AreEqual(0, go.Cast<Transform>().Count(c => c.name.StartsWith("Rifleman")), "no IDF figure");
+ var figures = go.Cast<Transform>().Where(c => c.name.StartsWith("Figure")).ToList();
+ Assert.AreEqual(3, figures.Count);
+ foreach (var f in figures)
+ {
+ Assert.IsTrue(UnitFigures.Dressed(f), f.name);
+ StringAssert.StartsWith(UnitFigures.ArabLegion, f.Find(UnitFigures.ModelName).GetChild(0).name, $"{f.name}: the Legion's own figure");
+ var b = ModelBox(f);
+ Assert.AreEqual(UnitBadge.FigureHeightM, b.size.y, 0.02f, $"{f.name}: a man's height");
+ Assert.Less(Mathf.Max(b.size.x, b.size.z), 0.55f * b.size.y, $"{f.name}: upright");
+ }
+ var flag = go.Find(UnitPlinth.FlagName);
+ Assert.IsNotNull(flag, "a marker on the pole");
+ Assert.AreEqual(UnitFlags.PennantMeshName, flag.GetComponent<MeshFilter>().sharedMesh.name, "the neutral pennant (Q-ART-1), not a flag");
+ // On the force's own ground (#226, ruling 9): the spot's hex is not Israeli-held on the window's first day.
+ var control = Control1948.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", Control1948.FileName)));
+ foreach (var u in units.Where(u => u.Side != UnitData.Israel && UnitRoster.OnMap(u)))
+ foreach (var a in u.Anchors)
+ {
+ Assert.IsTrue(layer.Spots.TryGetValue(a, out var spot), $"{u.Id} at {a.Place}: placed");
+ var side = control.At(spot.Q, spot.R, UnitData.Day(a.From)).side;
+ TestContext.WriteLine($"{u.Id} at {a.Place}: hex ({spot.Q},{spot.R}) {side} on {a.From}");
+ Assert.AreNotEqual(Control1948.Side.Israel, side, $"{u.Id} at {a.Place}: not on ground Israel held");
+ }
+ LogAssert.NoUnexpectedReceived();
+ }
+ finally { UnityEngine.Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>A model that arrives after its token was rebuilt or destroyed is dropped quietly, and the showcase trio is
+ /// dressed by headgear too (C04, C06, C07).</summary>
+ [Test]
+ public void ALateModelForADestroyedTokenIsDroppedAndTheShowcaseIsDressed()
+ {
+ var map = BuildMap();
+ var asked = new List<(string id, Action<GameObject> done)>();
+ UnitFigures.Source = (id, d, done) => asked.Add((id, done));
+ try
+ {
+ var layer = UnitLayer.Create(map, Units, C.Hexes, still: true);
+ layer.Show(C, StateAt(July12, 0.8));
+ Assert.IsTrue(layer.Show(C, StateAt(July12, 0.3)), "the roster changes before any model arrives");
+ Assert.AreEqual(asked.Select(a => a.id).Distinct().Count(), asked.Count, "each model is asked for once, rebuild or not");
+ foreach (var (id, done) in asked.ToList()) done(Prefab(id)); // the first figures no longer exist
+ LogAssert.NoUnexpectedReceived();
+ Assert.IsTrue(Pieces(map, "Rifleman", "Vehicle").All(UnitFigures.Dressed), "the rebuilt pieces wear the models that arrived");
+ var showcase = UnitShowcase.Spawn(map, still: true).transform;
+ var trio = showcase.Cast<Transform>().Where(t => t.name.StartsWith("Rifleman")).ToList();
+ Assert.AreEqual(3, trio.Count);
+ Assert.IsTrue(trio.All(UnitFigures.Dressed), "the showcase trio wears the models that have arrived");
+ CollectionAssert.AreEqual(new[] { UnitFigures.SabraPioneer, UnitFigures.YoungRecruit, UnitFigures.VeteranFighter },
+ trio.Select(t => UnitFigures.ByHeadgear.Values.Single(id => t.Find(UnitFigures.ModelName).GetChild(0).name.StartsWith(id))));
+ }
+ finally { UnityEngine.Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>Fail open: with the people and vehicles bundles missing, or damaged, the real stream answers null with one
+ /// warning per bundle; every Israeli figure keeps its code-built mesh, drawn, no vehicle is drawn, and no Arab force.</summary>
+ [Test]
+ public void TheCodeBuiltFiguresStayWhenTheBundleIsMissingOrDamaged()
+ {
+ foreach (var damaged in new[] { false, true })
+ {
+ var folder = Path.Combine(Path.GetTempPath(), "statecraft-figures-" + Guid.NewGuid().ToString("N"));
+ Directory.CreateDirectory(folder);
+ var map = BuildMap();
+ try
+ {
+ if (damaged)
+ foreach (var b in new[] { CollectionCatalog.People, CollectionCatalog.Vehicles })
+ File.WriteAllBytes(Path.Combine(folder, b), System.Text.Encoding.ASCII.GetBytes("not-a-bundle"));
+ UnitFigures.Forget();
+ var stream = new CollectionStream(new CollectionStream.BundleSource(folder));
+ UnitFigures.Source = (id, d, done) => stream.Enqueue(id, d, done);
+ var layer = UnitLayer.Create(map, Units, C.Hexes, still: true);
+ layer.Show(C, StateAt(May20, 0.8));
+ layer.Show(C, StateAt(July12, 0.8));
+ foreach (var b in new[] { CollectionCatalog.People, CollectionCatalog.Vehicles })
+ LogAssert.Expect(LogType.Warning, new Regex("^Collection: bundle " + b + " did not load \\(" + (damaged ? "not an AssetBundle" : "no file")));
+ Step(stream.Run(), 80);
+ var figures = Pieces(map, "Rifleman");
+ Assert.Greater(figures.Count, 10, "the riflemen of 12 July 1948 (not a vacuous pass)");
+ foreach (var f in figures)
+ {
+ Assert.IsFalse(UnitFigures.Dressed(f), $"{(damaged ? "damaged" : "missing")}: {f.name} keeps the code-built figure");
+ Assert.IsTrue(f.GetComponent<MeshRenderer>().enabled, $"{f.name}: drawn");
+ }
+ Assert.IsTrue(Pieces(map, "Vehicle").All(v => v.GetComponentsInChildren<Renderer>().Length == 0), "no vehicle is drawn");
+ layer.Show(C, StateAt(May20, 0.8));
+ Assert.IsFalse(layer.Tokens.Any(t => t.Token.Unit.Side != UnitData.Israel), "no Arab force, and no placeholder");
+ LogAssert.NoUnexpectedReceived();
+ }
+ finally { UnityEngine.Object.DestroyImmediate(map.gameObject); Directory.Delete(folder, true); }
+ }
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/UnitFiguresTests.cs.meta b/unity/Assets/Tests/EditMode/UnitFiguresTests.cs.meta
new file mode 100644
index 000000000..df59107df
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/UnitFiguresTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 56476c6273389426e8ae57d9d3933af1
\ No newline at end of file
diff --git a/unity/Assets/Tests/EditMode/UnitPlinthTests.cs b/unity/Assets/Tests/EditMode/UnitPlinthTests.cs
index 3314a2cec..4c429791c 100644
--- a/unity/Assets/Tests/EditMode/UnitPlinthTests.cs
+++ b/unity/Assets/Tests/EditMode/UnitPlinthTests.cs
@@ -120,20 +120,27 @@ public class UnitPlinthTests
// ---- The flag matches the side --------------------------------------------------------------------------------
- /// <summary>Every row of the unit file names its side, and every formation the map draws is Israel's (the Arab forces'
- /// rows are data only until Phase 5 PR 17; owner, 17 October 2026, #740); only Israel has a flag (built from the 1948
- /// specification), so no flag is invented.</summary>
+ /// <summary>Every row of the unit file names its side, and every formation the map draws is Israel's or a force with a
+ /// Collection figure (the other Arab forces' rows are data only; owner, 17 October 2026, #740; issue #665); only Israel
+ /// has a flag (built from the 1948 specification), so no flag is invented: a drawn force with none flies the neutral
+ /// pennant (Q-ART-1, owner, 15 October 2026), in neither side's colours and not white, and no other side flies anything.</summary>
[Test]
public void TheFlagIsTheSidesAndOnlyASourcedFlagIsDrawn()
{
var units = UnitData.Parse(CommittedYaml);
- Assert.IsTrue(units.Where(UnitRoster.OnMap).All(u => u.Side == UnitData.Israel), "every formation the map draws is Israel's");
+ Assert.IsTrue(units.Where(UnitRoster.OnMap).All(u => u.Side == UnitData.Israel || UnitFigures.SideFigure(u.Side) != null),
+ "every formation the map draws is Israel's or has its own figure");
Assert.IsTrue(UnitFlags.Has(UnitData.Israel));
+ Assert.IsFalse(UnitFlags.HasPennant(UnitData.Israel));
foreach (var side in UnitData.Sides.Where(s => s != UnitData.Israel))
{
Assert.IsFalse(UnitFlags.Has(side), $"{side}: no sourced, licensed flag in the repo, so none");
Assert.IsNull(UnitFlags.Build(side), side);
+ Assert.AreEqual(UnitFigures.SideFigure(side) != null, UnitFlags.HasPennant(side), $"{side}: the pennant only on a drawn force");
}
+ var pennant = UnitFlags.BuildPennant();
+ var slots = pennant.uv.Select(u => Enumerable.Range(0, UnitPalette.Count).Single(s => Mathf.Abs(u.x - UnitPalette.U(s)) < 1e-4f)).Distinct();
+ CollectionAssert.AreEquivalent(new[] { UnitPalette.RifleWood, UnitPalette.HullGrey }, slots, "a wooden pole and a plain grey cloth");
// An Arab side's row draws nothing: no IDF figures, no placeholder (owner, 17 October 2026, #740). The file with
// every Israeli row relabelled Egypt's (each given an echelon and a strength, as such a row needs) draws no token.
diff --git a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs
index 71907111a..a60cb08a4 100644
--- a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs
+++ b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs
@@ -218,26 +218,47 @@ public class UnitsInPlayTests
/// <summary>Owner, 17 October 2026 (#740): "Data only. PR 1 adds the sourced Arab rows to units_1948.yaml and filters
/// them off the map in UnitRoster until Phase 5 PR 17's figures land ... Nothing is drawn with IDF figures, and there is
- /// no placeholder art." The 15 May roster keeps exactly the Israeli tokens, no row of another side gives a token on any
- /// day of the war, and the placer gives such a row no spot (so the kits clear no ground for it).</summary>
+ /// no placeholder art." MATKOT's figures have landed for two forces (issue #665; owner, 17 October 2026, #756: MATKOT's
+ /// unit models count as reviewed and approved): the Arab Legion and the Arab Liberation Army. Every other side's rows
+ /// stay data only, on every day of the war, and the placer gives them no spot (so the kits clear no ground for them).
+ /// The two forces are drawn only once their own figure has arrived, with three of it and nothing else: until then the
+ /// 15 May roster is exactly Israel's tokens.</summary>
[Test]
- public void OnlyIsraelsRowsAreDrawnTheArabForcesAreDataOnly()
+ public void OnlyTheForcesWithAFigureAreDrawnAndOnlyOnceItHasArrived()
{
var units = Units;
var others = units.Where(u => u.Side != UnitData.Israel).ToList();
Assert.IsNotEmpty(others.Where(u => u.Hidden == null && u.Anchors.Count > 0), "the file holds Arab rows with anchors (#740)");
+ var drawn = new[] { "arab_legion", "arab_liberation_army" };
+ CollectionAssert.AreEquivalent(drawn, others.Where(UnitRoster.OnMap).Select(u => u.Id), "the forces with a Collection figure");
var israelOnly = units.Where(u => u.Side == UnitData.Israel).ToList();
var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);
- CollectionAssert.AreEqual(Ids(UnitRoster.Build(israelOnly, C, s)), Ids(UnitRoster.Build(units, C, s)), "the 15 May roster is Israel's tokens, exactly");
+ CollectionAssert.AreEqual(Ids(UnitRoster.Build(israelOnly, C, s)), Ids(UnitRoster.Build(units, C, s)), "before any figure arrives: Israel's tokens, exactly");
+ CollectionAssert.AreEqual(Ids(UnitRoster.Build(israelOnly, C, s)), Ids(UnitRoster.Build(units, C, s, id => false)), "nor while none has");
+ var seen = new HashSet<string>();
for (var d = C.Rules.Start; d < LastArmistice; d = d.AddDays(1))
{
- var tokens = UnitRoster.Build(units, C.Rules, d, 5, 0.8);
- Assert.IsTrue(tokens.All(t => t.Unit.Side == UnitData.Israel), $"{d:yyyy-MM-dd}: {string.Join(",", tokens.Where(t => t.Unit.Side != UnitData.Israel))}");
+ var none = UnitRoster.Build(units, C.Rules, d, 5, 0.8);
+ Assert.IsTrue(none.All(t => t.Unit.Side == UnitData.Israel), $"{d:yyyy-MM-dd}: no figure has arrived: {string.Join(",", none.Where(t => t.Unit.Side != UnitData.Israel))}");
+ foreach (var t in UnitRoster.Build(units, C.Rules, d, 5, 0.8, id => true).Where(t => t.Unit.Side != UnitData.Israel))
+ {
+ CollectionAssert.Contains(drawn, t.Unit.Id, $"{d:yyyy-MM-dd}");
+ Assert.AreEqual(UnitFigures.SideFigure(t.Unit.Side), t.ArtType, $"{t}: its own figure");
+ Assert.AreEqual(3, t.Figures, $"{t}: Q-UI-3 at full strength (owner, 17 October 2026, #226)");
+ Assert.IsEmpty(t.Headgear, $"{t}: no IDF rifleman's headgear");
+ Assert.IsEmpty(t.Vehicles, $"{t}: no vehicle");
+ seen.Add(t.Unit.Id);
+ }
+ var legionOnly = UnitRoster.Build(units, C.Rules, d, 5, 0.8, id => id == UnitFigures.ArabLegion);
+ Assert.IsFalse(legionOnly.Any(t => t.Unit.Id == "arab_liberation_army"), $"{d:yyyy-MM-dd}: the ALA waits for its own figure");
}
+ CollectionAssert.AreEquivalent(drawn, seen, "both forces stand on the map on their sourced days");
var hexes = C.Hexes;
var spots = UnitPlacer.PlaceAll(units, hexes, 5000, (lon, lat) => (lon * 1e5, lat * 1e5), (sv, x, z, c, t, ax, az) => true, (x, z) => 0.0);
- Assert.IsFalse(others.SelectMany(u => u.Anchors).Any(spots.ContainsKey), "no spot for a row the map does not draw");
- Assert.IsEmpty(UnitPlacer.SkipMessages(others, spots), "and no warning for it either");
+ var dataOnly = others.Where(u => !drawn.Contains(u.Id)).ToList();
+ Assert.IsFalse(dataOnly.SelectMany(u => u.Anchors).Any(spots.ContainsKey), "no spot for a row the map does not draw");
+ Assert.IsEmpty(UnitPlacer.SkipMessages(dataOnly, spots), "and no warning for it either");
+ Assert.IsTrue(others.Where(u => drawn.Contains(u.Id)).SelectMany(u => u.Anchors).All(spots.ContainsKey), "a spot for each drawn force's anchor");
}
[TestCase(0.80, 3)]
@@ -325,8 +346,10 @@ public class UnitsInPlayTests
}
// GDD Phase 2 PR 1 (the cutover): the golden run is 20 monthly turns with the reference player (was f07b1655).
- const string RosterGolden1950 = "573f30998628a434e6b4156cba5d20f8d974ca28b62f74388f9480de84592baa";
- const string WeeklyGolden = "323cbe046b9666b1d9ab46abeb139540d6e06e394a65ad03e043aa0912cba96e";
+ // Issue #665: each token's line now ends with its sourced vehicles ("+figure-vehicle-..."), the 65 mm gun and the jeep
+ // (was 573f3099... and 323cbe04...; every line is otherwise the same, checked against main's logged rosters).
+ const string RosterGolden1950 = "0612f518c91b436ab5dbe1bf75a52d266a7c617255a4622030d01e51d852a03b";
+ const string WeeklyGolden = "db15a031d3d15961053161ab132363c19566d98e5ad310dc08ce2e79f742a4fc";
// ---- Placement, the layer and the card (a built map) ---------------------------------------------------------