Skip to content

Saving and loading branches inputs in ltm file#711

Open
Perdu wants to merge 6 commits intoclementgallet:masterfrom
Perdu:branch_saving_rebased
Open

Saving and loading branches inputs in ltm file#711
Perdu wants to merge 6 commits intoclementgallet:masterfrom
Perdu:branch_saving_rebased

Conversation

@Perdu
Copy link
Copy Markdown
Contributor

@Perdu Perdu commented Jan 18, 2026

Motivation

Unlike an emulator, libTAS cannot save savestates across sessions. However, inputs of the different branches can be saved inside the ltm file, so they can be shared with others, and not lost when the folder containing backup files is cleaned.

Implementation

  • Upon saving, inputs for all branches are saved in input1..input10 files within the ltm file
  • Instead of loading inputs from backup files, load them from these new files within the ltm file. When doing so, create an actual savestate
  • add a named parameter to MovieFileInputs::load() so we can load a given branch input file
  • Add an error message specific to loading from input files when inputs mismatch

Possible extensions

Future work I'm planning to add to this PR:

  • When earlier inputs mismatch, test existing branches to find one we can rewind to in order to be able load
  • Display a warning and ask for confirmation when overriding an existing branch (although I'm wondering whether it could be too much). Or perhaps just indicate visually which branches from earlier sessions exist and can be loaded

@Perdu
Copy link
Copy Markdown
Contributor Author

Perdu commented Jan 22, 2026

I just saw that this one may still be a bit buggy (not properly saving state in some case I have to identify, leading to a mismatch between registered inputs and game state). Please wait before merging

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.

1 participant