Page 1 of 1

Сommand line option to enable replay recording

Posted: Sat Jun 07, 2025 1:20 pm
by artemlisonok
TL;DR
In version 2.0.52, the --run-replay command line option was added, maybe this is a good reason to finally add the function to enable replay recording from the command line?
What?
I suggest to add command line option to enable replay recording. Something like --enable-replay or additional parameter in server-settings.json.
Why?
I am organizing events on my dedicated server and would like to be able to record a replay of each of them. Now I have to recreate a replay save every time I update a game or mod.
There has been talk about this for several years, which means that I'm not the only one interested in this feature.

Re: Сommand line option to enable replay recording

Posted: Sat Jun 07, 2025 1:39 pm
by Rseding91
I don't understand the request. Even if such a command was added, it would not be able to *enable* a replay on an existing save file. Replays can only be enabled from the start of a save file and any game updates or mod changes will disable them permanently.

Re: Сommand line option to enable replay recording

Posted: Sat Jun 07, 2025 2:02 pm
by artemlisonok
Rseding91 wrote: Sat Jun 07, 2025 1:39 pm it would not be able to *enable* a replay on an existing save file
Yes, I know it. I'm starting my event from scenario with such command:

Code: Select all

factorio.exe --start-server-load-scenario pvptorio-new/custom-pvp --server-settings .\server-settings.json --port 34197
And if I want to enable replay, I need to:
  • Lunch the game
  • Main menu → Single player → New game → Check "Record replay" → Select my scenario → Launch
  • Enter the Game menu → Save game → Quit game
  • Copy the created save game to the dedicated server save directory
  • Launch the server from save
And I have to follow these steps every time a game or mod is updated.
So i suggest to add --enable-replay command line option or additional parameter in server-settings.json, to avoid repeating this steps.

Re: Сommand line option to enable replay recording

Posted: Tue Mar 10, 2026 5:49 am
by root
I have an identical use case. The ability to enable replay for a fresh scenario on a headless server would be very useful.

Re: Сommand line option to enable replay recording

Posted: Tue Mar 10, 2026 2:20 pm
by quyxkh
You can update the configs, I do this for check-updates. Factorio has `-c` to pick the config file, if it had a `-C` to force particular config settings for this run you could `factorio -C interface.check-enable-replay-checkbox=true` to force replay enabled for this run. But for now if you want it set true yourself you can (bash syntax, $replay is true or false, $config is the config path)

Code: Select all

if [[ `grep ^check-enable-replay-checkbox=$replay` != *$replay ]]
then    sed -Ei 's/^ *;? *(check-enable-replay-checkbox) *=.*/\1='$replay/ "$config"
fi
with the weird wrapping around the sed sub there to see past any whitespace and commenting flexibility in use. That's a straight adaptation from my own factorio startup thingy.