Page 1 of 1

Mods and Saves Sync

Posted: Wed Nov 02, 2016 4:41 pm
by sherwood
I have a laptop and a desktop that I play Factorio on. Often times I want to continue a game on a different computer than I began on. I have a file server running FreeNAS with a shared drive on both pcs. It is mapped the same on both.

I created a simple batch file that I use to first sync from the network drive, then launch Factorio. It is then paused until I exit the game at which time it then syncs any updates from the pc I am on back to the network drive.

It works great, but I was hoping to make it just that extra bit more automated. I know very little programming and just enough about batch files to copy files. I noticed in the cmd window that I can see what Factorio is doing and when you exit it says "Goodbye". I was wondering if there is anyway to make the last sync (back to the network drive) occur automatically when the line with Goodbye is printed.

Or is there a completely different and easier way of doing this?

Re: Mods and Saves Sync

Posted: Wed Nov 02, 2016 5:29 pm
by Optera
Having mods being saved and activated together with save files could be a nice option. It would open the possibility to make servers distribute their mod package to clients.

Re: Mods and Saves Sync

Posted: Sun Dec 11, 2016 6:18 am
by AlyxDeLunar
Just to chime in with a bit of my knowledge that may help, although I'm not sure exactly how to address your desired use case.

I did a similar things for Minecraft servers, but using Dropbox. I wanted to host a server for friends occasionally, but play on the world by myself offline on my laptop when I wanted. When I installed Dropbox it comes with a folder that automatically syncs files/folders on it. So I wanted the server on there, but also locally in the spots I needed.

The answer for that is symbolic links, and I think they could solve your problem here.
Essentially, it'll make it so that your data is actually stored in the network drive, but you can have a pretend instance of it locally that your game runs from.

The command in Windows is:

Code: Select all

mklink /prefix link_path file/folder_path
mklink is the command
/prefix is the kind of link, in our case it'll be /j (Which makes an entire directory a symbolic link)
link_path is where our pretend folder will sit, we want this to be local on the machine
file/folder_path is where the real folder sits, which we'll want to have on the network drive

For a quick use case, let's assume I want the following:
  • My local Factorio save folder to be at: C:\Factorio\Saves
  • My local Factorio mod folder to be at: C:\Factorio\Mods
  • My external drive save folder to be at: E:\FactorioBackup\Saves
  • My external drive mod folder to be at: E:\FactorioBackup\Mods
I'm assuming right now that you have your data both on the network and locally. Before running this:
  • Backup somewhere else (you know...just in case)
  • Delete the folders where your local mod and save folders reside
Then I would run two commands to set this up:

Code: Select all

mklink /J C:\Factorio\Saves E:\FactorioBackup\Saves
mklink /J C:\Factorio\Mods E:\FactorioBackup\Mods
From this point, your data is never actually stored locally, only on the network drive. The game runs normally however, and changes are automatically made to the network drive, which both PC's see the changes of automatically already.

Hope that explained it. I have a habit of...over-explaining. If this sounds like what you're looking for and you have any more questions, let me know!

Re: Mods and Saves Sync

Posted: Wed May 03, 2017 10:27 am
by CaptainKonzept
I'm using Resilio Sync (former Bittorrent Sync) and it works like a charm. I play on Win (gaming pc) and OS X (laptop). Sync "C:\Users\YOURUSER\AppData\Roaming\Factorio" with "~/Library/Application Support/factorio" and it'll work for savegames, blueprints and mods (everything in that folder).