Opened 5 years ago

Last modified 3 years ago

#11366 new defect

SCUMM/HE: Problem with Savegame Naming on PS Vita and Other Mobile Ports

Reported by: Schnida Owned by:
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Putt-Putt Enters the Race

Description (last modified by Schnida)

System: PS Vita
Version: https://www.scummvm.org/frs/scummvm/2.1.1/scummvm-2.1.1-vita.vpk
The same problem occurs on the latest nightly version (psp2-master-19fe3521)

Game: Putt-Putt Enters the Race (German Version from Steam)

Problem
When I try to save the game with the in-game load and save interface this error pops up: "Failed to load saved game from file: puttrace-de-Töff-Töff.sg1"
I went to the save folder and found a file called "puttrace-de-temp.sgS".

Observations
I tried to save the game on other devices I own. The results are the following:

  • Windows 10 -> Saving works
  • 3DS -> Saving doesn't work (same error)
  • PSP -> Saving doesn't work (same error)

Interestingly, the English version of the game works just fine on every device, which lead me to believe that the umlaut in "Töff-Töff" might be the problem.

Thanks for taking your time. I hope I didn't leave out any important information.

Attachments (3)

puttrace-de-temp.sgS (24.3 KB ) - added by Schnida 5 years ago.
This file is created in the save folder after the error message pops up. It works on Windows when I rename it btw.
scummvmdebug.txt (7.9 KB ) - added by julakali 4 years ago.
image-20220515-210743.png (85.5 KB ) - added by ghostface 3 years ago.

Download all attachments as: .zip

Change History (12)

by Schnida, 5 years ago

Attachment: puttrace-de-temp.sgS added

This file is created in the save folder after the error message pops up. It works on Windows when I rename it btw.

comment:1 by Schnida, 5 years ago

Description: modified (diff)

comment:2 by digitall, 4 years ago

Component: Port: PSP VitaEngine: SCUMM

That error message is from the SCUMM engine when loadState function returns not success:
https://github.com/scummvm/scummvm/blob/master/engines/scumm/scumm.cpp#L2466

The loadState function is here: https://github.com/scummvm/scummvm/blob/master/engines/scumm/saveload.cpp#L320

That should emit a warning if it fails in most cases... Is there one before the error message?

I think the only case where it can return false without a warning is when openSaveFileForReading(slot, compat, filename) fails:
https://github.com/scummvm/scummvm/blob/master/engines/scumm/saveload.cpp#L324

That is defined here where it just calls openForSaving from the _saveFileMan (Save File Manager) which I think is a platform specific singleton:
https://github.com/scummvm/scummvm/blob/master/engines/scumm/saveload.cpp#L155

Hmm I would suspect the issue is either in SaveFileMan when using accented characters or an issue with makeSavefileName i.e.
https://github.com/scummvm/scummvm/blob/master/engines/scumm/saveload.cpp#L595

comment:3 by digitall, 4 years ago

The reporter has also said on the forum post that the problem occurs on:

  • Nintendo DS
  • Nintendo 3DS
  • Nintendo Switch
  • PSP
  • PS Vita

And it doesn't occur on:

  • Windows

comment:4 by digitall, 4 years ago

Summary: Problem with save file on mobile devicesSCUMM: HE: Problem with Savegame Naming on PS Vita and Other Mobile Ports

comment:5 by digitall, 4 years ago

User reports that there are no warnings emitted.

They should try running the game with ./scummvm -d 2 or higher.

The issue looks like it might be from the HE code here... as nowhere else would allow .sg1 in the savegame suffix:
https://github.com/scummvm/scummvm/blob/master/engines/scumm/he/script_v60he.cpp#L172

by julakali, 4 years ago

Attachment: scummvmdebug.txt added

comment:6 by julakali, 4 years ago

I'm currently playing the german version of "Putt Putt Enters the Race", bought from Steam, via ScummVM on Mac.
I have exactly the same Problem and as the original author I suspect the umlauts are the problem cause here.
I'll attach a log running scummvm -d 2.
I guess the relevant message ist this:

DEBUG: Couldn't open file *\T�ff-T�ff.sg0 for Writing in Write-The-Catalog

I was running scummvm from within iterm2 which i guess can usually display utf8 characters.

Version 0, edited 4 years ago by julakali (next)

comment:7 by sev-, 3 years ago

Summary: SCUMM: HE: Problem with Savegame Naming on PS Vita and Other Mobile PortsSCUMM/HE: Problem with Savegame Naming on PS Vita and Other Mobile Ports

by ghostface, 3 years ago

Attachment: image-20220515-210743.png added

comment:8 by ghostface, 3 years ago

Same issue occurs on android.
The Steam Version of Putt-Putt Enters the Race works fine on the Steamdeck tho.

I did notice however while browsing the local savegame files from the steam version that the umlaut in the filename isn't correctly utf-8 encoded, it's broken.
In the attached screenshot you can see the broken german saves, 2 english saves (without umlauts) and a .dummy file manually created with the ö umlaut.


comment:9 by ghostface, 3 years ago

I looked into it some more, the problem is the umlauts in savegame filenames appear to be encoded as ISO-8859-1.

So ö becomes \366 which causes the issue on the mentioned systems (android,switch,psp etc.)

For reference (autocomplete from linux utf-8 terminal):

puttrace-T$'\366'ff-T$'\366'ff.sg0

Note: See TracTickets for help on using tickets.