[BUG][PLAYER] "An error occurred while trying to save data"

Started by WillLem, March 22, 2020, 04:50:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

WillLem

Not sure what I've done wrong, but I'm seeing this in between almost every level load, and at other random times as well.

namida

Do you:
a) have multiple instances of NeoLemmix running at once?
b) have any of the files in the "settings" folder open in another app (such as a text editor)?
c) have your NeoLemmix folder anywhere it'd be automatically backed up?
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

WillLem

Quote from: namida on March 22, 2020, 06:15:32 AM
c) have your NeoLemmix folder anywhere it'd be automatically backed up?

This one: my desktop gets automatically backed up to my GDrive, and the NeoLemmix folder is on the desktop. I'm guessing I should move it?

But, I like that it automatically gets backed up tbh... I guess I can put up with the odd error message. It's not all that frequent, actually. And it usually happens more when I've changed something (for example, added a new levelpack or moved stuff around within NL's folders), so this would explain it.

namida

Okay, so - this is likely happening because GDrive is trying to back up the config file, at the same time as NL is trying to save it. NL saves the configuration (and progress) every time you move between screens, as well as upon exiting.

My initial thought here:
- When transitioning between screens, if the files can't be saved, fail silently (ie: just accept that saving failed, and continue without saving, without displaying an error)
- When exiting NeoLemmix, if the files can't be saved, either wait a short time and try again (a few seconds), or save to an alternate filename and alert the user

Perhaps also, some tracking of if the contents have changed (or at least if they've potentially changed; eg. simply check "has the user opened the config dialog since the last time settings were saved?").
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

Proxima

I asked namida in discord to bump this. I've been having this problem now that I'm on a Windows 10 machine with OneDrive, and namida thinks it might be possible to fix.

WillLem

This only ever happens when GDrive is running. If I pause syncing (or if it's otherwise inactive), it doesn't happen. GDrive also interferes with a number of other processes, like saving or loading levels which are currently being synced.

namida

Quote from: Proxima on January 14, 2022, 09:07:22 PM
I asked namida in discord to bump this. I've been having this problem now that I'm on a Windows 10 machine with OneDrive, and namida thinks it might be possible to fix.

Not so much fix per se, but rather, possible to implement workarounds for, based on either (a) just accepting failure silently in cases where saving is not critical, and (b) in cases where it is critical (or at least as close to that as saving your settings in a Lemmings clone comes :P ), respond to failure by waiting a short time then trying again, raising an error message only in the case of repeated failure (after perhaps 3 attempts).
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)

namida

Commit 5821a2a implements a changed behavior in the case of failure to save settings.

The new behavior is that there are three "criticality" states for saving user data - "none", "important" and "critical". Most cases of saving data are set to "none". After using the configuration menu, "important" is set, and when exiting NeoLemmix, "critical" is set.

When the state is "none", if saving fails, NeoLemmix waits 50ms and tries again. If this too fails, NeoLemmix silently continues, but sets a flag so that the next save attempt will be (at least) handled as "important".

When the state is "important", NeoLemmix will make up to 5 attempts to save (again seperated by 50ms). Much like above, failure involves silent continuing, and the next save attempt will be handled as "critical" no matter what.

Only if the state is "critical", and 10 failed attempts occur, at this point an error message will be displayed. I'm considering also attempting to save the new configuration / save data to a new file in this case, which a user could then manually replace the actual ones with.
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)