soulsmods / ModEngine2

Runtime injection library for modding Souls games. WIP
MIT License
851 stars 151 forks source link

ModEngine2 can't access to game's save files under Linux. #196

Open Eriikat opened 4 months ago

Eriikat commented 4 months ago

Hi, im a Linux user and i was having difficulties making ModEngine2 load properly my Elden Ring save files. This happens because in Windows, save files path is under users\AppData\Roaming\EldenRing and it doesn't matter how you launch the game, if it's through Elden Ring's executable or ModEngine2 the path will be the same for both binaries. In Linux it works different.

ModEngine2 has it's own AppID folder inside ~./local/share/Steam/steamapps/compatdata/. In my case, this folder is named 3129522011, while Elden Ring AppID folder is 1245620. This forces ModEngine2's to follow it's own AppID path to search for save files and overrides Elden Ring's default path (1245620), so it will never be able to read my already existing save files since the path it takes ModEngine2 is different.

This has a very easy fix with a symlink. Just open a terminal and navigate towards the path of ModEngine2 Elden Ring save files directory: cd /home/$USER/.local/share/Steam/steamapps/compatdata/$MODENGINE2APPIDFOLDER/pfx/drive_c/users/steamuser/AppData/Roaming

Where $USER is you own user personal directory and $MODENGINE2APPIDFOLDER is your ModEngine2 directory. Im not sure if Steam assigns the same name to every ModEngine2 directory out there, you'll have to find yours. Check for a very long string of numbers. If its the same, then the name will be 3129522011.

If you write ls command you should see EldenRing and Microsoft directories. EldenRing folder contains another folder inside called 76561197995568315 (Where your saved game are stored) and GraphicsConfig.xml. You need to delete this EldenRing folder. Don't worry, because your graphics setting will be read from your actual save game's folder and there's no save files stored. Execute rm -r EldenRing and the folder will disappear.

To create the symlink for your actual save files, you'll have to write the command: ln -s /home/$USER/.local/share/Steam/steamapps/compatdata/1245620/pfx/drive_c/users/steamuser/AppData/Roaming/EldenRing EldenRing

This creates a soft-link that aims towards your real save files and graphics settings and leaves a symlink called EldenRing, exactly as the original folder's name. From now on, when you execute ModEngine2 through steam it will read your actual Elden Ring's save files and it doesn't matter if you play with or without ModEngine2, you'll see progress in both instances since the folder that is being read and modify with new saved data is from Elden Ring's default path and not ModEngine2 specific folder.

I have not tried this with Dark Souls 3 or Armored Core 6, but i'd bet the same fix will apply for both, you just need to change the symlink command path, instead 1245620 folder, you need to write 374320 for Dark Souls 3 and replace EldenRing name folders for DarkSoulsIII instead.

For Armored Core 6 will probably be the exact same thing. The AppID folder is 1888160 in this case and the folder's name to edit will be ArmoredCore6.

TL:DR: ModEngine2 for Steam is treated a different game from Elden Ring, Dark Souls 3 or Armored Core 6 and it's treated as a game with it's own files. To make ModEngine access your save files it's easier to create Linux equivalent of Windows Direct Access rather then doing any other weird stuff so your saved data will be the same both using ModEngine2 or FromSoftware launchers.

ConorVernon commented 1 month ago

An alternative to symlinking is using the STEAM_COMPAT_DATA_PATH variable instead. This can tell a non-steam app to use an existing proton prefix.

e.g. in the Steam launch options: STEAM_COMPAT_DATA_PATH=~/.steam/debian-installation/steamapps/compatdata/1245620/ %command%

This will tell it to use the same prefix as Elden Ring (with its appid of 1245620), allowing it to access the same savedata.