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.

10.1 KB
Raw Blame
# Infantry on foot, before any feel rewrite: a Ranger, a Red Guard, a Rebel, a Pathfinder and a
# squad of eight Airforce Rangers each walk the same zig-zag on the same strip of open ground, one
# after another, 1250 frames apart. Every walker is ordered east, then bent 30, 60, 90 and 135
# degrees off the way it is actually walking (each order lands 120 frames after the last, mid-stride,
# 400 out), then turned straight back. At +780 it is stopped, at +840 sent 60 to 70 on to a goal,
# and at +960 attack-moved past a Chinese Hacker that stands 160 away and 22 degrees off the line.
# At +1240 it walks off to 1600,3200 to clear the strip for the next one.
#
#   generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit
#     -map "Maps\Twilight Flame\Twilight Flame.map" -autoskirmish 2 -takeover
#     -side 0 FactionAmerica -side 1 FactionChina -seed 7 -maxframes 6300
#     -scenario infantrywalk -tracemove <id> -logPrefix iw_t<id>_
#
# Ids on that line: the squad is 216 to 223, the Ranger 225, the Red Guard 227, the Rebel 229 and
# the Pathfinder 231 (the Hackers take the ids between). -tracemove follows one id, so it took twelve
# runs; all twelve ended on CRC 0xDBEAD2B3. The lanes at y 3250, 3700 and 3900 on this map have
# something in them that bends a path on the first leg, which is why everyone walks y 3500.
#
# Measured 2026-10-04. Speeds are per logic frame: Ranger and Rebel 0.667 (20 a second), Red Guard
# 0.833, Pathfinder 1.0. The Rebel shares the Ranger's locomotor and its trace matched the Ranger's
# to the hundredth on every frame, so it gets no column of its own.
#
#                                Ranger      Red Guard   Pathfinder  squad (8)
#   order to first step          2           2           2           2 to 4
#   order to top speed           7           8           9           6 to 8
#   30 deg bend, slowest         68%         67%         75%         65 to 80%
#   60 deg                       51%         49%         60%         50 to 55%
#   90 deg                       33%         30%         39%         27 to 48%
#   132 deg                      17%         14%         13%         13 to 20%
#   175 deg (reverse)            9%          7%          11%         8 to 12%
#   frames lost 30/60/90/132/175 0.9/2.4/4.5/6.5/8.2  0.9/2.8/5.5/7.6/9.4  0.7/2.3/5.0/8.6/9.4
#   back to 95% after the dip    5, 8, 11, 13, 15 frames for the Ranger; the others within 3
#   stop order, frames to zero   1 (one more frame of travel, 0.66 / 0.83 / 1.0 long)
#   arrival brake                2 frames (Pathfinder 4), 0.667 0.55 0.45 then 0, 3 to 5 off the point
#
# "Frames lost" is the distance short of a straight walk at full speed over the 60 frames after the
# order, in frames of full speed. No unit's speed reached zero mid-route: the reverse bottoms out at
# 0.066. The nose turns at a flat 16.7 degrees a frame and nothing eases it in or out, so a reverse
# is 11 frames of identical steps and each episode has about 30 frames that turn 15 degrees or more.
# For five of those 11 frames the forward speed is negative, down to -0.135: the man skids backwards
# past his own nose while it swings. Braking is 100 a second squared, which would take 6 frames and
# 2 units from a walk; a stop order takes it to zero in one frame and an arrival in two.
#
# Squad. Eight men ordered as a group never blocked each other and never stood still mid-route. Each
# walks to his own slot and stops dead the same way a single man does, so at the +840 goal the eight
# stop between 55 and 115 frames after the order, the last 60 frames apart, and stand 9 to 43 from
# the ordered point, within 36 of their centre. The final slide onto the goal never ran: no unit in
# any run moved on a frame its speed was zero.
#
# Attack-move. The Ranger takes 3 steps toward the move point, stops dead from 0.45 (frame 5), turns
# 17 degrees and walks 70 frames, brakes 2 frames and stops 111 from the Hacker, facing it, then fires
# for 188 frames before it walks on. The Red Guard's false start comes at frame 7 from 0.67; it then
# walks a diagonal 33 degrees off the Hacker's bearing, stops 110 short from its full 0.83 in one
# frame and pivots the 33 degrees in 2 frames on the spot before it fires. The Rebel repeats the Ranger. The Pathfinder pivots 4 frames on
# the spot, kills the Hacker from where it stands and walks on without stopping again.
#
# After the infantry drive (Locomotor::moveTowardsPositionLegs, brakeLegs) and the attack-move scan
# on the first frame for infantry. Same command line, same twelve ids, every run on CRC 0x434F4651.
# Before is the same script over the logs above, so where it reads a frame differently from the
# table above it does so on both sides.
#
#                                Ranger      Red Guard   Pathfinder  squad (8)
#   order to first step          2 / 2       2 / 2       2 / 2       2-4 / 2-4
#   order to top speed           7 / 7       9 / 9       10 / 10     7-9 / 7-9
#   frames lost 30 deg           0.7 / 0.3   0.8 / 0.2   0.6 / 0.2   0.4-0.8 / 0.2-0.5
#   60 deg                       2.3 / 1.0   2.7 / 1.0   2.2 / 1.0   1.9-2.4 / 0.9-1.0
#   90 deg                       4.4 / 2.1   5.4 / 2.2   4.9 / 2.4   2.8-4.9 / 1.7-2.3
#   132 deg                      6.4 / 5.1   7.5 / 5.7   8.5 / 6.3   6.1-7.0 / 4.6-5.9
#   175 deg                      8.1 / 7.6   9.3 / 7.8   9.3 / 8.8   7.8-8.4 / 7.2-7.8
#   least forward speed, bends   -0.135 / +0.012  -0.191 / +0.015  -0.259 / +0.018
#   stop order                   1 frame, 0.67 / 3 frames 0.45 0.23 0, 1.33 long (Red Guard 1.67, Pathfinder 2.0)
#   arrival brake                0.56 0.02 0 / 0.45 0.22 0.01 0, 3 to 5 off the point both times
#
# Nobody skids backwards any more: his walk turns with his nose, and on a bend he keeps the cosine of
# what is still to turn, so a 30 degree bend keeps him at 74 to 90% where it used to drop him to 65 to
# 80%. Past a right angle he stops in three frames and turns on the spot, which is why the slowest
# speed through a reverse reads 3% now. The turn winds up and down over two frames and still peaks at
# 16.7 degrees a frame. Attack-move: no false start on any walker or squad member (five of the eight
# took one before). The Ranger stands still 6 frames while the approach path comes, then walks
# straight in and stops 112 from the Hacker on frame 76 facing it (frame 77, after the false start,
# before); the Red Guard stops 109 short on frame 77 facing it, 0 degrees off where it was 18 and
# pivoted, on frame 79. Squad at the +840 goal: last stop 100 frames after the order (116 before),
# 9 to 42 from the point.

30    spawn      0  AirF_AmericaInfantryRanger   8   900 3500  15
60    move       0  AirF_AmericaInfantryRanger       1298 3498
180   move       0  AirF_AmericaInfantryRanger       1322 3698
300   move       0  AirF_AmericaInfantryRanger       1398 3354
420   move       0  AirF_AmericaInfantryRanger       1327 3836
540   move       0  AirF_AmericaInfantryRanger       762 3477
660   move       0  AirF_AmericaInfantryRanger       1464 3671
780   stop       0  AirF_AmericaInfantryRanger
840   move       0  AirF_AmericaInfantryRanger       1210 3571
960   spawn      1  ChinaInfantryHacker          1   1360 3511
960   attackmove 0  AirF_AmericaInfantryRanger       1510 3571
1240  move       0  AirF_AmericaInfantryRanger       1600 3200

1280  spawn      0  AmericaInfantryRanger        1   900 3500
1310  move       0  AmericaInfantryRanger            1300 3500
1430  move       0  AmericaInfantryRanger            1324 3700
1550  move       0  AmericaInfantryRanger            1401 3357
1670  move       0  AmericaInfantryRanger            1309 3856
1790  move       0  AmericaInfantryRanger            767 3486
1910  move       0  AmericaInfantryRanger            1469 3679
2030  stop       0  AmericaInfantryRanger
2090  move       0  AmericaInfantryRanger            1215 3581
2210  spawn      1  ChinaInfantryHacker          1   1365 3521
2210  attackmove 0  AmericaInfantryRanger            1515 3581
2490  move       0  AmericaInfantryRanger            1600 3200

2530  spawn      0  ChinaInfantryRedguard        1   900 3500
2560  move       0  ChinaInfantryRedguard            1300 3500
2680  move       0  ChinaInfantryRedguard            1343 3700
2800  move       0  ChinaInfantryRedguard            1436 3365
2920  move       0  ChinaInfantryRedguard            1361 3858
3040  move       0  ChinaInfantryRedguard            830 3500
3160  move       0  ChinaInfantryRedguard            1515 3691
3280  stop       0  ChinaInfantryRedguard
3340  move       0  ChinaInfantryRedguard            1278 3598
3460  spawn      1  ChinaInfantryHacker          1   1428 3538
3460  attackmove 0  ChinaInfantryRedguard            1578 3598
3740  move       0  ChinaInfantryRedguard            1600 3200

3780  spawn      0  GLAInfantryRebel             1   900 3500
3810  move       0  GLAInfantryRebel                 1300 3500
3930  move       0  GLAInfantryRebel                 1324 3700
4050  move       0  GLAInfantryRebel                 1401 3357
4170  move       0  GLAInfantryRebel                 1309 3856
4290  move       0  GLAInfantryRebel                 767 3486
4410  move       0  GLAInfantryRebel                 1469 3679
4530  stop       0  GLAInfantryRebel
4590  move       0  GLAInfantryRebel                 1215 3581
4710  spawn      1  ChinaInfantryHacker          1   1365 3521
4710  attackmove 0  GLAInfantryRebel                 1515 3581
4990  move       0  GLAInfantryRebel                 1600 3200

5030  spawn      0  AmericaInfantryPathfinder    1   900 3500
5060  move       0  AmericaInfantryPathfinder        1300 3500
5180  move       0  AmericaInfantryPathfinder        1361 3700
5300  move       0  AmericaInfantryPathfinder        1471 3375
5420  move       0  AmericaInfantryPathfinder        1419 3855
5540  move       0  AmericaInfantryPathfinder        895 3519
5660  move       0  AmericaInfantryPathfinder        1566 3701
5780  stop       0  AmericaInfantryPathfinder
5840  move       0  AmericaInfantryPathfinder        1344 3611
5960  spawn      1  ChinaInfantryHacker          1   1494 3551
5960  attackmove 0  AmericaInfantryPathfinder        1644 3611
6240  move       0  AmericaInfantryPathfinder        1600 3200