Rewind, pause and scrub Beyond All Reason replays, rendered by BAR itself.
Download v0.4.2 (Linux and Windows)
Click or drag the timeline and the match is there, at that moment.
Press R and the fight runs in reverse: shots fly back into the guns and dead units come back.
Up/Down change the speed. At 64x a whole match unwinds in seconds.
Needs BAR installed and Python 3 (Windows: tick "Add to PATH").
- Download
bar-rewind-linux.tar.gzorbar-rewind-windows.zipfrom the release and extract it. - Run
bar-rewind(Linux) orbar-rewind.bat(Windows). The app opens in your browser. - Check the BAR data folder at the top. It's usually found on its own; if not, paste it and press Enter.
It's the folder BAR keeps its data in, with
engine/,maps/anddemos/inside, not the install folder:- Linux Flatpak:
~/.var/app/info.beyondallreason.bar/data - Linux AppImage:
~/.local/state/Beyond All Reason - Windows:
%LOCALAPPDATA%\Programs\Beyond-All-Reason\data
- Linux Flatpak:
- Click Parse on a replay (a minute or more, depending on its length), then Play.
In the player a timeline runs along the bottom of the screen: play/pause and rewind/fast-forward buttons, a scrub bar to drag with time marks under it, and the replay time and speed; the game info panel under the player list shows the replay time and speed too. Space play/pause, R reverse; with the mouse over the timeline, Left/Right skip 10 s and Up/Down change speed. The app quits on its own about 90 s after you close its browser tab.
Map previews of .sd7 maps need 7-Zip (7z on Linux); everything else works without it.
A .curves file holds everything playback needs, so watching one someone else parsed needs only BAR and
the player (bar-rewind.exe on Windows, bar-rewind-player-linux on Linux), no Python or app. Run it
once and .curves files and Watch links on a BAR Rewind server open with it (on Linux through a desktop
entry in ~/.local/share/applications, which needs xdg-utils). The first Watch link from a server asks
whether to trust that server; the answer is kept in bar-rewind.json (trusted_hosts). It puts the player
in BAR's data folder and fetches the replay's engine, game and map when they're missing. --uninstall
undoes the registration.
Needs Zig 0.17 and Python 3.
zig build run # the app
zig build run -Ddemo=<replay.sdfz> # parse (once, cached) and play one replay
zig build test
zig build dist # the packages, and the player alone (dist/bar-rewind.exe, dist/bar-rewind-player-linux)lua/dump_replay.lua: the BAR widget that records a replay while the headless engine re-simulates itsrc/bake.zig,src/curves.zig: recording →.curves(keyframes thinned with Douglas–Peucker), andbake export-lua, which writes them in the form the player readssrc/player.zig: the player, which plays a.curveswith the mutator built inrecoil/barrewind.sdd: the BAR Rewind game (a mutator on top of BAR) that plays.curves: thereplay_player,replay_ecoandreplay_viewgadgets, the chat, map-mark and timeline widgets, and the game info panel that stands in for BAR'stools/pipeline.py: parse and play (also a CLI, see its header);tools/ui.py: the browser app
BAR replays only play forward: a .sdfz file is a list of player commands that the engine re-simulates.
bar-rewind runs a replay through the engine once ("parse"), records where everything is, and plays that
recording back inside BAR, where you can drag a timeline, play backwards and change speed.
The parse keeps only the keyframes playback needs: a key is dropped when interpolating without it stays within 0.5 elmo. What it records:
- Every unit: position, facing, health, build progress, on/off, what its weapon aims at, what it builds
- Aim pieces: each weapon's barrel and everything it hangs from (torso, turret, arms), so a turret points the right way the moment you jump to any time
- Projectiles, features (wrecks, trees) and terrain changes
- Command queues: every unit's queued orders. Playback gives each unit its orders, so the engine draws them for the selected units and BAR shows queued buildings as it does live; the units never carry them out
- Chat and map marks: every message, point, drawn line and erase, fed into BAR's own chat and map marks as the replay reaches them (the match's players are listed in the playback game so BAR knows them)
- Economy: every team's metal and energy level, storage, income, expense and pull, once a second. The player feeds them back through the engine's own resource counters, so BAR's top bar, player list and eco stats show the match's economy at the replay time (replays parsed before this show what the replayed units produce instead).
BAR animates the rest itself, from the recorded movement: walk cycles, idle motion, deaths and explosions.
- Parse: the engine plays the replay and records every unit every 0.1 s.
- Bake: per unit, start with only the first and last sample as keys.
- Slide a "playback" unit straight between the two keys at constant speed, and measure how far it is from the real unit at each sample's time.
- Worst gap over 0.5 elmo: keep that sample as a key, then repeat on both halves. Otherwise drop every sample in between.
Being on the right path isn't enough: a unit that idles and then drives off is late compared to the straight line, so the moment it starts moving becomes a key.
One 53-minute match (2240 units, 14k projectiles) on a Ryzen 7 5800X:
BAR replay (.sdfz) |
1.7 MB |
| Parse (once per replay) | 6 min |
Parsed replay (.curves) |
108 MB |
A 16-minute match parses in under a minute, to 12 MB.
- Output folder (default
out/next to the app; change it at the top of the page): parsed replays (curves/), map previews, and the logscurves/dump.log(parse) andplay.log(play). - Settings:
bar-rewind.jsonin~/.config/(Linux) or%APPDATA%(Windows), holding the two folders. - In BAR's data folder:
games/barrewind.sdd, the player BAR loads. Parsing briefly addsLuaUI/Widgets/dump_replay.luaand removes it again.
If something goes wrong, the page shows the end of the log; the full logs are in the output folder.
The code was written by AI. I guided it: Provided sources, how to connect ideas, coming up with ideas on how to solve problems, talked it through what to build and how. (To save time and provide a tool quickly).
GPL-2.0 (see LICENSE), like BAR's own code. Nothing from BAR is included: models, maps and the game
itself are loaded from your BAR install.



