Respect Windows Storage Paths

Ideas that are too old (too many things have changed since) and ones which won't be implemented for certain reasons or if there are obviously better suggestions.

Moderator: ickputzdirwech

MicahZoltu
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun May 26, 2019 7:13 am
Contact:

Respect Windows Storage Paths

Post by MicahZoltu »

Factorio is writing ~400MB to %APPDATA%/Factorio on my computer at the moment. That is dominated by game save files. %APPDATA% is the roaming storage location, which means it is synced over network or the internet and often a default location to be backed up. %APPDATA% is meant to store configuration files and other small user-specific data, it is not intended to be a primary storage location for large data objects (like game saves). %LOCALAPPDATA% is the appropriate location for large user-specific data that shouldn't be automatically synced over a network.

Please move game saves to %LOCALAPPDATA%/Factorio so I don't burn up all of my backup provider bandwidth syncing Factorio game saves.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5267
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Respect Windows Storage Paths

Post by Klonan »

You can set this in the config

`write-data=C:/users/saves`
User avatar
CheeseMcBurger
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Sun May 19, 2019 9:57 pm
Contact:

Re: Respect Windows Storage Paths

Post by CheeseMcBurger »

Klonan, I agree with MicahZoltu. This should be the default path, even if it can be changed in the config file. I believe it's the responsibility of every established software programmer to respect the OS's file hierarchy standard.


MicahZoltu is right about using %localappdata% over %appdata% because folders in roaming profile should be reserved for important data and kept as small as possible because they may be are synced across slow links.

The preferred way however is to use a KNOWNFOLDERID named FOLDERID_SavedGames which is located at %USERPROFILE%\Saved Games. See https://docs.microsoft.com/en-us/window ... wnfolderid

It would be nice is this would be the default save path, although it's real nice of you guys to provide a way to change it for us players.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Respect Windows Storage Paths

Post by FuryoftheStars »

Yeah, you have to figure that a lot of people wouldn’t know this, or are uncomfortable with editing configs.

The game really should default the saves to the userprofile as CheeseMcBurger noted, and probably the mods and all of that to either the same location or to its root install folder. Factorio is the only game I’ve had where I need to dig into the roaming profile folder for these types of things.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Rseding91
Factorio Staff
Factorio Staff
Posts: 14300
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Respect Windows Storage Paths

Post by Rseding91 »

Thanks for the suggestion however the save location isn't going to be changed. You can change it yourself if you like but it's staying where it is.
If you want to get ahold of me I'm almost always on Discord.
User avatar
CheeseMcBurger
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Sun May 19, 2019 9:57 pm
Contact:

Re: Respect Windows Storage Paths

Post by CheeseMcBurger »

What a confrontational response. Too bad.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14300
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Respect Windows Storage Paths

Post by Rseding91 »

CheeseMcBurger wrote: Wed May 29, 2019 5:07 pm What a confrontational response. Too bad.
Your response fascinates me. How would you have liked what I said to be phrased so you wouldn't consider it confrontational?

I wasn't trying to be confrontational or aggressive. There was no meaning beyond reading the request and giving an honest answer.
If you want to get ahold of me I'm almost always on Discord.
User avatar
BattleFluffy
Fast Inserter
Fast Inserter
Posts: 200
Joined: Sun Mar 31, 2019 4:58 pm
Contact:

Re: Respect Windows Storage Paths

Post by BattleFluffy »

System Admin here, just wanted to weigh in that %localappdata% is imho the "technically correct" best place to store larger files like Factorio save games.

I can give a specific technical example of a problem this could cause in the real world.

In a Windows Domain, a feature called "Roaming Profiles" copies the contents of %appdata% on a user's workstation any time a user logs on. If the user logs on at a different computer, their config and preference files contained within %appdata% are copied to the new machine, ensuring a consistent experience across all of the computers in the domain.


So for example imagine some chain of internet cafes each with a bunch of gaming PCs set up. A regular customer visits a different cafe from their usual, and logs on to play Factorio on a computer they've never used before.

When they attempt to log on, they may find it takes ages and ages as it transfers all of their previous save games over the slow VPN link from the cafe they normally visit. There would be no indication that this was happening, they'd simply be stuck at the "logging on..." screen for a very long time.

This then creates a headache for the System Admin of the cafes, who has to figure out why logon is slow, and ultimately may even end up reading this very thread in the course of figuring out how to modify the config file to point to %localappdata% instead. Or they might decide to not allow Factorio to be played at their cafes..


A better behaviour would be to store the save games in %localappdata% by default. In this scenario, the customer who logs on at a different cafe need only transfer the tiny configuration files from %appdata%, so the logon is processed much quicker. A fresh "%localappdata%" is created from scratch for them.
Then they can download their save games from Steam and they are stored in %localappdata%. It downloads fast because it goes straight over the internet, instead of through the cafe's site-to-site VPN.

So, that is why I think that %localappdata% would be a better default location for save games. If it's still not changing, that's fine though. I still think you guys are awesome. :>
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Respect Windows Storage Paths

Post by disentius »

@Rseding:
A straight "no" without motivation doesnt happen often: you devs spoiled us :D
A reason why you won't change this, would be appreciated, Battlefluffy has a valid point.
sepharim
Burner Inserter
Burner Inserter
Posts: 12
Joined: Fri Apr 26, 2019 12:07 pm
Contact:

Re: Respect Windows Storage Paths

Post by sepharim »

As Sysadmin on a Internet Cafe like point for our young guys, that can't go to home after school, we had that trouble with factorio. And standard behavior for a sysadmin is to block factorio sync in %appdata% completly. Therefore we had a battle because everyone wanted to be back at the PC used the last time, to not setup factorio again. So in my opinion: if you use %appdata%, please use it correctly. If you don't want to use it correctly, no reason to use it at all...

Edit: Our solution now: disable the start of a process called "Factorio" if it is not started via our script, that sets the directory to somewhere on the temp disc, and sync it on startup/shutdown of the Factorio script...
User avatar
CheeseMcBurger
Long Handed Inserter
Long Handed Inserter
Posts: 88
Joined: Sun May 19, 2019 9:57 pm
Contact:

Re: Respect Windows Storage Paths

Post by CheeseMcBurger »

Rseding91 wrote: Wed May 29, 2019 9:59 pm
CheeseMcBurger wrote: Wed May 29, 2019 5:07 pm What a confrontational response. Too bad.
Your response fascinates me. How would you have liked what I said to be phrased so you wouldn't consider it confrontational?

I wasn't trying to be confrontational or aggressive. There was no meaning beyond reading the request and giving an honest answer.


The request for changing the storage path objectively follows best practice and the current storage path is objectively not best practice. You categorically refused ("You can change it yourself if you like but it's staying where it is.") to change the path without explaning your reasoning. Sometimes best practices cannot be followed for a good reason -- I work in IT and this happens all the time -- but since you didn't give any insights to your decision, and by using the words you used ("it's staying where it is" is a very absolute choice of words), you gave me the impression of being confrontational.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14300
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Respect Windows Storage Paths

Post by Rseding91 »

As for why:

I don't consider it worth breaking every single piece of documentation, every single persons remembered location, every single script, and possibly more for what is an extreme edge case issue. The *massive* majority of players do not care or even know where Factorio stores save files/configuration data and would see the location of save files being changed as useless noise (as I do).

Regarding "best practice": As a programmer and one who works with C++ there are hundreds if not thousands of "best practices" for how people think C++ should be written and for every one of them there are an equal amount or more people arguing it should be done another way. Having worked on Factorio now for around 5 years I can say that virtually all of the "best practices" people have for C++ are useless outside of their specific environment. So, with that in mind: saying Factorio should store save files in one location and configuration files in another because it's "best practice" reads to me like the people saying how we should write C++.

So, with all of that in mind my answer was an immediate "no". It's not going to improve the majority players experience and it would in all likelihood make it worse: a net negative for Factorio.
If you want to get ahold of me I'm almost always on Discord.
coppercoil
Filter Inserter
Filter Inserter
Posts: 502
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Re: Respect Windows Storage Paths

Post by coppercoil »

Rseding91 wrote: Tue Jun 04, 2019 11:48 pm Regarding "best practice": As a programmer and one who works with C++ there are hundreds if not thousands of "best practices" for how people think C++ should be written and for every one of them there are an equal amount or more people arguing it should be done another way. Having worked on Factorio now for around 5 years I can say that virtually all of the "best practices" people have for C++ are useless outside of their specific environment. So, with that in mind: saying Factorio should store save files in one location and configuration files in another because it's "best practice" reads to me like the people saying how we should write C++.
I see some miscommunication here. Let’s clear what does mean term “best practice” in this particular case. It’s not about your decision how to write your app. It’s about Microsoft decision how your application should live in the Windows ecosystem. There are lots of software that doesn’t follow best practice for various reasons: it’s because software is not supported anymore but still used; it’s because there are billions of lines of legacy code that unrealistic to change; it’s because some programmers aren’t aware of storage specific and limitations; it’s because they’re aware but [insert hundred different reasons here]. It doesn’t mean that all approaches are good. MS Windows has some data handling strategy; it’s documented and available to read. Could we say “by following OS recommendations it’s not going to improve the majority players experience and it would in all likelihood make it worse“? It’s hard to believe.

Does your application live in peace with MS Windows? Or it doesn’t matter for you? Or maybe, it does matter but there are more urgent tasks for today? I agree, most of users doesn’t care. All developers do their best to let them remain careless.

I made a quick search and found a couple of Microsoft documents here and here, these ones may be slightly outdated but still interesting to read.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Respect Windows Storage Paths

Post by FuryoftheStars »

Yeah, I’d have to say that “best practice” writing code is not quite the same concept as “best practice” for how software should reside/interact with an OS. Someone else has already given their real experience with how the current setup has made things harder for them. I really wouldn’t consider this an extreme edge case.

I also fail to see how moving the location will likely make things worse.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Respect Windows Storage Paths

Post by eradicator »

As a long-time windows gamer i expect save files (and config files, and all other data related to) each game to be in a *single* folder in "My Documents" or nowadays "My Saved Games". Certainly not *split into several different locations*. Whatever MS says "should" be done - putting savedata in a *hidden* folder that the average user couldn't even see if they knew where to look is ridiculous. I bet Average Joe still does his backups by drag+dropping folders to an external USB device. Stuff he can't see will be lost.

Factorio however has great support for config and even cli options to set the path to whereever i want. Most other games require hacks like overwriting environment variables to do this. Anyone who "runs an internet cafe" should certainly be able to cope with this.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2768
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: Respect Windows Storage Paths

Post by FuryoftheStars »

@Eradicator,

Your post is a little confusing to me. You say you expect the data (including saves) to be in one location (My Documents), but then it seems like you're bashing the MS Docs for saying the saves should be in hidden folders (which I don't think is what they're saying) and then conclude that internet cafe folks can deal with using the config files.

It's like you're starting off agreeing with us all, then somehow in the middle gets things mixed up and side with the devs? As I'm sure you're aware, Factorio currently saves data to a hidden folder (AppData) and we're asking for it to be pulled out of there.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Respect Windows Storage Paths

Post by eradicator »

FuryoftheStars wrote: Thu Jun 06, 2019 1:03 pm It's like you're starting off agreeing with us all, then somehow in the middle gets things mixed up and side with the devs? As I'm sure you're aware, Factorio currently saves data to a hidden folder (AppData) and we're asking for it to be pulled out of there.
The opening posts states that it wants only some parts of the data (the savegame files) to be in yet another hidden folder (%localappdata%), while config files should stay in %appdata%. Unless i misunderstood something. Then someone suggested using SavedGames, though he doesn't state if he wants the config files there too. And the "Internet Cafe Argument" is just placing arbitrary constraints "slow vpn sync is bad, but steam sync is fine" and says the devs should solve that too.

The second part of my post was more like "oh c'mon, other software is much worse, factorio at least has support to chose-your-own-location".
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Jap2.0
Smart Inserter
Smart Inserter
Posts: 2378
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Respect Windows Storage Paths

Post by Jap2.0 »

Another possibility: put it in the directory the game is installed in - be that under steam or in its own folder. It's a reasonable location for a save to be, works with sync issues, and deals with situations where steam/games are installed on a HDD so that you aren't constantly putting a bunch of files on the boot drive/SSD.
There are 10 types of people: those who get this joke and those who don't.
BenSeidel
Filter Inserter
Filter Inserter
Posts: 590
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: Respect Windows Storage Paths

Post by BenSeidel »

Klonan wrote: Sun May 26, 2019 7:34 am You can set this in the config

`write-data=C:/users/saves`
Hi,
I have been trying to do this for such a long time but I can't do it.
Can you please show me what the "write-data" path would be so that it uses a users "save game" directory in Windows? Hell, even their "My Documents" folder would be good enough.

Reason: Because I'm sick of having to describe to people how to get to their save games. Do you how many people don't know what the ampersand key is?
User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Respect Windows Storage Paths

Post by disentius »

"How" is described in config-path.cfg
config 0.png
config 0.png (25.6 KiB) Viewed 6961 times
config 1.png
config 1.png (43.85 KiB) Viewed 6961 times
Post Reply

Return to “Outdated/Not implemented”