Old replay desync fix (patch 3629 and older)
-
How a Facebook notification led to a two-byte fix for a 2013 FAF replay
(TL;DR below)To regain my sanity, I need to share a story. A story of suffering, determination, token spending, and, eventually, a huge victory.
It all started with a somewhat cringey Facebook notification. “Celebrate 10 years of friendship with speed2!” I sent him a screenshot, and he responded by finding the oldest game we'd played together. Game #878280, from May 2013.

Of course, that got me curious. I opened the client to download it. The replay vault I could access only went back about four years. What a bummer.
I couldn't let this slide, so I messaged Nuggets. He had the old replay backup. Surely it was in there somewhere? Even the one and only Nuggets came up empty on that ID. Disappointment in the air was measurable.
But I had one last trick up my sleeve. In a drawer sat my super old, rusty laptop, untouched for ten years, waiting for one final Rohirrim charge.
And it delivered. I found my old replay backup! What a win, right? So I launched the replay, full of anticipation on how poorly we played 13 years ago.

And boom… DESYNC. Less than a minute in.
Disappointment levels went off the charts. I went to sleep. Nightmares followed. In them I kept waking up screaming… DESYNC! At this point, it was personal!
Somewhere in that half-awake state I thought, this has to be fixable, right? We have source code. We have forum posts. With all this technology nowadays. There has to be a way.
So the next morning I fired up my buddy ChatGPT and, on speed2's advice, typed “please fix replay no mistakes.”
It has since learned rather more about March 2014 than either of us planned.
What “please fix replay” turned into:
Step 0: How does a replay even desync?
“It’s just a set of orders, right?” Mostly. The engine runs those orders again and compares its simulation checksums with values recorded during the match. A different map, a missing sim mod, different game data, or a different engine could send the simulation off course. I wondered about recording bugs, players leaving, and lag too. Where do I even begin?When I leave out a few dead ends, this is how my line of thinking went:
Step 1: Different setups.
I tried two FAF clients, tested on another PC, put together an offline setup, compared map files and game archives, and checked which files the engine actually loaded. I tried turning off sound, movies, and UI mods. The desync kept coming back.Step 2: Give the desync a number.
In #878280, all eight players had recorded the same checksum at tick 400, or 0:40. The recorded checksum started with 1a793309. Mine started with e73c8350. Now I had a number I could test every idea against.Nuggets sent over some other archived recordings, so we compared server copies with local ones and dug through orders and player departures around the first mismatches. Somewhere in there, a little tool I called FAF Replay Lab came into existence. It grouped old replays by patch and batch-played them at +10 in a window. Supreme Scoreboard caused a separate freeze. Disabling it got the batch moving again.
One of those replays, #2016286, looked vanilla from its empty sim-mod list. Then I checked the featured mod. It was Nomads, and the replay asked for v46 of its gameplay archive. The old updater catalogue calls that file Nomads_b46_FAF.nmd. The list I got for v46 showed the init script and movie archive. We recovered the matching gameplay code from an old Mercurial snapshot, rebuilt the mod, and that replay got past its desync. One win! Still no #878280 fix in sight, though.
Step 3. The devil, patch 3630!
In one batch I had 13/13 desyncs on 3625, 15/17 on 3629, and 0/6 on 3630. Surely I was close now, right? We rebuilt a game archive from the old 3629 source and swapped groups of changes around, including Hotbuild, GazUI, mex rebuilding, the economy panel, and terrain. On our 3629 test replay, the first bad checksum stayed exactly the same. C’mon. Same tick. Same checksum. 3629 source revisionStep 4. The version numbers get suspicious.
I changed the headers of two 3629 replays so they'd load with the archived 3630 setup. Same bad checksums. I tried the reverse too. A 3630 replay matched its original checksum at 5:00 when run on the archived 3629 setup. Then we compared the replay EXEs byte for byte. The two binaries differed in just three bytes, all encoding the version number. An updater log from February 2014 also showed an EXE hash different from the one in today's archive. Time to look at the engine itself. February 2014 updater logStep 5. The golden forum post.
I’d seen one line about improved late-game pathfinding in the 3630 patch notes and moved on. On a second trip through the archive I found a January 2014 thread by Crotalus about units that stopped responding to orders in big games. He named an engine setting called path_ArmyBudget, the amount of pathfinding work each army gets per simulation tick. He reported a default of 1000 and suggested trying 3000. 3630 patch notes and Crotalus’s “Unit command lag fix” threadHm… worth a shot, right? The archived replay EXEs we were using had it set to 2500. FAF's published binary patch also let us recover the 1000 initializer from an older Steam build. A different budget can change which tick a unit gets its path, so the same recorded orders can lead to different positions. Archived FAF binary patch
Step 6. Change two bytes.
I kept the replay and game data the same between runs and changed the default in a copy of the EXE. On the archived 3625 binary, the value at file offset 0x7D9B89 went from C4 09 00 00 to E8 03 00 00. The actual test was whether the engine could compute the original checksum at the tick where playback first went wrong.On #1906432, both runs with 2500 and the run with 3000 produced the same bad checksum at 1:30. With 1000? JACKPOT! The engine computed the exact original checksum. We tried the same change on two more replays.

Then I let my original replay #878280 run with the 1000 EXE. It reached the match result at 13:40 without a single desync warning.
After nearly a month of trials, a worrying number of tokens, and what felt like forty rebuilds of the same game… a VICTORY!
Hope you enjoyed my little story
wanted to write this down so nobody in the future will have to investigate this further, but made it a little more fun in the process 
Thanks to speed2 for finding the game. To Nuggets for digging through his archive and sending comparison replays, and to Crotalus for writing down that number in 2014. I finally got to see how the match ended.
TL;DR
Restoring path_ArmyBudget = 1000 in a copy of the archived EXE reproduced the original checksum at the first mismatch on three replays from FAF 3614, 3625, and 3629. My 2013 replay #878280 went from desyncing at 0:40 to reaching the match result at 13:40.The Nomads replay #2016286 took a separate fix. It played after we rebuilt the matching v46 featured mod. How far either fix reaches is a story for another day.
A little program that fixes old replaying: G Drive Download
Correct old EXEs: Corrected old EXEs G Drive Link
Now, any historian can watch replay number 100 000 again and witness T1 mex sniping with 3 TMLs

Replay 100 000 G Drive LinkI will report this as a bug, hopefully someone will find a little time to fix it for everyone… even though the usage is quite limited due to FAF replay vault not loading replays that are this old anyway.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login