Test Save and Restore step by step
This is a manual test procedure, not a record of tests already passed. Start in one level with manual continuation. Add travel, camera and audio after the basic test works.
1. Prepare a recognizable conversation
Section titled “1. Prepare a recognizable conversation”Create three lines with different text, or a Sequence with three entries. Connect them to a Choice with two responses, then End. For example:
- Anna: “Wait… did you hear that?”
- Player: “Hear what?”
- Anna: “Someone is walking upstairs.”
Configure and bind the main widget before starting the conversation. Keep a reference to the running Dialogue Component; both save and load must use that same component in this first test.
2. Create the SaveGame class
Section titled “2. Create the SaveGame class”- Create a Blueprint Class derived from SaveGame, named SG_DialogueTest.
- Add DialogueState of type Advanced Dialogue Save State.
- Enable its SaveGame flag if using a save system that filters by that flag.
- Compile and save the Blueprint.
Use slot name DialogueTest and User Index 0 consistently. A new test SaveGame object is sufficient here. In a real combined save, preserve inventory/world fields when updating the dialogue snapshot.
3. Make test controls reachable
Section titled “3. Make test controls reachable”Use K for Save and L for Load on your Player Controller, or temporary Save/Load buttons on the dialogue widget.
If the conversation uses Set Input Mode UI Only, Controller/Character key events will not receive normal gameplay input. For the keyboard test, use Game and UI with the dialogue widget focused. Unhandled keys can reach gameplay; keys consumed by the widget cannot.
Keep Ignore Move Input and Ignore Look Input enabled if you want the player stationary. Restore the game’s input policy on dialogue end. Balance ignore-input calls: repeated enabling can require matching disabling calls.
Do not pause the entire game for the initial test. If testing game pause later, configure test input to execute while paused. Dialogue Pause and global game pause are different operations.
4. Wire Save
Section titled “4. Wire Save”- On K/button click, call Capture Dialogue State on the running component.
- Branch on its Return Value.
- On false, print Failure Reason and leave the existing slot untouched.
- On true, create SG_DialogueTest with Create Save Game Object.
- Set DialogueState on that returned object to the captured snapshot.
- Pass the same object to Save Game to Slot, slot DialogueTest, index 0.
- Branch on the save operation’s return value: print “Save OK” or “Disk save failed”.
Capture success only means the snapshot was captured; it is not evidence that writing the slot succeeded. Capture outside dialogue/provider callbacks after a transition has finished.
If your compiled editor presents Capture as a pure node with no execution pins, evaluate it once into temporary result/state/error variables before consuming those outputs in multiple downstream nodes. Pure outputs can be reevaluated when used in different execution steps. Follow the pins in your actual compiled build; the logical flow remains capture → check → assign → save.
5. Wire Load
Section titled “5. Wire Load”- On L/button click, optionally check Does Save Game Exist using DialogueTest/0.
- Load Game from Slot using the same slot and index.
- Check the returned object and cast to SG_DialogueTest. On failure, print “No valid test save” and stop this branch.
- Ensure the widget/providers/Speaker Actor links are configured for the destination component.
- Stop Dialogue explicitly if a conversation is active.
- Call Restore Dialogue State with the loaded DialogueState and Resume Active Dialogue = true.
- Branch on Return Value; print “Restore OK” or Failure Reason.
Do not call Start Dialogue after a successful resume: doing so restarts the graph and defeats the test. Restore can emit presentation immediately, so the widget must already be bound. If your end handler collapsed or removed the widget on Stop, ensure it can present the resumed conversation.
6. Verify the saved line
Section titled “6. Verify the saved line”- Start PIE and begin the conversation.
- Advance to “Hear what?” and press K.
- Confirm “Save OK” appears.
- Advance to a later line or finish the conversation.
- Press L.
Expected: “Hear what?” appears again, not the first line. For a Sequence, the same entry is restored. Typewriter and voice restart that line from its beginning; they do not resume midway through a word or audio clip.
7. Verify progress without reopening dialogue
Section titled “7. Verify progress without reopening dialogue”- Create a Gameplay Tag such as Dialogue.Variable.TestScore.
- Set Dialogue Integer to 10 before capturing and saving.
- Change the component variable to 99.
- Stop the conversation.
- Load with Resume Active Dialogue = false.
- Read Get Dialogue Integer, checking its bool result before printing the value.
Expected: the value is 10 and no conversation opens. The original snapshot can still contain a resumable conversation; the false flag simply does not resume it during this restore.
8. Verify persistence beyond the live component
Section titled “8. Verify persistence beyond the live component”- Save on a recognizable line.
- Stop PIE completely.
- Start a fresh PIE session. Do not overwrite the slot with a new capture.
- Initialize widget, providers and Speaker Actor links again.
- Load DialogueTest/0 and restore with resume enabled.
Expected: the saved line returns even though the previous component instance was destroyed. Repeat in a packaged build before treating this as release validation. A successful same-session test alone does not prove disk persistence.
9. Additional cases
Section titled “9. Additional cases”| Action | Expected result |
|---|---|
| Save on a Choice, select a response, then load | Saved choice is presented; conditions are reevaluated |
| Save during a 10-second Delay after several seconds | Only the remaining wait is resumed |
| Save inside a Sub-Dialogue, resume and complete it | Execution returns to the saved caller’s return point |
| Save while the dialogue is paused | Restored dialogue remains paused until Resume Dialogue |
| Save after an Event, then resume | Previous Event is not replayed just to reach the saved node |
| Call Restore while a dialogue remains active | False result with a reason; explicitly Stop before retrying |
| Load a missing slot | Handle null/cast failure without calling Restore |
| Resume a snapshot whose saved node was deleted in a disposable test asset | False result explaining the missing/changed node |
For the Event test, increment a separate temporary gameplay counter in its handler. Capture after the Event and check loading does not increment it again. Saving that gameplay counter or a physical door’s state is the game’s responsibility, not the dialogue snapshot’s.
10. Add level travel last
Section titled “10. Add level travel last”Keep the loaded SaveGame in the Game Instance or another persistent owner. Load the saved level, restore world state, wait for required Actors/streamed content, link Speaker Actors, assign handlers/providers and bind UI. Only then call Restore with Resume Active Dialogue enabled.
A fixed Delay does not establish readiness. Use the actual completion/ready conditions of your loading system. Save files contain asset references, not live Actor instances, and do not ensure those assets are included in cooking.
Record your result
Section titled “Record your result”Record the engine/plugin build, test case, observed line/value, success/failure messages, and whether the test ran in the same PIE session, a fresh PIE session or a packaged executable. See screenshot requests S16 and S17 for the Blueprint captures to attach to this guide.