diff --git a/AGRARIAN_DEVELOPMENT_ROADMAP.md b/AGRARIAN_DEVELOPMENT_ROADMAP.md index 1382e37..5163ee6 100644 --- a/AGRARIAN_DEVELOPMENT_ROADMAP.md +++ b/AGRARIAN_DEVELOPMENT_ROADMAP.md @@ -741,7 +741,11 @@ Target deliverable: A small group can join a server, spawn into one biome, gathe `FAgrarianSavedPlayer::Survival`, including health, stamina, exhaustion, hunger, thirst, body temperature, injury, bleeding, sprain, sickness, death state, and death reason, then restore through `ApplySavedState`. -- [ ] Save long-term character care history placeholders without applying aging gameplay yet. +- [x] Save long-term character care history placeholders without applying + aging gameplay yet. Player saves now persist `FAgrarianSavedPlayer::CareHistory` + for nutrition, illness, injury, sleep, shelter, stress, workload, and + treatment quality placeholders, while aging/generational effects remain + deferred. - [ ] Save player inventory. - [x] Save placed structures. - [ ] Save resource depletion state if needed. diff --git a/Docs/PersistenceDesignDocument.md b/Docs/PersistenceDesignDocument.md index 6a79c1d..46bfdbc 100644 --- a/Docs/PersistenceDesignDocument.md +++ b/Docs/PersistenceDesignDocument.md @@ -416,6 +416,13 @@ bleeding, sprain, sickness, death state, and death reason. Loading applies the snapshot through `UAgrarianSurvivalComponent::ApplySavedState`, keeping clamping and replicated change notifications inside the survival component. +Long-term care history placeholders are stored through +`FAgrarianSavedPlayer::CareHistory`. The saved `FAgrarianCareHistorySnapshot` +reserves nutrition, illness, injury, sleep, shelter, stress, workload, and +treatment quality data for later generational and health systems. Version 0.1.M +only persists and restores those placeholders; it does not apply aging, +lifespan, inheritance, or generational outcome gameplay. + ## Testing Gates Minimum persistence smoke test: diff --git a/Scripts/verify_care_history_persistence.py b/Scripts/verify_care_history_persistence.py new file mode 100644 index 0000000..bf3a965 --- /dev/null +++ b/Scripts/verify_care_history_persistence.py @@ -0,0 +1,53 @@ +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[1] + +EXPECTED = { + ROOT / "Source" / "AgrarianGame" / "AgrarianTypes.h": [ + "struct FAgrarianCareHistorySnapshot", + "float NutritionQuality = 1.0f;", + "float IllnessBurden = 0.0f;", + "float InjuryBurden = 0.0f;", + "float SleepQuality = 1.0f;", + "float ShelterQuality = 1.0f;", + "float StressBurden = 0.0f;", + "float WorkloadBurden = 0.0f;", + "float TreatmentQuality = 1.0f;", + ], + ROOT / "Source" / "AgrarianGame" / "AgrarianSaveGame.h": [ + "FAgrarianCareHistorySnapshot CareHistory;", + ], + ROOT / "Source" / "AgrarianGame" / "AgrarianPersistenceSubsystem.cpp": [ + "SavedPlayer.CareHistory = SurvivalComponent->CareHistory;", + "SurvivalComponent->ApplySavedState(SavedPlayer->Survival, SavedPlayer->CareHistory);", + ], + ROOT / "Docs" / "PersistenceDesignDocument.md": [ + "`FAgrarianSavedPlayer::CareHistory`", + "nutrition, illness, injury, sleep, shelter, stress, workload", + "lifespan, inheritance, or generational outcome gameplay", + ], + ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md": [ + "[x] Save long-term character care history placeholders", + "`FAgrarianSavedPlayer::CareHistory`", + "deferred", + ], +} + + +def main() -> None: + missing = [] + for path, snippets in EXPECTED.items(): + text = path.read_text(encoding="utf-8") + for snippet in snippets: + if snippet not in text: + missing.append(f"{path.relative_to(ROOT)}: {snippet}") + + if missing: + raise RuntimeError("Care history persistence verification failed: " + "; ".join(missing)) + + print("PASS: care history placeholders persist without enabling aging gameplay.") + + +if __name__ == "__main__": + main()