libretro / scummvm

ScummVM main repository
https://www.scummvm.org
GNU General Public License v3.0
7 stars 9 forks source link

Associates different game id when loading content from libretro scanner vs core's scanner #25

Closed Schroedingers-Cat closed 1 year ago

Schroedingers-Cat commented 1 year ago

I'm experiencing an issue with the scummvm core (fbac0c28-2.8.0git) associating a different game ID depending on whether the game has been launched from Retroarch's playlist (built by the content scanner) or if it has been launched from the core itself. The game affected by this is Chewy - Escape from F5 German version (chewy-de), but maybe it's not the only one. I'm doing the following steps to reproduce this:

  1. Load the ScummVM core, run the core and add the game to the core's list, which should get the name Chewy: Esc from F5 (DOS/German) with the ID chewy-de
  2. Run the game from the core's list, start a new game and get to the first interactive screen to make a savegame. This should create a file named chewy-de.000, matching the ID of the game as detected by the core's scanner
  3. Close the content and close the core
  4. Use Retroarch's content scanner on the same game's directory, which will add an entry with the label Chewy: Esc from F5 {Chewy: Esc von F5}(DOS/German)
  5. Go to the ScummVM playlist and start the content via the ScummVM core
  6. Get to the first interactive screen and make a savegame. Note how the game doesn't see the savegame created in step 2.
  7. In your file manager, check the new savegame. It should be called chewy.001. Note that the -de is missing while it should be there for the German version.

It seems that the core fails to detect the correct localized version of a game if the content is launched via Retroarch's content scanner.

spleen1981 commented 1 year ago

Retroarch content scanner and ScummVM detection system have nothing to do each other (and are both out of the scope of this core anyways).

My understanding is that in scummvm.ini you will find a chewy-de entry, and you selected manually the german version while adding the game at step 1.

Retroarch content scanner uses a separate database to identify the game titles (as you can see it's slightly different from the one in ScummVM) and adds an entry in retroarch playlist, ignoring what's in scummvm.ini and ScummVM GUI (you can check in the playlist file). Hence when you launch the game from RA playlist, a new automatic detection is attempted each time in ScummVM, in your case maybe falling back to the game default version (probably due to the fact that the manual operation of game version selection is missing now), ending up with chewy.

My suggestion is to handle the playlist file manually using .scummvm files, which can directly refer to the entries in scummvm.ini.

Otherwise the easiest workaround in your case is set in scummvm.ini the same tag found by retroarch scanner, hence find [chewy-de] and change it to [chewy].

Schroedingers-Cat commented 1 year ago

My suggestion is to handle the playlist file manually using .scummvm files, which can directly refer to the entries in scummvm.ini.

I didn't know that the core tries to match the ID written in the game's scummvm file to its own scummvm.ini/launcher list. My core's launcher list was empty, so no matter what ID was in the game's scummvm file, the scummvm core would default to the base ID. Or it would complain about the game content missing (I moved the game at some point and completely forgot that I had to update the launcher list within the core as well). When the ID in the game's scummvm file matches an ID present in the core's launcher list, the game will use the correct ID and look for the correct savegames.

Thanks a lot!

Schroedingers-Cat commented 1 year ago

However, it would be interesting to know why the automatic detection of a game leads to different results when the core looks at the directory itself vs when the core gets the directory handed over from RA.

I think it would be better if the scanning via the core's UI wasn't necessary at all because it means users have to manage two databases, the core's internal and Retroarch's database.

i30817 commented 1 year ago

I missed this issue, but for what it's worth, you can use a program i did. To see how to install it, scroll down the readme until you get to the bottom; it requires python installed and in the path.

Scummvm in retroarch has the 'problem' it requires a extra 'launch file' to identify the game, but you can make that launch file have the 'correct' scummvm.ini game name just by creating the files based on the list in scummvm.ini (which is created when you add games from inside the scummvm GUI). That makes the core launch the right configuration that was scanned.

That's what that program does, it takes a built 'scummvm.ini' and creates a extra launcher file on the game directory, then create a playlist for scummvm in the retroarch playlist directory. It still requires launching scummvm at least once and populating the games in the menu though (also the scummvm scanner is itself, not perfect and in several situations it will cause false positives of games which can't possibly work, so there is still some extra work as those bugs in scummvm are worked out). It will ask you for the location of your retroarch.cfg file if it can't find it on the default paths.