New Save Game location on Linux

2 posts / 0 new
Last post
New Save Game location on Linux

With the desktop version of the NEO Scavenger moving over to the Haxe-based engine, I thought it would be the best opportunity to suggest where save games could be located on Linux. I hope it is not too late to implement.

The XDG Base Directory specification is a guide to where applications should place their data.

So instead of $HOME/.NEOScavenger it would be:

$XDG_DATA_HOME/NEOScavenger/ or $HOME/.local/share/NEOScavenger/ if $XDG_DATA_HOME is undefined.

So why do this?

Applications that follow the spec are easier to backup. Data migration is easier. Cache is separated, and the $HOME folder isn't polluted with hundreds of program files everywhere (like the Document folders on Windows).

Windows & Mac have similar specifications also.

Thanks for the tip! I'll have to look into this to see what's involved. I know Tiago setup the save system to request the user data folder, so it's up to the OS to decide where that is.

And looking at the repo, this older issue seems to roughly outline the codepath it uses to determine that directory:

This might not be the exact branch in my local repo, but it's probably close:

and specifically, for Unix:

which seems to prefer XDG_DATA_HOME for the prefs path.

Ultimately, I'll have to test it on a Linux box to see, though.

Dan Fedor - Founder, Blue Bottle Games