Document care history persistence

This commit is contained in:
2026-05-18 19:17:02 -07:00
parent 82f60f480b
commit 1d2ac1e584
3 changed files with 65 additions and 1 deletions
+5 -1
View File
@@ -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.
+7
View File
@@ -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:
@@ -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()