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.

Artillery and armoured cars train at a military camp (R-UNIT-008, fixes #748 part 2) (#1346)

Beri170726037cc0
diff --git a/changelog.d/748-acquire.md b/changelog.d/748-acquire.md
new file mode 100644
index 000000000..8e14c24f5
--- /dev/null
+++ b/changelog.d/748-acquire.md
@@ -0,0 +1,3 @@
+- Artillery and armoured cars can be trained at a military camp: a crew of civilians plus Money and Arms (3 turns, IL
+ 1.0m a group, 3 Arms a group for the guns and 2 for the armoured car, agent defaults for the owner to set or accept).
+ A finished crew becomes one formation of its type, housed in its home city (R-UNIT-008; refs #748).
diff --git a/content/unit_types.yaml b/content/unit_types.yaml
index 2cbd9d266..932cc3cb4 100644
--- a/content/unit_types.yaml
+++ b/content/unit_types.yaml
@@ -48,6 +48,14 @@ types:
range: 2 # DESIGN VALUE: owner-set balance, not a historical figure (D-G5, Q-ARTY-1: hexes to the hex it supports an attack on)
arms_per_fire: 2 # DESIGN VALUE: owner-set balance, not a historical figure (D-G6, Q-ARTY-1: Arms each firing spends)
combat_percent: 200 # DESIGN VALUE: owner-set balance, not a historical figure (D-G5, Q-ARTY-1: percent of its strength in combat)
+ # How it is acquired (R-UNIT-008; Q-ARTY-3, owner, 15 October 2026: "Take all recommendations"): trained at a military
+ # camp, a crew of civilians plus an Arms and Money cost. Proposed on #748 (https://github.com/eyalgolan/statecraft-israel/issues/748#issuecomment-6341182392)
+ # for the owner to set or accept: basic training's 3 turns, twice a recruit group's Money, and Arms a group that rise
+ # with the combat factor (a recruit group takes 1 at 100%).
+ facility: military_camp
+ training_turns: 3 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3, Q-ARTY-3)
+ training_cost: 1.0 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3, Q-ARTY-3: IL millions per group)
+ training_arms: 3 # DESIGN VALUE: owner-set balance, not a historical figure (D-G6, Q-ARTY-3: Arms per group trained)
- id: armoured_car
kind: unit
side: israel
@@ -55,6 +63,11 @@ types:
movement_points: 5 # DESIGN VALUE: owner-set balance, not a historical figure (D-G2, Q-MOVE-1, Q-ARTY-2: points a turn)
# R-COMBAT-008 (Q-ARTY-2): its own combat factor and no other rule. Accepted by the owner on #748, 21 October 2026.
combat_percent: 150 # DESIGN VALUE: owner-set balance, not a historical figure (D-G5, Q-ARTY-2: percent of its strength in combat)
+ # Acquired like the guns (R-UNIT-008, Q-ARTY-3; proposed on #748, see artillery above).
+ facility: military_camp
+ training_turns: 3 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3, Q-ARTY-3)
+ training_cost: 1.0 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3, Q-ARTY-3: IL millions per group)
+ training_arms: 2 # DESIGN VALUE: owner-set balance, not a historical figure (D-G6, Q-ARTY-3: Arms per group trained)
# The Arab forces' types (Phase 5 PR 4, R-UNIT-006; #743, owner, 20 October 2026: "one labelled design-value infantry type
# per Arab side that has a row, 3 movement points"). One type per side whose units_1948.yaml rows start a unit; the
# Lebanese row is hidden, and the local forces have no row yet. The ids are the sim's, not names shown to the player (those
diff --git a/docs/rules/mvp.md b/docs/rules/mvp.md
index 374e2772f..591e5ffde 100644
--- a/docs/rules/mvp.md
+++ b/docs/rules/mvp.md
@@ -102,11 +102,11 @@ R-PROJ-005: A specialised project is allowed only in a city that has its resourc
Training is step 4 of the turn in the approved order (§2.3, D-A6): it runs before production. One military camp and one Hakhshara exist in Tel Aviv at the start, a labelled design assumption (D-D5); pioneers build more at camp sites (R-CAMP-001).
-R-TRAIN-001: `Train(city, track, n)` takes `n` of the city's civilians without a job into a cohort that trains as `track` (a unit type with a `facility`: `recruit` in a military camp, `halutz` in a Hakhshara, `craftsman` at industry, R-CRAFT-001) for the type's `training_turns`, counting the turn it was ordered in. The Treasury pays `n * training_cost` at once. When the Treasury holds less, the shortfall is borrowed, as for map actions: it is added to the debt and the Treasury stops at 0 (owner decision "Allow borrowing", 15 October 2026). The trainees leave the civilians at once; the cohort takes the next id, which units share. It is refused, with the state unchanged and the Attention refunded, when the city or track is unknown, `n` is below 1, the city lacks the facility, or it has fewer civilians without a job. A city has a facility when `cities.yaml` gives it one at the start or a camp site of that kind built for it is in the state (R-CAMP-001). The legacy loop refuses it before charging Attention.
+R-TRAIN-001: `Train(city, track, n)` takes `n` of the city's civilians without a job into a cohort that trains as `track` (a unit type with a `facility`: `recruit`, `artillery` and `armoured_car` in a military camp (R-UNIT-008), `halutz` in a Hakhshara, `craftsman` at industry, R-CRAFT-001) for the type's `training_turns`, counting the turn it was ordered in. The Treasury pays `n * training_cost` at once. When the Treasury holds less, the shortfall is borrowed, as for map actions: it is added to the debt and the Treasury stops at 0 (owner decision "Allow borrowing", 15 October 2026). The trainees leave the civilians at once; the cohort takes the next id, which units share. It is refused, with the state unchanged and the Attention refunded, when the city or track is unknown, `n` is below 1, the city lacks the facility, or it has fewer civilians without a job. A city has a facility when `cities.yaml` gives it one at the start or a camp site of that kind built for it is in the state (R-CAMP-001). The legacy loop refuses it before charging Attention.
R-TRAIN-002: `CancelTraining(cohort)` returns the cohort's people to its city as civilians without a job and refunds none of the Money paid (D-A3); a recruit cohort's Arms go back to the pool (R-ARMS-003). A cohort that does not exist, or has finished, is refused with the state unchanged.
-R-TRAIN-003: Each turn, in ascending id, every cohort has one turn less to go. A cohort that reaches 0 ends: a recruit cohort becomes one military unit with its count as strength (R-UNIT-003), craftsmen join the city's count (R-CRAFT-001), and halutzim become one movable unit per group. Units appear at the city's settlement hex, taking the next ids in turn. New recruit completions never fill `City.Recruits`; its old canonical field is retained, and saves still replay their command log. Cohorts are written into the state hash only when there are some.
+R-TRAIN-003: Each turn, in ascending id, every cohort has one turn less to go. A cohort that reaches 0 ends: a recruit cohort becomes one military unit with its count as strength (R-UNIT-003), and so does a gun or armoured car cohort, of its own type (R-UNIT-008), craftsmen join the city's count (R-CRAFT-001), and halutzim become one movable unit per group. Units appear at the city's settlement hex, taking the next ids in turn. New recruit completions never fill `City.Recruits`; its old canonical field is retained, and saves still replay their command log. Cohorts are written into the state hash only when there are some.
## Craftsmen
@@ -166,6 +166,8 @@ R-UNIT-006: A new Historical game places one military unit per row of `map/units
R-UNIT-007: Open mode starts no forces (Q-START-2, owner, 15 October 2026); `Simulation.NewGame` refuses Open mode until milestone M4.
+R-UNIT-008: Artillery and the armoured car are acquired by training at a military camp (Q-ARTY-3, owner, 15 October 2026, #375: "Take all recommendations"; Phase 5 PR 9, part 2, #748). Each is a `Train` track (R-TRAIN-001 to R-TRAIN-003): `Train(city, artillery, n)` takes n groups of the city's civilians without work as the crew, pays n times the type's `training_cost` in Money and takes n times its `training_arms` in Arms when it starts, refused for a short stock and returned on cancel as R-ARMS-003 says for recruits. A finished cohort becomes one formation of its type at the city's settlement hex, its strength the cohort's count, housed in that city (R-UNIT-003, R-HOUSE-003, Q-HOUSE-5). It is not a recruit, so service never promotes it (R-UNIT-004); it pays the military upkeep (R-UNIT-010). The loader requires `training_arms` (at least 1) on a trained military type other than the recruit, whose Arms stay `mvp.arms_per_recruit_group`, and refuses it on any other type. The values are agent defaults proposed on #748 for the owner to set or accept (https://github.com/eyalgolan/statecraft-israel/issues/748#issuecomment-6341182392): 3 turns, IL 1.0m a group, and 3 Arms a group for the guns, 2 for the armoured car. Event grants of either type stay with Phase 7 (D-H2, R-EFX-003).
+
R-UNIT-009: A row of `map/units_1948.yaml` that meets R-UNIT-006 except that its `strength`'s `as_of` is after the start day arrives on that day (#1241, owner, 21 October 2026, answer 1(a): "enters the game on that date with its sourced strength, read from its row as a dated arrival"): in the GDD loop's resolution (step 9, after the immigrants' arrivals) of the turn that starts before that day and ends on or after it, once, on the hex of the anchor whose window covers that day, with that strength in population units and its side's type, as a starting force. Such rows follow the starting rows in `Content.StartingForces`, and their unit ids are reserved when the game starts, so unit i is still row i and the release gate names them too. An arrival ignores the stack limit and the hex's other units, as a starting force does. A row whose `as_of` is before the start starts nothing; the loader refuses an `as_of` that is not a `YYYY-MM-DD` date, naming the file and the row. Today the 7th Brigade arrives: 1,650 on 24 May 1948 at Hulda, 2 units from the 15 June 1948 turn.
R-UNIT-010: In step 7, after production, Food consumption/imports and civilian upkeep, and before housing, each Israeli military formation pays `military_upkeep_per_turn` Money, including a formation that graduated this turn. The owner-accepted initial rate is IL 0.05m per formation per turn, independent of strength and turn length, a labelled design value under Q-GEN-1 (19 October 2026, https://github.com/eyalgolan/statecraft-israel/pull/1130#issuecomment-6269103829). Civilian, enemy and default records without a military side pay none. R-MONEY-003 borrows a shortfall; no strength is removed or Arms consumed for upkeep (Q-UNIT-3; owner, 15 October 2026). The loader requires a finite rate >= 0. R-ARMS-003 remains the training/refund rule; the Phase 5 plan's suggested reuse of that id is obsolete.
@@ -318,7 +320,7 @@ R-ARMS-001: Arms is a national stock of whole units (`GameState.Arms`, hashed as
R-ARMS-002: `BuyArms(count)` adds `count` units to the stock at once, with no delivery delay, and the Treasury pays `count * arms_price` (IL 1m an Arms), borrowing what it lacks (R-MONEY-003). It is refused, state and Attention unchanged, for fewer than one unit or a stock that would pass a whole number's range; the legacy loop refuses it before charging Attention. Its Attention cost is `attention_cost.buy_arms` (1), whatever the count.
-R-ARMS-003: Recruit training (R-TRAIN-001) takes `arms_per_recruit_group` (1) Arms for each group when it starts, after its other checks and before it pays. A stock short of that refuses the order with a reason naming the need and the stock, state and Attention unchanged (Q-UNIT-3). Pioneer training takes no Arms. The cohort keeps the Arms it took, and the state hash writes them with it; cancelling the cohort (R-TRAIN-002) returns them to the pool, up to the most the stock can hold, although the Money stays paid (owner, 18 October 2026, #1047: "Refund on cancel").
+R-ARMS-003: Recruit training (R-TRAIN-001) takes `arms_per_recruit_group` (1) Arms for each group when it starts, after its other checks and before it pays. A stock short of that refuses the order with a reason naming the need and the stock, state and Attention unchanged (Q-UNIT-3). A gun or armoured car crew takes its type's `training_arms` a group instead, by the same rule (R-UNIT-008). Pioneer training takes no Arms. The cohort keeps the Arms it took, and the state hash writes them with it; cancelling the cohort (R-TRAIN-002) returns them to the pool, up to the most the stock can hold, although the Money stays paid (owner, 18 October 2026, #1047: "Refund on cancel").
## Defeat
diff --git a/sim/Statecraft.Sim.Tests/ArtilleryTests.cs b/sim/Statecraft.Sim.Tests/ArtilleryTests.cs
index 135d7c0c8..3a3c762c1 100644
--- a/sim/Statecraft.Sim.Tests/ArtilleryTests.cs
+++ b/sim/Statecraft.Sim.Tests/ArtilleryTests.cs
@@ -168,4 +168,118 @@ public class ArtilleryTests
Assert.Equal(150, c.UnitTypes.Single(t => t.Id == "armoured_car").CombatPercent);
Assert.Null(c.UnitTypes.Single(t => t.Id == "veteran_soldier").CombatPercent);
}
+
+ // ---- R-UNIT-008 (part 2; Q-ARTY-3, owner, 15 October 2026: "Take all recommendations"): the guns and the armoured cars
+ // are acquired by training at a military camp, a crew of civilians plus an Arms and Money cost. Fixture values: the gun
+ // trains 2 turns for IL 1.5m and 3 Arms a group, the car 2 turns for IL 1.0m and 2 Arms a group; the fixture's stock is 20.
+ const string Trained = Fixture.GddUnitTypes
+ + " - { id: gun, kind: unit, side: israel, class: artillery, movement_points: 2, range: 2, arms_per_fire: 3, facility: military_camp, training_turns: 2, training_cost: 1.5, training_arms: 3 }\n"
+ + " - { id: car, kind: unit, side: israel, class: armour, movement_points: 5, facility: military_camp, training_turns: 2, training_cost: 1.0, training_arms: 2 }\n";
+
+ // R-UNIT-008, R-TRAIN-001, R-ARMS-003: Train(city, gun, n) takes n civilians without work as the crew, pays n times the
+ // type's Money and takes n times its training_arms when it starts; the cohort keeps the Arms it took.
+ [Theory]
+ [InlineData("gun", 3, 1.5, "artillery training")]
+ [InlineData("car", 2, 1.0, "armoured car training")]
+ public void AMilitaryCampTrainsACrewForArmsAndMoney(string track, int arms, double cost, string course)
+ {
+ var c = Load(Trained);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ var r = Step(c, s, new Train("town_a", track, 2));
+ Assert.Empty(r.Rejected);
+ var k = Assert.Single(r.State.Cohorts.Values);
+ Assert.Equal((track, "town_a", 2, 2, 2 * arms), (k.Type, k.City, k.Count, k.TurnsLeft + 1, k.Arms));
+ Assert.Equal(s.Arms - 2 * arms, r.State.Arms);
+ Assert.Equal(s.Cities["town_a"].Civilians - 2, r.State.Cities["town_a"].Civilians);
+ Assert.Contains(r.Why, w => w.Target == "town_a" && w.Message.StartsWith("Town A: 2 groups began " + course + ", cost ", StringComparison.Ordinal));
+ Assert.Contains(r.Why, w => w.Target == "arms" && w.Delta == -2 * arms && w.Message == $"Town A: {course} took {2 * arms} Arms");
+ var paid = Assert.Single(r.Why, w => w.Message.StartsWith("Town A: 2 groups began", StringComparison.Ordinal));
+ Assert.Contains(PlayerText.Money(c, "treasury", 2 * cost), paid.Message);
+ }
+
+ // R-UNIT-008, R-UNIT-003, R-HOUSE-003 (Q-HOUSE-5): a finished crew is one formation of its own type at its city's
+ // settlement hex, strength = its groups, housed in that city. It is not a recruit, so service never promotes it (R-UNIT-004).
+ [Theory]
+ [InlineData("gun", "artillery")]
+ [InlineData("car", "armoured cars")]
+ public void AFinishedCrewIsOneFormationOfItsType(string track, string noun)
+ {
+ var c = Load(Trained);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ var id = s.NextId++;
+ s.Cohorts.Add(id, new Cohort(id, track, "town_a", 2, 1, 4));
+ var next = s.NextId;
+ var arms = s.Arms;
+ var housed = Cities.Housed(s, s.Cities["town_a"]);
+ var why = new List<Cause>();
+ Training.Progress(c, s, why);
+ Assert.Empty(s.Cohorts);
+ var u = s.Units[next];
+ var hex = c.SettlementHexes.Single(h => h.Id == "town_a");
+ Assert.Equal((track, "israel", 2, hex.Q, hex.R, "town_a"), (u.Type, u.Side, u.Strength, u.Q, u.R, u.HomeCity));
+ Assert.Equal(next + 1, s.NextId);
+ Assert.Equal(arms, s.Arms);
+ Assert.Equal(housed, Cities.Housed(s, s.Cities["town_a"]));
+ Assert.Contains(why, w => w.Message.EndsWith("training and are " + noun, StringComparison.Ordinal));
+ for (int i = 0; i < 10; i++) Military.Serve(s, c.RulesAt(s.Date).Mvp!, why);
+ Assert.Equal(track, s.Units[next].Type);
+ }
+
+ // R-UNIT-008, R-ARMS-003: a stock short of the crew's Arms refuses the order, state and Attention as if never given;
+ // cancelling the cohort (R-TRAIN-002) returns the Arms it took.
+ [Fact]
+ public void TooFewArmsRefusesACrewAndCancellingReturnsThem()
+ {
+ var c = Load(Trained);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ s.Arms = 5;
+ var r = Step(c, s, new Train("town_a", "gun", 2));
+ Assert.Equal("Town A: not enough Arms for artillery training (need 6, have 5)", Assert.Single(r.Rejected).Reason);
+ Assert.Equal(Step(c, s).State.Hash(), r.State.Hash());
+ s.Arms = 6;
+ var trained = Step(c, s, new Train("town_a", "gun", 2)).State;
+ Assert.Equal(0, trained.Arms);
+ var back = Step(c, trained, new CancelTraining(trained.Cohorts.Keys.Single()));
+ Assert.Empty(back.Rejected);
+ Assert.Equal(6, back.State.Arms);
+ Assert.Contains(back.Why, w => w.Target == "arms" && w.Delta == 6 && w.Message == "Town A: artillery training returned 6 Arms");
+ }
+
+ // R-UNIT-008: a trained military type other than the recruit carries its own Arms a group, at least 1; the recruit's is
+ // rules.yaml mvp.arms_per_recruit_group (R-ARMS-003), and a type nobody trains has none.
+ [Theory]
+ [InlineData(" - { id: g, kind: unit, side: israel, class: armour, movement_points: 2, facility: military_camp, training_turns: 2, training_cost: 1.0 }\n", "types[g].training_arms", "required for a trained military type, at least 1")]
+ [InlineData(" - { id: g, kind: unit, side: israel, class: armour, movement_points: 2, facility: military_camp, training_turns: 2, training_cost: 1.0, training_arms: 0 }\n", "types[g].training_arms", "required for a trained military type, at least 1")]
+ [InlineData(" - { id: g, kind: unit, side: israel, class: armour, movement_points: 2, training_arms: 2 }\n", "types[g].training_arms", "only a type with a facility trains")]
+ [InlineData(" - { id: g, kind: unit, facility: hakhshara, training_turns: 2, training_cost: 1.0, training_arms: 2 }\n", "types[g].training_arms", "only a trained military type other than the recruit")]
+ public void TheTrainingArmsAreValidated(string row, string field, string message)
+ {
+ var ex = Assert.Throws<ContentException>(() => Load(Fixture.GddUnitTypes + row));
+ Assert.Equal("unit_types.yaml", ex.File);
+ Assert.Equal(field, ex.Field);
+ Assert.Contains(message, ex.Message);
+ }
+
+ // R-UNIT-008: the recruit's Arms stay in rules.yaml, so a training_arms on it is refused rather than read by nothing.
+ [Fact]
+ public void ARecruitTakesNoTrainingArms()
+ {
+ var types = Fixture.GddUnitTypes.Replace("training_cost: 0.5, movement_points: 3 }", "training_cost: 0.5, movement_points: 3, training_arms: 1 }");
+ Assert.NotEqual(Fixture.GddUnitTypes, types);
+ var ex = Assert.Throws<ContentException>(() => Load(types));
+ Assert.Equal("types[recruit].training_arms", ex.Field);
+ Assert.Contains("only a trained military type other than the recruit", ex.Message);
+ }
+
+ // R-UNIT-008: the real types train at a military camp with the values proposed on #748 (22 October 2026, for the owner
+ // to set or accept): 3 turns and IL 1.0m a group for both, 3 Arms a group for the guns and 2 for the armoured car.
+ [Fact]
+ public void TheRealTypesTrainAtAMilitaryCamp()
+ {
+ var c = ContentLoader.Load(RealContentTests.ContentRoot());
+ var gun = c.UnitTypes.Single(t => t.Id == "artillery");
+ var car = c.UnitTypes.Single(t => t.Id == "armoured_car");
+ Assert.Equal(("military_camp", 3, 1.0, (int?)3), (gun.Facility, gun.TrainingTurns, gun.TrainingCost, gun.TrainingArms));
+ Assert.Equal(("military_camp", 3, 1.0, (int?)2), (car.Facility, car.TrainingTurns, car.TrainingCost, car.TrainingArms));
+ }
}
diff --git a/sim/Statecraft.Sim.Tests/CitiesContentTests.cs b/sim/Statecraft.Sim.Tests/CitiesContentTests.cs
index 42867f381..3852e9ac8 100644
--- a/sim/Statecraft.Sim.Tests/CitiesContentTests.cs
+++ b/sim/Statecraft.Sim.Tests/CitiesContentTests.cs
@@ -46,7 +46,7 @@ public class CitiesContentTests
Assert.True(c.Rules.AttentionCost.ContainsKey("assign_workers"));
Assert.Equal(new[] { "tel_aviv" }, c.Cities.Where(x => x.Facilities.Count > 0).Select(x => x.Id));
Assert.Equal(new[] { "military_camp", "hakhshara" }, c.Cities.Single(x => x.Id == "tel_aviv").Facilities); // D-D5: one of each at the start
- Assert.Equal(new[] { ("recruit", "military_camp"), ("halutz", "hakhshara"), ("craftsman", "industry") },
+ Assert.Equal(new[] { ("recruit", "military_camp"), ("halutz", "hakhshara"), ("craftsman", "industry"), ("artillery", "military_camp"), ("armoured_car", "military_camp") }, // R-UNIT-008: the guns and the car (Q-ARTY-3)
c.UnitTypes.Where(t => t.Facility != "").Select(t => (t.Id, t.Facility)));
Assert.True(c.Rules.AttentionCost.ContainsKey("train") && c.Rules.AttentionCost.ContainsKey("cancel_training"));
}
diff --git a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
index 37b77d1ea..4a7d2e63d 100644
--- a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
+++ b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
@@ -166,6 +166,13 @@ public class DesignValuesTests
("unit_types.yaml", "types[artillery].arms_per_fire"),
("unit_types.yaml", "types[artillery].combat_percent"),
("unit_types.yaml", "types[armoured_car].combat_percent"),
+ // How either is acquired (part 2, R-UNIT-008; Q-ARTY-3): proposed on #748, 22 October 2026, for the owner to set or accept.
+ ("unit_types.yaml", "types[artillery].training_turns"),
+ ("unit_types.yaml", "types[artillery].training_cost"),
+ ("unit_types.yaml", "types[artillery].training_arms"),
+ ("unit_types.yaml", "types[armoured_car].training_turns"),
+ ("unit_types.yaml", "types[armoured_car].training_cost"),
+ ("unit_types.yaml", "types[armoured_car].training_arms"),
("unit_types.yaml", "types[egyptian_army].movement_points"), // #743, owner, 20 October 2026
("unit_types.yaml", "types[arab_legion].movement_points"), // #743, owner, 20 October 2026
("unit_types.yaml", "types[syrian_army].movement_points"), // #743, owner, 20 October 2026
@@ -291,7 +298,7 @@ public class DesignValuesTests
Assert.Equal(12, c.Cities.Count);
foreach (var x in c.Cities) // the listed housing and job values are the ones Cities.Init starts from
Assert.Equal(((int)x.Housing!.Value, (int)x.Jobs!.Value), (x.HousingCapacity, x.JobSlots));
- Assert.Equal(new[] { ("recruit", 3, 0.5), ("halutz", 4, 0.5), ("craftsman", 3, 0.5) }, // the craftsman: Q-CRAFT-3
+ Assert.Equal(new[] { ("recruit", 3, 0.5), ("halutz", 4, 0.5), ("craftsman", 3, 0.5), ("artillery", 3, 1.0), ("armoured_car", 3, 1.0) }, // the craftsman: Q-CRAFT-3; the guns and the car: Q-ARTY-3 (#748)
c.UnitTypes.Where(t => t.Facility != "").Select(t => (t.Id, t.TrainingTurns, t.TrainingCost)));
}
diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.cs
index 42563fdef..17e88ee34 100644
--- a/sim/Statecraft.Sim/Content.cs
+++ b/sim/Statecraft.Sim/Content.cs
@@ -839,6 +839,9 @@ namespace Statecraft.Sim
/// <summary>The Arms a unit of an artillery type spends each time it fires (R-COMBAT-007; Q-ARTY-1). Required on an
/// artillery type, null on any other.</summary>
public int? ArmsPerFire { get; set; }
+ /// <summary>The Arms a group of a trained military type other than the recruit takes when its training starts
+ /// (R-UNIT-008; Q-ARTY-3). The recruit's is rules.yaml mvp.arms_per_recruit_group (R-ARMS-003); null on every other type.</summary>
+ public int? TrainingArms { get; set; }
}
/// <summary>One stretch of a budget line's ownership (rules.yaml budget_owners): from this day (inclusive) the office owns the line.</summary>
diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.cs
index 977056199..587a041a8 100644
--- a/sim/Statecraft.Sim/ContentLoader.cs
+++ b/sim/Statecraft.Sim/ContentLoader.cs
@@ -1121,6 +1121,7 @@ namespace Statecraft.Sim
// Training (R-TRAIN-001) needs a place to train; values without one would be read by nothing.
if (x.TrainingTurns != 0) throw new ContentException(uf, at + ".training_turns", "only a type with a facility trains");
if (x.TrainingCost != 0) throw new ContentException(uf, at + ".training_cost", "only a type with a facility trains");
+ if (x.TrainingArms != null) throw new ContentException(uf, at + ".training_arms", "only a type with a facility trains");
continue;
}
if (!TrainingFacilities.Contains(x.Facility)) throw new ContentException(uf, at + ".facility", $"unknown facility '{x.Facility}' (military_camp, hakhshara or industry)");
@@ -1131,6 +1132,13 @@ namespace Statecraft.Sim
// Q-CRAFT-1 (owner, 15 October 2026): a craftsman trains in a city with a completed industry project.
if (x.Id == Training.Craftsman && x.Facility != Training.Industry)
throw new ContentException(uf, at + ".facility", "a craftsman trains at industry (Q-CRAFT-1)");
+ // R-UNIT-008 (Q-ARTY-3): a trained military type pays Arms a group; the recruit's is rules.yaml's
+ // arms_per_recruit_group (R-ARMS-003), so a second value on it would be read by nothing.
+ if (x.Side != "" && x.Id != "recruit")
+ {
+ if (!(x.TrainingArms >= 1)) throw new ContentException(uf, at + ".training_arms", "required for a trained military type, at least 1");
+ }
+ else if (x.TrainingArms != null) throw new ContentException(uf, at + ".training_arms", "only a trained military type other than the recruit takes its own Arms");
if (x.TrainingTurns < 1) throw new ContentException(uf, at + ".training_turns", "must be >= 1");
if (!(x.TrainingCost >= 0 && IsFinite(x.TrainingCost))) throw new ContentException(uf, at + ".training_cost", "must be a finite number >= 0");
}
diff --git a/sim/Statecraft.Sim/Training.cs b/sim/Statecraft.Sim/Training.cs
index f57fec1e8..c64a32751 100644
--- a/sim/Statecraft.Sim/Training.cs
+++ b/sim/Statecraft.Sim/Training.cs
@@ -25,8 +25,17 @@ namespace Statecraft.Sim
/// <summary>The facility's name in text the player reads.</summary>
static string Place(string facility) => facility == "military_camp" ? "military camp" : facility == Industry ? "completed industry project" : "Hakhshara";
- /// <summary>The course the facility gives, in text the player reads.</summary>
- static string Course(string facility) => facility == "military_camp" ? "basic training" : facility == Industry ? "craft training" : "pioneer training";
+ /// <summary>The course a type trains in, in text the player reads: the facility's, or the guns' or the armoured cars' own
+ /// at a military camp (R-UNIT-008).</summary>
+ static string Course(UnitType t) =>
+ t.Class == Combat.ArtilleryClass ? "artillery training" : t.Class == Armour ? "armoured car training"
+ : t.Facility == "military_camp" ? "basic training" : t.Facility == Industry ? "craft training" : "pioneer training";
+
+ /// <summary>The armoured car's class (R-UNIT-001).</summary>
+ const string Armour = "armour";
+
+ /// <summary>What a finished military cohort is, in text the player reads (R-UNIT-003, R-UNIT-008).</summary>
+ static string Trained(UnitType t) => t.Class == Combat.ArtilleryClass ? "artillery" : t.Class == Armour ? "armoured cars" : "recruits";
static string Groups(int n) => n == 1 ? "1 group" : FormattableString.Invariant($"{n} groups");
@@ -74,10 +83,11 @@ namespace Statecraft.Sim
if (!HasFacility(c, s, city, type.Facility)) return $"{name} has no {Place(type.Facility)}";
var idle = Idle(x);
if (count > idle) return FormattableString.Invariant($"{name} has {idle} civilians without work");
- // R-ARMS-003 (D-G6, Q-UNIT-3): a recruit group takes arms_per_recruit_group Arms when its training starts; a short
- // stock refuses the order. Pioneer training takes none. The cohort keeps the count, and cancelling (R-TRAIN-002) returns it.
- var arms = type.Id == "recruit" ? (long)count * c.RulesAt(s.Date).Mvp!.ArmsPerRecruitGroup!.Value : 0;
- if (arms > s.Arms) return FormattableString.Invariant($"{name}: not enough Arms for {Course(type.Facility)} (need {arms}, have {s.Arms})");
+ // R-ARMS-003 (D-G6, Q-UNIT-3): a recruit group takes arms_per_recruit_group Arms when its training starts, a gun or
+ // armoured car crew its type's training_arms (R-UNIT-008, Q-ARTY-3); a short stock refuses the order. Pioneer
+ // training takes none. The cohort keeps the count, and cancelling (R-TRAIN-002) returns it.
+ var arms = type.Id == "recruit" ? (long)count * c.RulesAt(s.Date).Mvp!.ArmsPerRecruitGroup!.Value : (long)count * (type.TrainingArms ?? 0);
+ if (arms > s.Arms) return FormattableString.Invariant($"{name}: not enough Arms for {Course(type)} (need {arms}, have {s.Arms})");
var cost = count * type.TrainingCost;
// Owner decision "Allow borrowing" (2026-10-15, #468 question 1): a short Treasury borrows, as map actions do.
EconomySystem.PayOrBorrow(c, s, cost, "for training", why);
@@ -89,11 +99,11 @@ namespace Statecraft.Sim
// with training_turns 3 an order on turn T is done at the end of T+2 (TrainingTests.ACohortOrderedOnTurnTWithThreeTurnsFinishesAtTheEndOfTurnTPlusTwo). For "done at the end of
// T+3", open the cohort with type.TrainingTurns + 1 here; nothing else changes.
s.Cohorts.Add(id, new Cohort(id, type.Id, city, count, type.TrainingTurns, (int)arms));
- why.Add(new Cause("city", city, -count, $"{name}: {Groups(count)} began {Course(type.Facility)}, cost {PlayerText.Money(c, "treasury", cost)}"));
+ why.Add(new Cause("city", city, -count, $"{name}: {Groups(count)} began {Course(type)}, cost {PlayerText.Money(c, "treasury", cost)}"));
if (arms > 0)
{
s.Arms -= (int)arms;
- why.Add(new Cause("city", "arms", -arms, FormattableString.Invariant($"{name}: {Course(type.Facility)} took {arms} Arms")));
+ why.Add(new Cause("city", "arms", -arms, FormattableString.Invariant($"{name}: {Course(type)} took {arms} Arms")));
}
return null;
}
@@ -110,19 +120,19 @@ namespace Statecraft.Sim
s.Cohorts.Remove(cohort);
var type = c.UnitTypes.First(t => t.Id == k.Type);
why.Add(new Cause("city", k.City, k.Count,
- $"{PlayerText.Settlement(c, k.City)}: {Groups(k.Count)} left {Course(type.Facility)}; the Money spent is not returned"));
+ $"{PlayerText.Settlement(c, k.City)}: {Groups(k.Count)} left {Course(type)}; the Money spent is not returned"));
if (k.Arms > 0)
{
var back = (int)Math.Min(k.Arms, (long)int.MaxValue - s.Arms); // the stock stops at int.MaxValue, as an event or a purchase leaves it
s.Arms += back;
- why.Add(new Cause("city", "arms", back, FormattableString.Invariant($"{PlayerText.Settlement(c, k.City)}: {Course(type.Facility)} returned {back} Arms")));
+ why.Add(new Cause("city", "arms", back, FormattableString.Invariant($"{PlayerText.Settlement(c, k.City)}: {Course(type)} returned {back} Arms")));
}
return null;
}
/// <summary>R-TRAIN-003, step 4 of the turn (spec 2026-10-12 section 2.3, D-A6): in ascending id, each cohort has one turn
- /// less to go. One that reaches 0 leaves the state: a recruit cohort becomes one military formation with its count
- /// as strength (R-UNIT-003), craftsmen join the city's count, and halutzim become one unit per group at its hex.</summary>
+ /// less to go. One that reaches 0 leaves the state: a recruit, gun or armoured car cohort becomes one military formation
+ /// of its type with its count as strength (R-UNIT-003, R-UNIT-008), craftsmen join the city's count, and halutzim become one unit per group at its hex.</summary>
public static void Progress(Content c, GameState s, List<Cause> why)
{
foreach (var k in s.Cohorts.Values.ToList())
@@ -131,24 +141,24 @@ namespace Statecraft.Sim
s.Cohorts.Remove(k.Id);
var type = c.UnitTypes.First(t => t.Id == k.Type);
var name = PlayerText.Settlement(c, k.City);
- if (type.Id == "recruit")
+ if (type.Side != "")
{
var hex = c.SettlementHexes.First(h => h.Id == k.City);
var id = s.NextId++;
s.Units.Add(id, new Unit(id, type.Id, hex.Q, hex.R, side: type.Side, strength: k.Count, homeCity: k.City));
- why.Add(new Cause("city", k.City, k.Count, $"{name}: {Groups(k.Count)} finished {Course(type.Facility)} and are recruits"));
+ why.Add(new Cause("city", k.City, k.Count, $"{name}: {Groups(k.Count)} finished {Course(type)} and are {Trained(type)}"));
}
else if (type.Kind == "unit")
{
var hex = c.SettlementHexes.First(h => h.Id == k.City); // every settlement has one (ValidateMap)
for (int i = 0; i < k.Count; i++) { var id = s.NextId++; s.Units.Add(id, new Unit(id, type.Id, hex.Q, hex.R)); }
- why.Add(new Cause("city", k.City, k.Count, $"{name}: {Groups(k.Count)} finished {Course(type.Facility)} and are halutzim"));
+ why.Add(new Cause("city", k.City, k.Count, $"{name}: {Groups(k.Count)} finished {Course(type)} and are halutzim"));
}
else if (type.Id == Craftsman)
{
var x = s.Cities[k.City];
s.Cities[k.City] = x.WithCraftsmen(x.Craftsmen + k.Count);
- why.Add(new Cause("city", k.City, k.Count, $"{name}: {Groups(k.Count)} finished {Course(type.Facility)} and are craftsmen"));
+ why.Add(new Cause("city", k.City, k.Count, $"{name}: {Groups(k.Count)} finished {Course(type)} and are craftsmen"));
}
}
}
diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yaml
index 1c42f2486..6138b6672 100644
--- a/unity/Assets/UI/strings.en.yaml
+++ b/unity/Assets/UI/strings.en.yaml
@@ -488,10 +488,14 @@ city.recruits: "Recruits: {0}"
city.workers: "In work: {0}"
city.train_recruit: "Train recruits: 1 group, {0}, {1}"
city.train_halutz: "Train halutzim: 1 group, {0}, {1}"
+city.train_artillery: "Train artillery: 1 group, {0}, {1}"
+city.train_armoured_car: "Train armoured cars: 1 group, {0}, {1}"
city.train_craftsman: "Train craftsmen: 1 group, {0}, {1}"
city.train_ordered: "{0} ordered"
city.track_recruit: "Recruits"
city.track_halutz: "Halutzim"
+city.track_artillery: "Artillery"
+city.track_armoured_car: "Armoured cars"
city.track_craftsman: "Craftsmen"
city.cohort: "{0}: {1} in training, {2} left"
city.cancel: "Cancel"
diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yaml
index 425054982..09e0f21c3 100644
--- a/unity/Assets/UI/strings.he.yaml
+++ b/unity/Assets/UI/strings.he.yaml
@@ -523,11 +523,16 @@ city.recruits: "מגויסים: {0}"
city.workers: "בעבודה: {0}"
city.train_recruit: "אימון מגויסים: קבוצה אחת, {0}, {1}"
city.train_halutz: "הכשרת חלוצים: קבוצה אחת, {0}, {1}"
+# Approved by Beri, a native speaker, on #1346 (22 Oct 2026): city.train_artillery, city.track_artillery, city.train_armoured_car, city.track_armoured_car.
+city.train_artillery: "אימון ארטילריה: קבוצה אחת, {0}, {1}"
+city.train_armoured_car: "אימון שריוניות: קבוצה אחת, {0}, {1}"
# Craft training (R-CRAFT-001, #1357), with city.craftsmen's approved בעל מלאכה in the plural. For the native reviewer (#564).
city.train_craftsman: "הכשרת בעלי מלאכה: קבוצה אחת, {0}, {1}"
city.train_ordered: "הוזמנו {0}"
city.track_recruit: "מגויסים"
city.track_halutz: "חלוצים"
+city.track_artillery: "ארטילריה"
+city.track_armoured_car: "שריוניות"
# For the native reviewer (#564).
city.track_craftsman: "בעלי מלאכה"
city.cohort: "{0}: {1} באימון, עוד {2}"