[0.11.13] Linux Version - Save games in $HOME somewhere

Post all other topics which do not belong to any other category.
Post Reply
lyallp
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sat Jan 24, 2015 8:03 am
Contact:

[0.11.13] Linux Version - Save games in $HOME somewhere

Post by lyallp »

I have only known about this stupid game for 3 days and have already spent too much time playing. :)

Just a suggestion regarding linux security. (not that I am telling you anything new)

I understand that at this time, the game is expected to be installed in the users home directory and should multiple users of a single linux system wish to play the game, each would have to install it.

However, generally, we want to install a piece of software in one place and then have user specific data stored somewhere separate.

GIven linux is generally multi user, having the saves in one location is probably not useful.

How about saving games in $HOME or maybe $HOME/.local/share/factorio.

Also, have a search path for mods, starting in $HOME somewhere, then to the game installation directory.

Allow mod updates to mods in the $HOME tree, but not in the game install directory, unless the game has been run as a user with write access to the game installation directory. (maybe a special factorio user owns the install directory but generally you can expect it to be owned by root).

I guess it's up to you if you allow different versions of mods in $HOME than in the base install, but I would probably say "if it's in install directory, you can't update nor download the same mod into your home directory" or maybe "Mods in $HOME override whatever is in the base install"

Anyway, having a great time playing the game. A couple of small things I would like to see
1. Mouse click movement, in addition to keyboard
2. When a conveyor belt is demolished, auto-pickup the items that where on the belt, just like items inside boxes are auto-picked up
3. It would be really nice if there was a status message in factory buildings which gives reasons why it's not building items ("Insufficient Widgets", "No room to place product", etc)
4. A full component tree for an item. Building an advanced item requires lots of precursor components, for beginners like me, it takes a while to figure out what the requisite components are. Building an Inserter, for example.
5. It would be nice if we could climb over pipes, rather than having to use underground for frequently travelled paths. More than once I have 'locked my self in' with pipes :)
...Lyall

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.11.13] Linux Version - Save games in $HOME somewhere

Post by cube »

You are using the arch package? :-D

Currently this is half done, the default paths are /usr/share/factorio for read only data and ~/.factorio for write data (mods and saves). Permissions for auto updater are not handled in any way (you would need root).

On the other hand the tarball ships with a config file (config-paths.cfg) that disables the previous settings and moves the defaults for both to "__PATH__executable__/../..".
Once the config file is created, these defaults are overridden one more time by settings in the config file (path.read_data and path.write_data). Complicated, right?

Anyway, whatever settings you want, it is the easiest to tweak them in the config.

lyallp
Long Handed Inserter
Long Handed Inserter
Posts: 62
Joined: Sat Jan 24, 2015 8:03 am
Contact:

Re: [0.11.13] Linux Version - Save games in $HOME somewhere

Post by lyallp »

I am using the tarball, extracted into /usr/local

I found the 2 config files.

Turned config-path.cfg setting to true

Code: Select all

use-system-read-write-data-directories=true
My config/config.ini now contains

Code: Select all

[path]
read-data=__PATH__executable__/../../data
write-data=.local/share/factorio
Now, if I remove write access to the game installation directory, the game will core dump on exit.

Code: Select all

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::property_tree::ini_parser::ini_parser_error> >'
  what():  /usr/local/factorio/config/config.ini: cannot open file
Aborted (core dumped)
The problem is, I assume, it is trying to write the config file out. It is not keeping the config in the write-data path, it's updating the config.ini in-place.

Of course, this means one users preference overrides anothers as I have to make the shared config file writable.

Config.ini needs to be found via 'write-data, then read-data' and then copied into 'write-data' if it was found in 'read-data', then opened.

Maybe, if the read-data version is newer (implying an upgrade), somehow merge? After all, we want new ini entries to become available but we don't want to overwrite existging settings a user may have configured.
...Lyall

hoho
Filter Inserter
Filter Inserter
Posts: 677
Joined: Sat Jan 18, 2014 11:23 am
Contact:

Re: [0.11.13] Linux Version - Save games in $HOME somewhere

Post by hoho »

Turning on writing stuff to system folders (/usr/) doesn't seem like a good idea. Couldn't you just change the config path to point somwhere under $HOME?

User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: [0.11.13] Linux Version - Save games in $HOME somewhere

Post by cube »

Your config.ini must be writable too. You can try putting it into ~/.local/factorio/config.ini and changing the config-path=home/you/.local/factorio/ in /usr/local/factorio/config-path.ini . This is not very clean tough, because now every user who wants to play factorio will get write errors on exit.

Aardwolf
Long Handed Inserter
Long Handed Inserter
Posts: 95
Joined: Tue Feb 03, 2015 2:05 pm
Contact:

Re: [0.11.13] Linux Version - Save games in $HOME somewhere

Post by Aardwolf »

I use Archlinux myself to play the game, and I actually prefer the current way.

I like everything related to a game to be self-contained in one directory, not spread accross the whole system.

But that may be just me :)

User avatar
Gandalf
Filter Inserter
Filter Inserter
Posts: 294
Joined: Fri Dec 19, 2014 10:15 pm
Contact:

Re: [0.11.13] Linux Version - Save games in $HOME somewhere

Post by Gandalf »

I agree with @Aardwolf, having everthing in one directory is quite practical. Maybe this could be
offered as an installation option. I understand that it already kind of is, but maybe just call it
“portable installation” or something, so you can relax and be sure that nothing leeks out into
~/.local/share/ or any other of those little overflows..
Essentially a global install should use the appropriate directories for storing individual users' data in
their $HOME, while a portable install (extracting the archive and go) should remain contained.
OS: Linux Mint 19 x64 | desktop: Awesome 4.2  |  Intel Core i5 8600k  |  16GB DDR4  |  NVidia GTX 1050 Ti (driver version: 410.104)    (2019-03)

Post Reply

Return to “General discussion”