Save and load results
What this page is for
Section titled “What this page is for”Every save, load, delete and capture answers with a result object. It never throws. You test Ok, and when it is false you read Status and Reason. This page lists the objects, then every status and every problem code.
The results
Section titled “The results”| Object | Comes from | Members you read |
|---|---|---|
SaveResult |
SaveAsync, SaveCurrentAsync, AutosaveAsync |
Ok, Status, Reason, SlotId, Header, Problems, Deferred, Collapsed |
LoadResult |
LoadAsync (inside its LoadOperation), IntrigueSave.State.Restore |
Ok, Status, Reason, Problems, Report, Kind, Reverted, NotReverted |
DeleteResult |
DeleteAsync |
Ok, Status, Reason, SlotId |
SlotList, SlotInfo |
ListAsync |
Ok, Reason, Slots; per slot Id, Status, Reason, Header, CanLoad, IsPartial, IsAutosave, Size, LastWriteUtc |
CaptureResult |
IntrigueSave.State.Capture |
Ok, Status, Data, Problems |
sources: Runtime/Save/Slots/SlotTypes.cs, Runtime/Save/State/SaveResults.cs.
Some details that save you a surprise:
SaveResult.Okis true once the file is on disk, even whenProblemsholds warnings.SaveResult.Deferredis true when the save had to wait for the end of a day’s thinking, or for a scheme node to return. See Saving while a scheme runs.SaveResult.Collapsedis true for an autosave you asked while another one still waited. The two asks make one save.DeleteResult.Okis true forOkand forNotFound. A slot that is not there is gone either way.LoadResult.Okis true when the load went through, even with problems. CheckReport.HasDataLossto see whether a part of the save did not come back.LoadResult.Revertedis true when a load failed and Intrigues put the game back. That does not mean the game is as before:NotRevertedlists what it could not undo.
Reading a load
Section titled “Reading a load”Example, not compiled. It uses only members listed above.
var result = await IntrigueSaveSystem.Instance.LoadAsync("slot1");if (!result.Ok){ Debug.Log(result.Status + ": " + result.Reason); return;}if (result.Report.HasDataLoss) foreach (var problem in result.Problems) Debug.Log(problem); // SaveProblem.ToString(): severity, code and messageThe load report
Section titled “The load report”LoadResult.Report is a LoadReport. The check that runs before the load starts it, and the load adds what it finds.
| Member | What it holds |
|---|---|
Problems |
Every problem, in the order found. |
Drift |
Per kind of definition (clans, families, roles, cultures, policies, schemes, variables, decisions), the IDs only the save holds and the IDs only the database holds. |
Actors, Runs, Visits |
How many actors, running schemes and running nodes the save holds. |
DroppedVisits |
The saved visits whose node the database’s graph no longer has. |
HasDataLoss |
True when a problem of severity DataLoss or Error was found. |
Count(severity), Has(code) |
How many problems of a severity; whether a code was found. |
sources: Runtime/Save/State/SaveResults.cs.
A SaveProblem has a Severity, a stable Code, a Message and sometimes an Id. Test the code, not the message. A code never changes after release.
ProblemSeverity |
Meaning |
|---|---|
Info |
Worth knowing; nothing was lost. |
Warning |
Something may not be what you expect, but the game is complete. |
DataLoss |
A part of the save did not come back. |
Error |
Something failed and the load skipped it. |
Statuses
Section titled “Statuses”The tables below come from the enums in the code. A save status says what the call did. A slot status says what the list found in a file. A capture status says what IntrigueSave.State.Capture did. Storage statuses are on Your own storage.
SaveStatus
Section titled “SaveStatus”| Value | Meaning |
|---|---|
Ok |
The save was written (it may still carry warnings; see the problems). |
RefusedOffHost |
This machine is a multiplayer client: only the host saves. The slot stays as it was. |
NotMainThread |
Asked from another thread than the main thread. The slot stays as it was. |
NoSaveSystem |
There is no Save System in the scene (it runs the slot operations’ work on the main thread). The slot stays as it was. |
InvalidSlot |
The slot’s name is not a valid storage key. The slot stays as it was. |
Busy |
Another slot operation runs and the settings refuse a second one (Refuse). The slot stays as it was. |
LoadRunning |
A load is running (a slot load, or a load across scenes that waits for its actors). The slot stays as it was. |
CaptureFailed |
The game could not be captured (see the reason and the problems). The slot stays as it was. |
EncodeFailed |
The captured game could not be turned into the bytes of a save. The slot stays as it was. |
WriteFailed |
The storage could not write the save; the slot’s earlier save is unchanged. |
NewerSaveInSlot |
The slot holds a save of a newer version of Intrigues and OverwriteNewer was not set. The slot stays as it was. |
AutosaveOff |
Autosave is off (AutosaveSlots is 0). The slot stays as it was. |
Cancelled |
A new game started (or the world cleared) after you asked for the save. The slot stays as it was. |
Stopped |
The Save System was switched off or destroyed while the save waited; a write in flight may or may not have reached the storage. |
InvalidParts |
A partial save (Parts) that cannot be written: no part, an Intrigues key, a part not registered or writing nothing, an autosave or a save to the current slot. The slot stays as it was. |
SecretRefused |
The save holds a secret save part and there is no password for it (SecretProtector), or the password is the one Intrigues ships with. The slot stays as it was. |
InsideNode |
You asked for the save while a node of a scheme ran and that node did not return within the frames a save waits (CaptureInsideNode): saved there, the node would run again on load. The slot stays as it was. |
LoadStatus
Section titled “LoadStatus”| Value | Meaning |
|---|---|
Ok |
Loaded (it may still carry warnings or data loss; see the problems). |
RefusedOffHost |
This machine is a multiplayer client: only the host loads. The game stays as it was. |
NoSaveSystem |
There is no Save System in the scene. The game stays as it was. |
NoData |
No save data was given. The game stays as it was. |
Incomplete |
The save misses lists a game needs. The game stays as it was. |
OldFormat |
The save was written by an older version of Intrigues. The game stays as it was. |
ManagerRefused |
The Intrigue Manager refused the world (no manager, or a client). The game stays as it was. |
Aborted |
The load stopped at the first failing item (Abort); the world is half loaded. |
Failed |
The load threw outside a guarded step; the world may be half built. See the problems. |
Busy |
A save, capture or load is running (you asked from one of its listeners): refused, nothing changed. |
NotMainThread |
Asked from another thread than the main thread: refused, nothing changed. |
AlreadyRestored |
This checked data was restored already; stage it again for another load. The game stays as it was. |
NotFound |
A slot load: nothing is stored under the slot. The game stays as it was. |
ReadFailed |
A slot load: the storage could not read the slot (see the reason). The game stays as it was. |
Damaged |
A slot load: the save is not an Intrigues save, or it is cut off or damaged (see the reason). The game stays as it was. |
PasswordRequired |
A slot load: the save is encrypted and the slot manager has no password for it. The game stays as it was. |
WrongPassword |
A slot load: the save is encrypted and the password does not open it. The game stays as it was. |
NewerFormat |
A slot load: the save was written by a newer version of Intrigues that this version cannot read. The game stays as it was. |
InvalidSlot |
A slot load: the slot’s name is not a valid storage key. The game stays as it was. |
Cancelled |
A slot load: a new game started (or the world cleared) after you asked for the load. The game stays as it was. |
NoScene |
A slot load with FromSave: the save’s header names no scene. The game stays as it was. |
Stopped |
A slot load: the Save System was switched off or destroyed while the load waited. Nothing changed (unless its restore had begun; see the report). |
Unprotected |
A slot load: encrypted saves only are accepted (AcceptUnprotected off) and the save is not encrypted. The game stays as it was. |
Partial |
The save is a partial save (some of your save parts only): it is loaded with RestoreParts or a slot load, never as a whole game. The game stays as it was. |
NoWorld |
A partial load: no Intrigue Manager runs a world to load the parts into. The game stays as it was. |
UnknownPart |
A partial load: the save holds a part this game has not registered (IntrigueSave.Register). The game stays as it was. |
NotPartial |
RestoreParts was given a save that is not a partial save. The game stays as it was. |
Reverted |
The load failed and the game was put back in the same scene as it was before the load (RevertSameScene): the save was not loaded. NotReverted lists what was not undone; the report holds why it failed. |
RevertUnavailable |
You asked for RevertSameScene on a load that cannot be put back: a load across scenes, or the game before the load could not be captured. Other causes: Actor Home World or parked actors, and a load asked inside a node. The load did not start (nothing of the save was loaded). |
DeleteStatus
Section titled “DeleteStatus”| Value | Meaning |
|---|---|
Ok |
The slot (and every copy the storage keeps of it) was removed. |
NotFound |
Nothing was stored under the slot (not a failure: it is gone either way). |
RefusedOffHost |
This machine is a multiplayer client: only the host deletes saves. |
NotMainThread |
Asked from another thread than the main thread. |
NoSaveSystem |
There is no Save System in the scene. |
InvalidSlot |
The slot’s name is not a valid storage key. |
Busy |
Another slot operation runs and the settings refuse a second one. |
Failed |
The storage could not delete the slot. |
Stopped |
The Save System was switched off or destroyed (or the world cleared) while the delete waited; the slot may or may not be gone. |
SlotStatus
Section titled “SlotStatus”| Value | Meaning |
|---|---|
Ok |
The header is whole and this version can load the save. |
Damaged |
The save is cut off or damaged (its frame or header does not check out). It cannot be loaded; a storage that keeps a backup may still load that one (UseBackup). |
NewerFormat |
Written by a newer version of Intrigues that this version can still read: it loads with a warning, and saving over it needs OverwriteNewer. |
NeedsPassword |
The save is encrypted and the slot manager has no password (no protector of its kind, or one that is not ready). |
TooNew |
Written by a newer version of Intrigues that this version cannot read. |
OldFormat |
Written by an older version of Intrigues whose saves this version no longer reads. |
NotASave |
The slot holds something that is not an Intrigues save. |
ReadFailed |
The storage could not read the slot (see Reason). |
Partial |
A partial save (Parts): some of the game’s save parts, no game. Not offered to continue (CanLoad is false); a slot load reads only its parts into the running game. |
CaptureStatus
Section titled “CaptureStatus”| Value | Meaning |
|---|---|
Ok |
The state was captured (it may still carry warnings). |
RefusedOffHost |
This machine is a multiplayer client: only the host’s state is a game’s state. |
WorldFrozen |
A scheme is held by a test run’s trace: a test world is never saved. |
NoManager |
There is no Intrigue Manager. |
Failed |
The capture threw; see the problems. |
Busy |
A save, capture or load is running (you asked from one of its listeners): refused, nothing changed. |
NotMainThread |
Asked from another thread than the main thread: refused, nothing changed. |
InsideNode |
Asked while a scheme’s flow runs (any code that runs while a scheme’s flow runs (a node’s Run, Run Code’s method, a Signal Receiver, a trigger, Changed, scheme-end, actor or accomplice listener)) and InsideNode is Refuse (the default): refused, nothing changed. That node has not returned yet, so its visit would be saved as waiting and a load would run it again (its effect twice). Capture after it returned (the next frame), or save to a slot: a slot save waits on its own until the node returned (CaptureInsideNode). |
Problem codes
Section titled “Problem codes”These are the values of SaveProblem.Code.
| Code | Meaning |
|---|---|
NoData |
No save data was given. |
Incomplete |
The save misses its actor list, its game data or one of the game data’s lists. |
OldFormat |
The save was written by an older version of Intrigues that this version no longer reads. |
NewerFormat |
The save was written by a newer version of Intrigues; the fields this version does not know are dropped. |
DuplicateActorId |
Two saved actors share one ID; the first one is used. |
ActorWithoutId |
A saved actor has no ID and cannot load. |
MissingParent |
A saved actor names a parent the save does not hold. |
MissingClan |
A saved actor names a clan the save does not hold; it loads without a clan. |
MissingFamily |
A saved actor names a family the save does not hold. |
MissingRole |
A saved actor names a role the save does not hold; it loads without that role. |
MissingCulture |
A saved actor, clan or family names a culture the save does not hold. |
MissingOverlord |
A saved clan stands under a clan the save does not hold; it stands alone. |
MissingSpouse |
A saved marriage names an actor the save does not hold. |
OnlyInSave |
The save holds a clan, family, role, culture or policy the database no longer has (it is kept from the save). |
OnlyInDatabase |
The database has a clan, family, role, culture or policy this save does not hold (it is not part of this game). |
SchemeMissing |
A running scheme of the save names a scheme the database no longer has: the run is dropped. |
SchemeGraphMissing |
A running scheme of the save has no graph in the database: the run is dropped. |
SchemeTargetMissing |
A running scheme of the save targets an actor the save does not hold: the run is dropped. |
VisitDropped |
Saved visits of a running scheme name nodes its graph no longer has: those visits are dropped. |
VisitKept |
Saved visits of a running scheme name nodes its graph no longer has: they are kept as saved (On Missing Node: Keep Parked). |
RunEndedForMissingNode |
A restored run waited on nodes its graph no longer has and was ended (Failed) (On Missing Node: End Run). |
DefinitionAddedToGame |
A culture, policy or role of the database was not in the save and was added to the loaded game (New Definitions: Add Missing). |
VisitTypeChanged |
A saved visit waits on a node that is now a node of another kind (same ID): dropped by Resume By Port Then Index, else restored as before. |
VisitPortMissing |
A saved visit was starting the links of an output its node no longer has (by key): it goes on with the saved output number. |
VisitStateIgnored |
A saved visit’s state was left out: its node no longer keeps a state (ISavableNode). |
VisitStateNewer |
A saved visit’s state was written by a newer version of its node and was left out (the visit restores without it). |
VisitStateFailed |
A node threw while it took its saved state back (the visit restores without it). |
VariableDropped |
A saved value of a variable the database no longer has (by ID or name): the value is dropped. |
DefinitionChanged |
Definitions of the database changed after the save was written (their stamps differ; information, a warning for a scheme graph that saved runs wait in). |
DefinitionAdded |
A scheme was added to the database after the save was written (information). |
DefinitionRemoved |
A scheme of the database the save was written with is gone (information). |
DefinitionsNotStamped |
The save carries no definition stamps: definitions were compared by ID only (information). |
StampRulesDiffer |
The save’s definition stamps follow other rules than this version’s and were not compared (information). |
StampsShortened |
The definition stamps did not fit in the save header: one stamp stands for all schemes, or none was written (information; never a failed save). |
SchemeStampsOmitted |
The save holds one stamp for all schemes (see StampsShortened): a change of schemes is seen, not which one (information). |
RestoreOrderPerActor |
Restore Order is After All Actors, but a plain file load restores its actors’ schemes per actor (information). Only the internal file load of the dev tests raises it: slots and RestoreAsync are not plain file loads, so a game never sees this code. |
ActorNotLoaded |
A saved actor did not load (no object for it and nothing that creates one). |
ActorLoadFailed |
An actor threw while it loaded; the load skipped it and the others loaded. |
ActorCreateFailed |
A saved actor could not be created again; the load skipped it and created the others. |
SchemeLoadFailed |
A running scheme threw while it was restored; the load skipped it and restored the others. |
MindLoadFailed |
The mind (calendar, thinking state) threw while it loaded; the load went on. |
MindSaveFailed |
The mind (calendar, thinking state) threw while it was written; the capture has no or a partial mind part. |
ListenerFailed |
A listener of a save event threw; the other listeners were still told. |
DayInProgress |
The capture was taken while a day’s thinking was in progress: the rest of that day does not happen after loading it. |
CaptureFailed |
The capture threw; nothing was captured. |
SaveFailed |
A save of the Save System was not written (the reason is in the message and was logged). |
Aborted |
The load stopped at the first problem (Abort). |
LoadFailed |
The load threw outside a guarded step, or Intrigues refused it after you asked for it; see the message. |
CheckFailed |
The check of the save data threw; the load went on without the rest of the check. |
ActorNeverAppeared |
A load across scenes reached its deadline and this saved actor had not appeared (no object in the scene, nothing created one): it is not in the game. |
RelationsDropped |
A saved actor never appeared: its marriages and parent / child links with actors of the game are not in the game and are dropped from the next save. |
NoSceneLoaded |
A load across scenes waited for a scene that never loaded; it was completed without one. |
ActorWakeFailed |
An actor of a load across scenes threw in its Awake or Start outside the guarded steps (the exception went on as before). |
PartWriteFailed |
A save part (ISavePart) threw while it was written: the save has no section for it. |
PartReadFailed |
A save part threw while it was read (or told its section is absent); the load went on. |
PartNewerVersion |
A save part’s section was written by a newer version of the part than the registered one; it was read as it is. |
PartKeyTaken |
A save part was not written: the save holds an entry with its key already (written by Intrigues or an add-on). |
SaveDeferred |
You asked for a slot save inside a day’s thinking (DeferInsideDay) or while a node of a scheme ran, and it waited for the end of the frame. |
LoadedFromBackup |
A slot load read the storage’s backup of the slot (an older save), not its main copy. |
NotCurrent |
A slot save was written, but a new game started (or the world cleared) while it was written: it is not the current slot. |
PartSecretUnreadable |
A secret save part’s section could not be opened (no or another password, a changed file, or it was not encrypted): a full load treats it as missing (Absent), a partial load does not read it. |
SecretRefused |
A slot save was refused: it holds a secret save part and there is no password for it, or the password is the one Intrigues ships with. |
Reverted |
A load failed and the game was put back as it was before it (RevertSameScene); NotReverted lists what was not undone. |
RevertFailed |
A load failed and putting the game back failed too (RevertSameScene): the game is left as it is, half loaded. |
EmptyEntry |
A list of the save holds an empty entry (null); the load skips it. |
DefinitionWithoutId |
A saved clan, family, culture, policy or role has no ID: it loads, but nothing can name it. |
DuplicateDefinitionId |
Two saved clans, families, cultures, policies or roles share one ID: both load, and whatever names the ID finds the first one. |
UnknownValue |
A saved value of a fixed list (an actor’s gender or life state, a marriage’s state) is one this version does not know; it loads as it is. |
CaptureInsideNode |
You asked for a capture or a slot save while a scheme’s flow ran (any code that runs while a scheme’s flow runs (a node’s Run, Run Code’s method, a Signal Receiver, a trigger, Changed, scheme-end, actor or accomplice listener)): a capture is refused (InsideNode; with InsideNode = Warn it is taken and this is a warning); a slot save of the whole game waits until the node returned, and is refused (InsideNode) only when that does not happen within its frames. Saved there, the node would run again on load (its effect twice). |
How it connects
Section titled “How it connects”- The calls that return these results are in Saving and loading.
- Save and load problems is the lookup page for these statuses and codes, with the storage statuses.
- What the drift lists mean for a changed database: Loading after the database changed.