some sav files are stored in ~/.s25rttr/MAPS/
I just had a look into the dir where the userdata is stored, which under linux is .s25rttr in /home/user/ ; to delete old logs and reviews mostly - and I noticed a lot of *.sav files in the MAPS folder:
cd ~/.s25rttr/MAPS/
ls -ls | grep sav
336 -rw-r--r-- 1 user user 340003 30. Apr 2023 attacke.sav
52 -rw-r--r-- 1 user user 52033 25. Mär 2023 1.sav
304 -rw-r--r-- 1 user user 309288 26. Mär 2023 123.sav
96 -rw-r--r-- 1 user user 96982 20. Nov 08:52 2.sav
64 -rw-r--r-- 1 user user 61874 16. Jun 2024 222.sav
60 -rw-r--r-- 1 user user 59075 16. Jun 2024 2222222.sav
64 -rw-r--r-- 1 user user 62145 16. Jun 2024 2222222222.sav
120 -rw-r--r-- 1 user user 119924 20. Nov 12:39 3.sav
56 -rw-r--r-- 1 user user 53844 15. Jun 2024 33.sav
64 -rw-r--r-- 1 user user 63540 16. Jun 2024 333.sav
132 -rw-r--r-- 1 user user 131674 20. Nov 12:58 4.sav
124 -rw-r--r-- 1 user user 122967 19. Nov 16:33 7.sav
380 -rw-r--r-- 1 user user 386765 28. Mär 2023 Archipelag Sumary (Automatisches Speichern).sav
380 -rw-r--r-- 1 user user 386765 28. Mär 2023 Archipelag_Sumary__Automatisches_Speichern_.sav
92 -rw-r--r-- 1 user user 90614 15. Nov 09:26 Australien (Automatisches Speichern).sav
92 -rw-r--r-- 1 user user 90614 15. Nov 09:26 Australien__Automatisches_Speichern_.sav
344 -rw-r--r-- 1 user user 348259 1. Mai 2023 Europa (Automatisches Speichern).sav
344 -rw-r--r-- 1 user user 348259 1. Mai 2023 Europa__Automatisches_Speichern_.sav
132 -rw-r--r-- 1 user user 134394 20. Nov 14:41 Glueck.sav
52 -rw-r--r-- 1 user user 49844 9. Okt 14:28 Japan (Automatisches Speichern).sav
52 -rw-r--r-- 1 user user 49844 9. Okt 14:28 Japan__Automatisches_Speichern_.sav
548 -rw-r--r-- 1 user user 557153 29. Nov 09:46 Migration (Automatisches Speichern).sav
548 -rw-r--r-- 1 user user 557153 29. Nov 09:46 Migration__Automatisches_Speichern_.sav
116 -rw-r--r-- 1 user user 117373 20. Nov 10:24 Nordasien (Automatisches Speichern).sav
116 -rw-r--r-- 1 user user 117373 20. Nov 10:24 Nordasien__Automatisches_Speichern_.sav
88 -rw-r--r-- 1 user user 87251 8. Nov 2023 Totes Land (Automatisches Speichern).sav
88 -rw-r--r-- 1 user user 87251 8. Nov 2023 Totes_Land__Automatisches_Speichern_.sav
144 -rw-r--r-- 1 user user 145593 18. Jun 2024 V - Im Ödland (Automatisches Speichern).sav
144 -rw-r--r-- 1 user user 145593 18. Jun 2024 V_-_Im___dland__Automatisches_Speichern_.sav
68 -rw-r--r-- 1 user user 68681 18. Okt 12:42 Weihnachtsinseln (Automatisches Speichern).sav
68 -rw-r--r-- 1 user user 68681 25. Feb 2025 Weihnachtsinseln__Automatisches_Speichern_.sav
336 -rw-r--r-- 1 user user 340003 30. Apr 2023 _attacke.sav
516 -rw-r--r-- 1 user user 527733 25. Nov 19:41 attacke.sav
208 -rw-r--r-- 1 user user 212796 26. Mär 2023 der Beginn.sav
208 -rw-r--r-- 1 user user 212796 26. Mär 2023 der__Beginn.sav
132 -rw-r--r-- 1 user user 134721 24. Nov 07:41 overun.sav
520 -rw-r--r-- 1 user user 532097 30. Nov 08:28 sav
336 -rw-r--r-- 1 user user 341720 26. Mär 2023 testrun.sav
most are very old, but you can recreate them all by loading an older save game - it seems the game does copy the save file from ~/.s25rttr/SAVE/ into ~/.s25rttr/MAPS/ - but then it never cleans this up after leaving the game session.
also there is rttrGameData.raw created in /tmp/ and never cleaned up after leaving the session, but that seems normal to me, since that is what /tmp/ is for.
Yes, rttrGameData.raw should be deleted (I don't think we have a "caching" mechanism for that or is even necessary to cache that file or so. It would be better when the file would have an unique name "per run" (e.g by adding the pid to it or similar) so multiple instances do not overwrite the file. Note: that file only exists on debug builds. I assume you compiled the game yourself as Debug version?
The second thing with the .sav files. Yes thats a bit "ugly". "Joining"/Loading a map will save a copy of the map in the MAPS folder - kind of "Played Maps". Currently its also doing that for savegames (and not only the map part of it). That behavior should probably be fixed/optimized
Yes, rttrGameData.raw should be deleted
It is intentionally not so it can be inspected in debug mode, e.g. after crashes:
https://github.com/Return-To-The-Roots/s25client/blob/a8dc3da9ad2a8df96b7429512e66db5cbb117b82/libs/s25main/Savegame.cpp#L124-L129
The second thing with the .sav files. Yes thats a bit "ugly". "Joining"/Loading a map will save a copy of the map in the MAPS folder - kind of "Played Maps". Currently its also doing that for savegames (and not only the map part of it). That behavior should probably be fixed/optimized
Yeah we could likely look into the SAVE folder and omit the copy. We'd just need to be careful with multi-player save games.
I do agree though we shouldn't copy/downlaod savegames to MAPS, but where else (for the multiplayer case)?
I do agree though we shouldn't copy/downlaod savegames to MAPS, but where else (for the multiplayer case)?
maybe some temporary?