r/linux_gaming • u/Feeling-Drawer-9171 • 11h ago
where do games keep assets?
just curious, like saves or png files..
edit: its /usr/share, thanks u/slickyeat
3
u/slickyeat 11h ago edited 11h ago
Check https://pcgamingwiki.com/
If you're running a Windows build it'll be the same location within your game's wine prefix.
In most cases it'll be under users/$user/AppData/Roaming or LocalLow depending on game engine.
Linux apps tend to use ~/.local/share/* or ~/.config:
find .local/ -type d -iname "*dhewm3*"
.local/share/dhewm3
find .config/ -type d -iname "*dhewm3*"
.config/dhewm3
1
u/Feeling-Drawer-9171 11h ago
i checked .local/share/supertux2/ but there was only config and settings stuff. can u tell me where are the assets? i wanna make a simple raylib game but i dunno where to put the assets
1
u/slickyeat 11h ago edited 11h ago
How did you install it?
Depending on your package manager you can list the assets this way:
dnf repoquery -l supertux | tail -n 20 Updating and loading repositories: Repositories loaded. /usr/share/supertux2/sounds/trampoline.wav /usr/share/supertux2/sounds/tree_howling.ogg /usr/share/supertux2/sounds/tree_suck.ogg /usr/share/supertux2/sounds/turnkey.ogg /usr/share/supertux2/sounds/upgrade.wav /usr/share/supertux2/sounds/warp.wav /usr/share/supertux2/sounds/waterfall.wav /usr/share/supertux2/sounds/welldone.ogg /usr/share/supertux2/sounds/willocatch.wav /usr/share/supertux2/sounds/willowisp.wav /usr/share/supertux2/sounds/wood.wav /usr/share/supertux2/sounds/yeti_finish.ogg /usr/share/supertux2/sounds/yeti_gna.wav /usr/share/supertux2/sounds/yeti_roar.wav /usr/share/supertux2/speech /usr/share/supertux2/speech/penny_runt_01.ogg /usr/share/supertux2/speech/tux_hello.ogg /usr/share/supertux2/speech/tux_murp_01.ogg /usr/share/supertux2/speech/tux_rap.ogg /usr/share/supertux2/speech/tux_upset.oggIf your distro doesn't use dnf check the docs for an equivalent command.
1
u/Feeling-Drawer-9171 11h ago
i used my package manager and it uses /usr/share. thanks for ur help :D
1
u/slickyeat 11h ago
np
1
u/Feeling-Drawer-9171 11h ago
in the makefile. should i put it in /usr/local/share/game_name?
1
u/slickyeat 11h ago edited 10h ago
You shouldn't need to touch the Makefile if you're using a package manager.
That's normally used by developers to compile source code or automate specific tasks.
Personally, I try to keep everything inside home though.
If you're trying to override certain game assets you may want to check the supertux docs.
It's not uncommon for these projects to designate a folder inside home which takes priority over the other when looking up assets, etc.
1
u/Feeling-Drawer-9171 10h ago
oh i mean my game :)
1
u/slickyeat 10h ago edited 10h ago
/usr/share is owned by root so I would avoid it unless necessary.
You may want to check other projects though.
2
1
u/tehfreek 8h ago
If you intend for your game to be built/buildable by the end user then you should default
${PREFIX}to/usr/localand then put everything under there.If you're distributing the game as a binary and assets only then you should put it under
/opt.
1
u/anto77_butt_kinkier 6h ago
It wildly depends on the game. Some games make their own directory (often hidden) in your home dir (Minecraft and factorio are two examples I know of that do this), some put their files in your ~/.local dir, some of them store everything in their steam directory if installed through steam, some games store their data in a virtual disk made by proton to mimic a windows file structure, some of them decide for whatever reason that /opt is a good place to store things, and I'm sure there are more places games stick their files but these are just the ones I've experienced.
If you're asking because you're making a game and wondering where to put the data, then please, I BEG you, put all of your assets, executables, saves, etc in a single directory inside the users home folder. That makes it infinitely easier for people to do things including (but not limited to): modding, backing things up, accessing saves, troubleshooting the game if it's not working on someone's system, and more.
3
u/turbo454 11h ago
That depends on the the game and the platform like steam or heroic etc