Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

test(scenarios): infantry crowd on a road, a bridge and against vehicles

Olcay Seygana0c9a9f3f919
diff --git a/GeneralsMD/Code/Data/Scenarios/infconvoy.txt b/GeneralsMD/Code/Data/Scenarios/infconvoy.txt
new file mode 100644
index 000000000..65c5b6233
--- /dev/null
+++ b/GeneralsMD/Code/Data/Scenarios/infconvoy.txt
@@ -0,0 +1,40 @@
+# Infantry column meets vehicles on a road: thirty-six infantry walk the Alpine Assault street from
+# 760,920 to 1400,1400 while twelve vehicles drive it the other way, one right click for the soldiers and one each
+# for the tanks and the Humvees.
+#
+# A vehicle lets a moving allied soldier heading within 60 degrees of it through, but one coming
+# head-on is told to step aside (AIUpdate::processCollision, aiMoveAwayFromUnit), loses its path and
+# stands about a second before it asks again (PATHFINDING-ANALYSIS.md, step-aside yield). This
+# puts thirty-six soldiers in front of twelve vehicles on the one street where that can happen.
+#
+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit
+# -map "Maps\Alpine Assault\Alpine Assault.map" -autoskirmish 2 -takeover
+# -side 0 FactionAmerica -side 1 FactionGLA -seed 1 -maxframes 3000
+# -scenario infconvoy -logPrefix infconvoy_
+#
+# 2026-10-04, main at 8c7195a1, seeds 1 / 2 / 3. Stops of a second, then last arrival in frames:
+#
+# Rangers 7 / 11 / 10 (4 / 4 / 5 held back, 3 / 5 / 5 blocked) 1480 / 1426 / 1662
+# Missile Defenders 4 / 3 / 0 1101 / 1242 / 1171
+# Crusaders 10 / 11 / 9 (8 / 8 / 5 blocked) 1418 / 1256 / 1520
+# Humvees 3 / 5 / 2 1096 / 1157 / 997
+#
+# The same file with the vehicle lines taken out: no stops, Rangers last 1018 (mean 936), Missile
+# Defenders 918, every seed. With the infantry lines taken out: no Crusader stops, last 1310 to
+# 1374. So the vehicles cost the Rangers 400 to 650 frames on the last man and about 300 on the
+# mean, while the soldiers cost the tanks little; eight tanks already queue in this street alone
+# (one Crusader by itself takes 724). -tracemove 238 on seed 1: Ranger 238 stands at 1081,1125
+# from frame 629 to 764 with Crusader 264 twenty units ahead, its allowed speed 0 on every frame;
+# the Crusader is itself stopped behind Crusader 263.
+
+30 spawn 0 AmericaInfantryRanger 24 760 920 18
+30 spawn 0 AmericaInfantryMissileDefender 12 760 1000 18
+30 spawn 0 AmericaTankCrusader 8 1400 1400 40
+30 spawn 0 AmericaVehicleHumvee 4 1480 1400 40
+60 playermove 0 AmericaInfantry* 1400 1400
+60 playermove 0 AmericaVehicleHumvee 760 920
+60 playermove 0 AmericaTank* 760 920
+60 arrive 0 AmericaInfantryRanger 1400 1400 200
+60 arrive 0 AmericaInfantryMissileDefender 1400 1400 200
+60 arrive 0 AmericaTankCrusader 760 920 200
+60 arrive 0 AmericaVehicleHumvee 760 920 200
diff --git a/GeneralsMD/Code/Data/Scenarios/infheadon.txt b/GeneralsMD/Code/Data/Scenarios/infheadon.txt
new file mode 100644
index 000000000..1b9ccb39a
--- /dev/null
+++ b/GeneralsMD/Code/Data/Scenarios/infheadon.txt
@@ -0,0 +1,27 @@
+# Infantry head-on over a bridge: two foot groups of one player crossing the Kandahar bridge on
+# Golden Oasis (1826,1410 to 1688,1585, see bridgecross.txt) from opposite banks at once.
+#
+# Twenty-four Rangers and twelve Missile Defenders go south-west, thirty-six Red Guard go north-east,
+# two right clicks on the same frame. Infantry passes through infantry
+# (AIPathfind.h INFANTRY_MOVES_THROUGH_INFANTRY), so the question is whether the deck still jams
+# when the two streams meet on it.
+#
+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit
+# -map "Maps\Golden Oasis\Golden Oasis.map" -autoskirmish 2 -takeover
+# -side 0 FactionAmerica -side 1 FactionGLA -seed 1 -maxframes 3000
+# -scenario infheadon -logPrefix infheadon_
+#
+# 2026-10-04, main at 8c7195a1, seeds 1-3 (identical): no stop of a second in any class. Last
+# arrival after the order: Rangers 1212 frames, Missile Defenders 1231, Red Guard 979. One of each
+# alone takes 1096, 1171 and 874, so the whole crossing, block depth included, costs 60 to 116
+# frames on the last man. No run sent one side over alone, so how much of that is the meeting is
+# not separated.
+
+30 spawn 0 AmericaInfantryRanger 24 2043 1136 18
+30 spawn 0 AmericaInfantryMissileDefender 12 2123 1136 18
+30 spawn 0 ChinaInfantryRedguard 36 1471 1859 18
+60 playermove 0 AmericaInfantry* 1471 1859
+60 playermove 0 ChinaInfantryRedguard 2043 1136
+60 arrive 0 AmericaInfantryRanger 1471 1859 200
+60 arrive 0 AmericaInfantryMissileDefender 1471 1859 200
+60 arrive 0 ChinaInfantryRedguard 2043 1136 200
diff --git a/GeneralsMD/Code/Data/Scenarios/infroad.txt b/GeneralsMD/Code/Data/Scenarios/infroad.txt
new file mode 100644
index 000000000..5fe1820cb
--- /dev/null
+++ b/GeneralsMD/Code/Data/Scenarios/infroad.txt
@@ -0,0 +1,30 @@
+# Infantry on a road: does a player-sized foot army clog a town street?
+#
+# Forty-eight mixed infantry, one right click, down the Alpine Assault street from 760,920 to
+# 1400,1400: the line mobattack.txt and towncross.txt march, houses either side and a crossroads at
+# 1310,1290 that turns any crowd into a column. Four templates so each arrive line is one class.
+# The player's complaint (PLAYER-FEEDBACK-2026-09-20.md, "Units clogging and shoving in a crowd")
+# is infantry blocking the road; HEADLESS STALL counts every stop of a second on the way.
+#
+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit
+# -map "Maps\Alpine Assault\Alpine Assault.map" -autoskirmish 2 -takeover
+# -side 0 FactionAmerica -side 1 FactionGLA -seed 1 -maxframes 3000
+# -scenario infroad -logPrefix infroad_
+#
+# 2026-10-04, main at 8c7195a1, seeds 1-3 (identical: nothing in this match draws on the seed):
+# no stop of a second in any class. Last arrival, frames after the order: Rangers 990, Missile
+# Defenders 878, Red Guard 746, Rebels 817. One soldier of each sent alone down the same street
+# takes 993, 903, 759 and 849, so forty-eight on foot walk this road at free-flow speed. Infantry
+# alone does not clog it; infconvoy.txt is where the stops come from.
+
+30 spawn 0 AmericaInfantryRanger 16 760 920 18
+30 spawn 0 AmericaInfantryMissileDefender 12 840 920 18
+30 spawn 0 ChinaInfantryRedguard 12 760 1000 18
+30 spawn 0 GLAInfantryRebel 8 840 1000 18
+60 playermove 0 * 1400 1400
+# '*' takes the seat's dozer along; stop it so no vehicle is in the crowd
+61 stop 0 AmericaVehicleDozer
+60 arrive 0 AmericaInfantryRanger 1400 1400 200
+60 arrive 0 AmericaInfantryMissileDefender 1400 1400 200
+60 arrive 0 ChinaInfantryRedguard 1400 1400 200
+60 arrive 0 GLAInfantryRebel 1400 1400 200