Files installed through debs provided by gog are user writable, for example:
$ ls -l /opt/GOG\ Games/Stargunner/
drwxrwxrwx 2 root root 4096 lip 28 23:29 data
drwxrwxrwx 2 root root 4096 lip 27 02:25 docs
drwxrwxrwx 3 root root 4096 lip 27 02:25 dosbox
-rw-rw-rw- 1 root root 7179 lip 22 19:28 dosbox_stargun.conf
-rw-rw-rw- 1 root root 147 lip 22 19:28 dosbox_stargun_single.conf
-rwxrwxrwx 1 root root 665 lip 22 19:28 start.sh
drwxrwxrwx 2 root root 4096 lip 27 02:25 support
-rwxrwxrwx 1 root root 162 lip 22 19:28 uninstall.sh
And at least DOSbox wrapped ones are storing savegames inside "/opt/GOG Games/..." directory.
So that’s how they did it, I was wondering…
A nice alternative to what I’m doing with my homemade .deb, but not one I’ll adopt: I install everything under /usr/local and don’t like the idea of anything user writable there.
For the curious, here is how it goes for me:
_game data under /usr/local/share/games
_game documentation under /usr/local/share/doc
_icons under /usr/local/share/icons
_menu launchers under /usr/local/share/applications
_launchers (shell scripts calling wine/DOSBox) under /usr/local/games
A fake arborescence is created via symlinks under $HOME/.local/share/games, with only the files that need to be user writable really copied there.
This arborescence include the WINE prefix if needed.
This way, I can install my game on multiple computers, and just copy the arborescence under $HOME/.local/share/games to keep my settings, saves, etc. (only a couple Mb usually)
My method is more complex, but it has an advantage: every setting, as well as saves are user-specific, and you can turn back the game to a "fresh install state" just by removing the user writable fake arborescence (it is recreated by the shell launcher if non-existent).
Another pro is that I can uninstall a game, and by reinstalling it later it will have kept my settings and saves. (the user writable arborescence is not deleted with the game files)