Skip to content

RPG: Delay creation of autosaves and scorepoints to end of turn#1101

Merged
mrimer merged 3 commits intoCaravelGames:masterfrom
Hypexion:rpg/delay-autosave
Apr 5, 2026
Merged

RPG: Delay creation of autosaves and scorepoints to end of turn#1101
mrimer merged 3 commits intoCaravelGames:masterfrom
Hypexion:rpg/delay-autosave

Conversation

@Hypexion
Copy link
Copy Markdown
Collaborator

@Hypexion Hypexion commented Apr 5, 2026

Currently, the CC_Autosave and CC_ScoreCheckpoint commands generate saves (and local highscore entries) at the moment they get processed. It turns out this is not actually a good idea, for a few reasons.

The main reason is that it conflicts with how save validation works. We only validate saves based on the final state of each turn. If a scorepoint is generated, then the player goes on to leave the room (via script command) or dies in some way later in the turn, the save will always fail to validate. Additionally, since the information shown on the scorepoint dialog is also based on the state at the end of the turn, it can lead to the score shown on the dialog and the score saved locally not matching. This can cause confusion.

It's also possible to get a scorepoint from an illegal move this way, as the save will be created before any rewinds due to attempting to stab a monster with DEF higher that the player's ATK. This will also fail to validate, but will create a local highscore record.

For autosaves, you can create a save where the player dies immediately on loading. This is a bit weird. There also appears to be replay issues if an autosave is created on the turn a player goes to another level, which we definitely want to avoid.

I've fixed these problems by delaying the creation of autosaves and scorepoint records to the end of turn processing. Additionally, no records will be created if the player left the room or died.

Thread: https://forum.caravelgames.com/viewtopic.php?TopicID=47322

@mrimer mrimer merged commit bed88d5 into CaravelGames:master Apr 5, 2026
1 check passed
@Hypexion Hypexion deleted the rpg/delay-autosave branch April 5, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants