Jump to content


Photo
- - - - -

Linux - Preferences not saving via game GUI


  • Please log in to reply
18 replies to this topic

#1 apocalyptech

apocalyptech

    Rubber Ducky

  • Member
  • Pip
  • 6 posts

Posted 13 February 2015 - 16:25

I know this appears to be a known issue, but some related advice in the FAQ is a bit awful, so I figured it'd bear bringing up.

 

I'm playing on the Linux version (Fedora 21 specifically), with the Steam version (1.1.3.0), and my preference choices in the game settings never actually get saved to the prefs file.  As per pcgamingwiki.com, I was able to go in and set the options I wanted by hand, so that's a reasonable workaround, but it'd be nice if the game's settings would save in-game properly.  It's not just the video settings; I'd also wanted to turn subtitles on, and that didn't persist between playthroughs either.

 

Now, more the reason I decided to post, since this seems like it's a known issue.  In the FAQ, in a related question about not being able to save the game at all, the following advice is given:

 


To make sure the game can write savegames, you can issue the following command from your terminal-/console window: "sudo chmod 777 ~/.config".

 

That's just awful advice - don't do that.  Your ~/.config file should only be writeable by your own user, not anything on the system.  I admit that the permissions on your top-level homedir on Linux would probably prevent folks from writing in there, but not all distros prevent user-dir read access.  The solution in this case isn't to make your ~/.config globally writeable, it's to ensure that the dir is owned by your user.  The following would do the trick (and handle a much wider range of cases than only modifying the top-level directory, to boot) -

sudo chown -R username ~/.config

(replacing "username" with your actual system username), or:

sudo chown -R $(whoami) ~/.config

That'd recursively change the owner of all files/dirs under ~/.config to be owned by your user.  I believe that should work fine on OSX as well, though I don't have any Mac systems to test it out.


  • khh likes this

#2 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 17:10

Sure, it's maybe not the best advice to make the whole "root" dir of ~/.config writeable, for reasons I'm sure most can understand. So your proposed command(s) would be better to use. I'll update that.

 

Thanks for mentioning.

 

Now, are you still having issues with some preferences not being saved?


Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#3 Indrid Cold

Indrid Cold

    Harbinger of the Balance

  • Vestrum
  • PipPipPipPipPipPip
  • 3098 posts

Posted 13 February 2015 - 17:12

Hi Morten,

If you're going to update the FAQ I think another command should be added afterwards:

chmod u+rw -R ~/.config

The permission problem may not be who the user is but the user's permissions.



#4 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 17:17

For now I think I'm going to link to this topic from the FAQ, as there already is and maybe will be more in-depth explanation and information regarding the issue and possible solutions here. :)

Thanks for the tips, guys!


Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#5 apocalyptech

apocalyptech

    Rubber Ducky

  • Member
  • Pip
  • 6 posts

Posted 13 February 2015 - 17:18

Thanks for mentioning.

No worries, thanks for updating it!
 

Now, are you still having issues with some preferences not being saved?

Yeah, indeed. It's not a super big deal, 'cause I've just edited the prefs by hand, but basically just the settings I change via the game's settings menus don't actually get saved to the "prefs" file. I assume that I'm not the only one to have this issue, since it's mentioned at that pcgamingwiki.com link, and I'd noticed that FAQ entry via a Steam discussion topic about a similar issue as well. (Definitely enjoying the game, btw!)
 

Hi Morten,
If you're going to update the FAQ I think another command should be added afterwards:

chmod u+a -R ~/.config
The permission problem may not be who the user is but the user's permissions.

Yeah, that'd probably be good too. I suspect that most people with the problem were probably having issues due to accidentally running the game via "sudo" or something, which would cause an ownership issue, but it certainly wouldn't hurt to make sure that the user permission bits are all set, too.

Edit:. Hm, though does "u+a" actually do what you want? I don't think "a" is an acceptable syntax for the permission side, actually. "u+rw" is probably what you'd need there.
  • Morten and Indrid Cold like this

#6 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 17:25

Yeah, indeed. It's not a super big deal, 'cause I've just edited the prefs by hand, but basically just the settings I change via the game's settings menus don't actually get saved to the "prefs" file. I assume that I'm not the only one to have this issue, since it's mentioned at that pcgamingwiki.com link, and I'd noticed that FAQ entry via a Steam discussion topic about a similar issue as well. (Definitely enjoying the game, btw!)

Great to hear you're enjoying the game :D

 

Now, if some preferences are saved, while others are not (if I got that right), that's pretty weird as they're all saved using the same functionality.

However, some values are saved as integers, some as floating point values and some as strings (and some booleans, but I think they're interpreted/saved as integers -- 1 = true, 0 = false).

Can you tell if there are any consistencies/inconsistencies in what value types are saved or not?


Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#7 apocalyptech

apocalyptech

    Rubber Ducky

  • Member
  • Pip
  • 6 posts

Posted 13 February 2015 - 17:44

Now, if some preferences are saved, while others are not (if I got that right), that's pretty weird as they're all saved using the same functionality.

Ah, I must have misspoken accidentally. None of the preferences I choose from inside the game get saved. It's not that some work and some don't - basically the only way I can permanently change any of the settings is by editing the prefs file directly.

So basically the game did write out the default "prefs" file when it first started, but then refuses to write out any updates to the file. I did verify that if I go in, change a setting, and then quit, the timestamp on the prefs file remains unchanged, so it seems that it just doesn't attempt to do the write.

#8 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 17:55

Hmm, yeah ok. Seems like it silently fails to write/update it then.

I'll look into why that is. :)


Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#9 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 18:07

Come to think of it, another user recently mentioned that on Linux, if he quit the game with the "Quit" button on the Title Menu or In-game menu, the preferences would not be saved/written. However, if he quit by pressing the "X"/close icon on the game window (need to be in windowed mode, of course) they were saved properly.

Does this happen for you as well?

 

After a couple of minutes of Googling I found a Unity user saying that on Linux, if the application were to quit unexpectedly the preferences would not be saved correctly. This was also true for using Unity's command for quitting the application, so there may be a bug there for Linux users.

If that is actually the case, we'll try to add some code to safely save the preferences at some point before the application is killed.

 

That said, Unity is a mess with different versions of Linux. Seems to work great with most recent Ubuntu versions, but I have no idea about yours. We've experienced a lot of different stupid stuff happen on Linux that are literally mind-boggling..  :blink:


Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#10 khh

khh

    Harbinger of the Balance

  • Moderator
  • 7117 posts
  • LocationNorway

Posted 13 February 2015 - 18:08

Hmm, yeah ok. Seems like it silently fails to write/update it then.

I'll look into why that is. :)

It appears that, on Linux at least, unity only writes the files when it's closing and not right away. Other people have reported the settings being saved when having the game in windowed mode and closing it with the X in the top right corner, but not when they close the game using the ingame menu option. I would suspect that the files aren't flushed properly after being written to.


April Ryan is my friend,
Every sorrow she can mend.
When I visit her dark realm,
Does it simply overwhelm.


#11 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 18:10

Yeah, that's what just came to my mind; the other reports of closing with the X button.

So yeah, if that is in fact the case, we'll need to add some extra saving in some places (i.e. run "save preferences", wait for it to properly save before sending the code call to kill the application) instead of relying on Unity to do it properly for us. :)


  • khh likes this

Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#12 apocalyptech

apocalyptech

    Rubber Ducky

  • Member
  • Pip
  • 6 posts

Posted 13 February 2015 - 18:36

Huh! So, yes: closing the game via alt-F4 (or, presumably, through closing the window in windowed mode) does, in fact, cause the settings file to be updated properly with settings changes. Interesting!

I suppose it must just be the difference between having some automatic window-destroying handlers being put in place, and having the game say "I'd like to quit now." Anyway, it sounds like having an extra "save preferences" call on quit would probably do the trick.

That said, Unity is a mess with different versions of Linux. Seems to work great with most recent Ubuntu versions, but I have no idea about yours. We've experienced a lot of different stupid stuff happen on Linux that are literally mind-boggling..

Heh, well we do certainly appreciate your support of our strange and sometimes confounding OS. :) It's certainly something of a jungle out there! Hopefully things'll get easier as time goes on.
  • Morten and khh like this

#13 Morten

Morten

    RTG Programmer

  • RTG Staff
  • 1059 posts
  • LocationOslo, Norway

Posted 13 February 2015 - 18:52

Yeah, you are a strange kind indeed :P

Well, good to get a better understanding of the issue. We'll be sure to add some "robustness" to the whole preference-saving stuff and patch it with Book Two. 

Until then, Alt-F4 is your friend, friend! ;)

 

Thanks again for highlighting this, and have a great weekend!


  • khh likes this

Red Thread Games PR0grammer & Naturally Selected Part-Time "Keep Track of Forum"-person / Community Overseer


#14 Indrid Cold

Indrid Cold

    Harbinger of the Balance

  • Vestrum
  • PipPipPipPipPipPip
  • 3098 posts

Posted 13 February 2015 - 19:08

Edit:. Hm, though does "u+a" actually do what you want? I don't think "a" is an acceptable syntax for the permission side, actually. "u+rw" is probably what you'd need there.

Yes, you're totally right. You don't need the x permission (and probably don't want it either). I'll fix the original post, just in case.



#15 Barentity

Barentity

    Fringe Café Regular

  • Member
  • PipPip
  • 108 posts

Posted 13 February 2015 - 21:21

Just tested this myself, Arch Linux 64-bit with the *unpatched* version of the game. The modified timestamp on the prefs file is updated as soon as I change the preferences in game, but the file is only written when I exit the game (from fullscreen, using the game menu). The preferences are saved correctly.

The permissions on the file are 644.



#16 apocalyptech

apocalyptech

    Rubber Ducky

  • Member
  • Pip
  • 6 posts

Posted 13 February 2015 - 22:35

Just tested this myself, Arch Linux 64-bit with the *unpatched* version of the game.

By "unpatched" do you mean the original (non-v1.1.3.0) version?

#17 Balance2112

Balance2112

    Rubber Ducky

  • Vestrum
  • Pip
  • 2 posts

Posted 14 March 2015 - 21:29

Hi, I'm new to this forum!

I have a question: is it possible to obtain the linux version of the config file? I'm asking this because i'm not able to find the config file in the proper folder.

 

Thank You



#18 khh

khh

    Harbinger of the Balance

  • Moderator
  • 7117 posts
  • LocationNorway

Posted 14 March 2015 - 22:05

ShadowNate posted an example config file over here http://redthreadgame...u-1404/?p=72335


  • Balance2112 likes this

April Ryan is my friend,
Every sorrow she can mend.
When I visit her dark realm,
Does it simply overwhelm.


#19 Balance2112

Balance2112

    Rubber Ducky

  • Vestrum
  • Pip
  • 2 posts

Posted 15 March 2015 - 23:44

Ok, Thank you! :)


  • khh likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users