Kodi Community Forum

Full Version: Unified games system, savestates and savefiles directories
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The system directory is where the BIOS and other important files needed by the Game cores are placed. Currently each addon requires to put the BIOSse on a directory USER_DATA/game.libretro.core_name/resources/system. As discussed in this and subsequent posts with @garbear, this is a design flaw because many BIOSes are shared among cores. With the current implementation this is not possible. The system directory is a property of the libretro frontend, not of the cores.

Another problem is that the savestates are created next to each ROM. ROM directories must not be writable by the libretro frontend (that is, Kodi).

A better implementation is to create the system, savestates and savefiles directories in a special directory in USER_DATA. For example:

Code:
profile://user_data/games/system/ --> system directory
profile://user_data/games/savefiles/core_name/ROM_name
profile://user_data/games/savestates/core_name/ROM_name
profile://user_data/games/info/ --> core info files.

Kodi core is expected to create these directories and use them instead of the current directories. The current implementation works, however it complicates a lot the setup of emulators in Kodi Leia. The proposed implementation is based on Retroarch behaviour, it's more efficient in terms of disk space and easy to set up.

Tested on Debian Linux amd64 architecture with a custom-built Kodi version cloning Github repository (version Leia near-RC1).
I'm always for centralizing and simplifying setups and this request seems to aim to do that!
Currently, there also seams to be a bug when saving the state of a game which is contained in a zip file. Saving the state is working fine when the game is extracted manually. Starting by clicking the zip file and then the game file from within Kodi will result in not persisting the game state. Maybe because the save file can not be written correctly.

The central storage of savegames would solve this issue too.
(2018-12-28, 22:06)BA53 Wrote: [ -> ]Maybe because the save file can not be written correctly.

Correct, I don't think that zip files can be written to using Kodi's VFS (virtual file system) API.
(2018-12-28, 22:06)BA53 Wrote: [ -> ]The central storage of savegames would solve this issue too.

Yes it would. Once upon a time I built a savestate manager, but I dropped it a few years ago because RetroPlayer was such a beast to merge. I hope to write a saved game manager for v19 or v20. What features would you like to see in a saved game manager?

EDIT: Here's the PR for the old savestate manager: https://github.com/xbmc/xbmc/pull/11034

Here's a screenshot of what it used to look like:

Image
Two suggestions, cross-posted from the thread I started at https://forum.kodi.tv/showthread.php?tid=339595 :

1. Make the save-files and save-states directories configurable (i.e. the entire "savestates" directory, not each individual core-level directory)
2. Change the save-file extensions to match those created by cores in RetroArch (e.g. ".srm" for SNES save files)

As I mentioned in the other thread, I would like to be able to share my saves across both my Kodi HTPC and my desktop (which uses RetroArch), and this would make that possible. I imagine others might want to do the same.
Agreed - not trying to sound demanding at all (thanks to EVERYONE for their dedication to Retroplayer), but this would be awesome if possible. It makes sense to make the games library similar to how it's done for videos, wherein the roms would each have their own folders which contain all pertinent files (artwork, NFO, perhaps controller configurationsand in this case, savestates). Obviously there maybe be roadblocks in the implementation of this on the dev side, but I'd say it makes sense to aim for it if at all possible.
Hi,

I use RetroArch or Kodi (Windows) on one PC and Kodi (LibreElec) on another one. It could be great if i could use the same saves files (ingame saves) whatever the device or application i use.

I thought i just had to set RetroArch and RetroPlayer to use rom dir to save ingame saves, but it seems not as easy.

I found and activate RetrArch option "Write saves files in content dir" but don't found a similar setting for Kodi.
Then, it seems that Kodi use ".smc.sav" preffix+extension while RetroArch use just ".srm" extension.

So, is it possible to use same saves files across Kodi and RetroArch ?

Thanks