Repository navigation
Description
Support for detecting Steam games is being done as part of #1893, but aside from that all game installs need to be manually configured.
There are two aspects of game detection, detecting install paths and detecting local data paths.
For install paths:
- GOG game install paths are detected by looking up Registry entries, which obviously doesn't work on Linux.
- Microsoft Store game install paths are found by scanning drive roots for
.GamingRootfiles to find MS Store library locations. This could be done on Linux by scanning mount points instead. Older MS Store installs are found by looking them up in the Registry. - Epic Games Store game install paths are found by looking up a Registry entry to find where EGS stores its manifest files. If that fails, LOOT falls back to using a Windows API to guess EGS's program data path.
For local data paths, all three game sources have the same problem: there's no obvious way to detect what the correct path is. It can be done for Steam because Steam provides a native Linux application that manages the local data paths, so they exist at consistent, guessable locations. GOG, MSS and EGS don't provide native game launchers / managers.
That said, there are native third-party launchers/managers that might manage games' local data paths. Those I've heard of are:
- Lutris (EGS, GOG) - available as a Flatpak
- Heroic Games Launcher (EGS, GOG) - available as a Flatpak and AppImage
- Legendary (EGS) - CLI, used by Heroic Games Launcher
- Minigalaxy (GOG) - not available as a Flatpak or AppImage
- GameHub (Steam, GOG) - not seen any updates in over a year, warns that AppImage and Flatpak are unstable.
- Bottles - available as a Flatpak. Not a launcher, but more of a Wine prefix manager that allows you to install Windows launchers and use them through Wine.
From searching around, Heroic seems to be most commonly recommended, followed by Lutris, and I saw a few mentions of Bottles. However, with Bottles being a Wine prefix manager, I don't think it would be possible to detect games installed through it, because they'd actually be installed through launchers/managers running in Wine, so you'd need to have LOOT interface with the Wine prefixes to do game detection like it does on Windows.
MSS games don't seem to be available on Linux at all (no surprise there), so I think the only way a user would end up trying to play one would be if they had a Windows drive mounted. If that's the case then LOOT could potentially look for Windows user directories on the same drive to see if any had an existing local app data path, and detection could just fail if none is found. However, if there's more than one user with such data then LOOT could end up picking the wrong path, which wouldn't necessarily be obvious to the user.
Activity
Ortham commentedon Aug 24, 2023
I've installed Lutris and Heroic Games Launcher as Flatpak applications and had a play around with them, and here are some notes I've made:
HGL
filesystems=xdg-data/Steam;/mnt;~/.var/app/com.valvesoftware.Steam;/run/udev:ro;/run/media;~/Downloads/Heroic-secondary:create;xdg-data/applications;xdg-documents;xdg-data/lutris;~/Games/Heroic:create;xdg-desktop;xdg-run/app/com.discordapp.Discord:create;~/.steam;~/Games/Heroicdirectory that it has permissions for by default, and if you try to install a game elsewhere it will detect and warn when it doesn't have permission for that path.~/Games/Heroic/Oblivion, its Plugins.txt is at~/Games/Heroic/Prefixes/default/pfx/drive_c/users/steamuser/AppData/Local/Oblivion/Plugins.txt.~/.var/app/com.heroicgameslauncher.hgl/.config/heroic/gog_store/installed.jsonfile that has an object containing an array of installed games with theirinstapp_pathandappName. Those appnames appear inconfig/heroic/GamesConfig/<appname>.jsonfilenames, and those files have awinePrefixthat match the wineprefix configured in HGL.config/heroic/legendaryConfig/legendary/manifests/installed.jsonfile that has an object with keys that are EGS app names (e.g.adeae8bbfc94427db57c7dfecce3f1d4for FO3), and each of those keys has an object value with aninstall_pathkey. Like for GOG, there's aconfig/heroic/GamesConfig/<appname>.jsonfile that has the wine prefix.So finding games installed by HGL should be pretty straightforwards:
gog_store/installed.jsonand search itsinstalledarray for objects withappNamekeys that have values that match a supported GOG game ID. For each that does, take the same object'sinstall_pathkey's value as the game's install path.legendaryConfig/legendary/manifests/installed.json. Check the object for a key equal to the app name of a supported game, and for each match get the game's install path from the corresponding object'sinstall_pathkey's value.GamesConfig/<game ID / app name>.json. It holds and object with a key that's the game ID and a value that's an object. Read thewinePrefixkey's value, and appendpfx/drive_c/users/steamuser/AppData/Local/<game local folder>to it to get the game's local path.Lutris
filesystems=home;/media;/run/media;~/.var/app/com.valvesoftware.Steam:ro;xdg-data/flatpak:ro;~/Downloads/EGS, and the install path was~/Downloads/EGS/fallout3/Fallout 3 GOTY English/. It looks like the Wine prefix is the same one that EGS uses, withplugins.txtat/home/oliver/Games/epic-games-store/drive_c/users/oliver/AppData/Local/Fallout3/plugins.txt.~/Games/gog/the-elder-scrolls-iv-oblivion-game-of-the-year-edition-deluxe/drive_c/GOG Games/Oblivion, with Plugins.txt at~/Games/gog/the-elder-scrolls-iv-oblivion-game-of-the-year-edition-deluxe/drive_c/users/oliver/AppData/Local/Oblivion/. Note that the username in the latter path is notsteamuser, instead it seems to have been taken from my linux config, it's the same value as$USER.~/Documents/My Games/Oblivion/Oblivion.ini... It's not a symlink: instead, the user subdirectories in~/Games/gog/the-elder-scrolls-iv-oblivion-game-of-the-year-edition-deluxe/drive_c/users/oliverare symlinks to my Linux user directories:~/Games/gogfolder, and its install path is~/Games/gog/fallout-3-game-of-the-year-edition/drive_c/GOG Games/Fallout 3/.~/.wineWine prefix, but it doesn't seem to be used by anything.~/.var/app/net.lutris.Lutris. It looks like there's aconfig/lutris/gamesdirectory that contains*.ymlfiles, one per installed application, e.g.elder_scrolls_iv_oblivion_game_of_the_year_edition_deluxe_the_game-1692874648.yml,epic-games-store-standard-1692874859.ymlandfallout_3_game_of_the_year_edition_game-1693071206.yml(there's not one for FO3 installed from EGS, presumably because that was done through the EGL and so Lutris wasn't really involved).game.exefield that could be used to get the install path, though for Oblivion and Fallout 3 it's an absolute path, while for EGS it's relative togame.prefix, which is the Wine prefix. While the local path is in the same directory tree by default, it is possible to set a different Wine prefix, and if I set it to/home/oliver/Games/Heroic/Prefixes/defaultand then save the config and run the game, the launcher appears but most options are greyed out (because it can't find the game?). There is nowine.prefixfor the GOG FO3 install, probably because I didn't customise it.serviceproperty in the YAML files that isgogand aservice_idproperty that is the game's GOG game ID. The EGS YAML file doesn't have those properties.So, to detect GOG games installed through Lutris:
*.ymlfiles in$XDG_CONFIG_HOME/lutris/gamesand~/.var/app/net.lutris.Lutris/config/games. For each YAML file found, parse it and check if it containsservice: gog. If so, check ifservice_idis set to a supported GOG game ID. If it is, readgame.exe: for Oblivion and FO3 it's the launcher executable's absolute path, so the game install path is that path's parent directory.drive_c, and then the local app data folder is atdrive_c/users/<linux user?>/AppData/Local/<game folder>.This would need yaml-cpp to be built and linked as part of LOOT's build process so that the YAML files could be parsed.
I guess detecting EGS games installed through Lutris would be similar. I don't think there's a good way to detect EGS games installed through the EGS that Lutris installs, as that happens inside Wine. You could find the Wine prefix from Lutris's game YAML file for EGS, and from there you could either interface with Wine to do the same detection that LOOT does on Windows, or you could guess the default location of the manifests (which is correct on my install), but then the manifest contains a Windows path which would need to be mapped to a Linux path:
Z:\seems to be the mount point for Linux's root/.Lutris definitely seems more customisable and supports many more sources than HGL, but the UX is relatively unpolished, it seems buggier, and it's making a mess of my home directory with those symlinks. Based on my short experience, I definitely prefer HGL over Lutris for managing EGS and GOG games. Maybe I'll come back to Lutris after v0.5.14 is released.
Ortham commentedon Aug 25, 2023
I've implemented support for detecting GOG and EGS games installed through Heroic Games Launcher in 499552e.
Ortham commentedon Oct 20, 2023
Lutris 0.5.14 was released, so I tried it again:
flatpak --user install flathub org.gnome.Platform.Compat.i386//45to fix an error on startup after runningflatpak run net.lutris.Lutris.Steam
The Steam integration just prompts Steam to download and install the game when you first try to play it after "installing" it through Lutris, so it'll get picked up by LOOT's existing Steam support.
GOG
Z:\GOG Games\Oblivion, but that could be changed.C:\GOG Games\Oblivion. With that it installs properly.EGS
I wasn't able to get as far as before with GOG or EGS. The EGS issue seems to be because the install script relies on archive.org as a mirror for some files (which doesn't seem like the best idea), and from searches it seems like it can be a bit flaky. I didn't notice the DXVK error last time I tried running Oblivion, so it seems to be failing for a different reason now, but I'm not sure that's progress.
375gnu commentedon Dec 22, 2023
Can I help providing required information? I have both TES 4 & 5 installed.
Ortham commentedon Dec 23, 2023
@375gnu How have you installed them, and what store are they from?
375gnu commentedon Dec 23, 2023
They both are from GOG, installed using Lutris (it itself was installed from native Debian package, not Flatpak).
Ortham commentedon Dec 24, 2023
@375gnu Can you share your
elder_scrolls_iv_oblivion_game_of_the_year_edition_deluxe_the_game-1692874648.ymlfile? I think it'll be in~/.config/lutris/games, and it might have a slightly different filename.375gnu commentedon Dec 24, 2023
Note that long lines are split, this is an my artifacts.
Ortham commentedon Dec 28, 2023
@375gnu is the
redactedusername in/home/redacted/Games/gog/the-elder-scrolls-iv-oblivion-game-of-the-year-edition-deluxe/drive_c/GOG Games/Oblivion/OblivionLauncher.exethe same as the<user>in/home/redacted/Games/gog/the-elder-scrolls-iv-oblivion-game-of-the-year-edition-deluxe/drive_c/users/<user>/AppData/Local/Oblivion?375gnu commentedon Dec 28, 2023
@Ortham yes, it's the same.