# Rubberbanding (runtime/catchup.c, Mods: Rubberbanding): a career race with the player left at the start.  Every
# 300 frames for 90 s of the race's clock (GRaceStatus [0x890118] +0x14, 1/4000 s): the four racers' share of the
# route done (d0..d3, racer entries at +0x30, 0x1F0 bytes each: +0x14), and the opponents' speed (v1..v3, car +0x430)
# and place (x1..x3, y1..y3, car +0x60).  At 30, 60 and 90 s of the race's clock the opponents' places and shares
# as dwords (peekx), to compare two runs bit for bit (NFSU2_FIXED_DT: the same world steps whatever the load).  With
# NFSU2_CATCHUP_LOG=1 catchup.c logs the factors the game made and how many it changed.  Unset and original: the
# game's own; noboost: the opponents still wait; off: they drive away.
#   NFSU2_SAVE_SEED=<a career save tree> node web/tools/run-suite.mjs --base <server> --script catchup_park.txt
#        --marker "CATCHUP done" --name <name> --env CU_RACE=<a circuit of the seed's career> --env NFSU2_FIXED_DT=60
#        [--env NFSU2_CATCHUP=original|noboost|off] [--env NFSU2_CATCHUP_LOG=1]
0     bot on
+0    waitroam 6000
+0    bot off
+60   careerlist
+0    careergo ${CU_RACE}
+300  tapfe RETURN UI_EngageRaceDialog.fng 120 2400
+120  tap LEFT
+30   tap RETURN                      # Accept
+0    waitexpr i:0x863470 != 0 3000   # Career +0x8730: the career race being run
+0    waitexpr i:[0x890118]+0x24 >= 2 6000
+0    waitfng HUD_SingleRace.fng 6000
+0    waitexpr i:[0x890118] == 4 3000
+0    wzero
+0    log race_started
+0    expect i:0x89e7f8 != 0          # the race's Catch Up flag (a career race leaves it on)
+0    trace 300 rc=i:[0x890118]+0x14 st=i:[0x890118] d0=[0x890118]+0x44 d1=[0x890118]+0x234 d2=[0x890118]+0x424 d3=[0x890118]+0x614 v1=[[0x890118]+0x220]+0x430 v2=[[0x890118]+0x410]+0x430 v3=[[0x890118]+0x600]+0x430 x1=[[0x890118]+0x220]+0x60 y1=[[0x890118]+0x220]+0x64 x2=[[0x890118]+0x410]+0x60 y2=[[0x890118]+0x410]+0x64 x3=[[0x890118]+0x600]+0x60 y3=[[0x890118]+0x600]+0x64
+0    waitexpr i:[0x890118]+0x14 >= 120000 9000
+0    log at_30s
+0    peekx *0x890118+0x14 1
+0    peekx *(*0x890118+0x220)+0x60 2
+0    peekx *0x890118+0x234 1
+0    peekx *(*0x890118+0x410)+0x60 2
+0    peekx *0x890118+0x424 1
+0    peekx *(*0x890118+0x600)+0x60 2
+0    peekx *0x890118+0x614 1
+0    waitexpr i:[0x890118]+0x14 >= 240000 9000
+0    log at_60s
+0    peekx *0x890118+0x14 1
+0    peekx *(*0x890118+0x220)+0x60 2
+0    peekx *0x890118+0x234 1
+0    peekx *(*0x890118+0x410)+0x60 2
+0    peekx *0x890118+0x424 1
+0    peekx *(*0x890118+0x600)+0x60 2
+0    peekx *0x890118+0x614 1
+0    waitexpr i:[0x890118]+0x14 >= 360000 9000
+0    log at_90s
+0    peekx *0x890118+0x14 1
+0    peekx *(*0x890118+0x220)+0x60 2
+0    peekx *0x890118+0x234 1
+0    peekx *(*0x890118+0x410)+0x60 2
+0    peekx *0x890118+0x424 1
+0    peekx *(*0x890118+0x600)+0x60 2
+0    peekx *0x890118+0x614 1
+0    untrace
+0    log CATCHUP done
+10   quit
