Add resource node persistence
This commit is contained in:
@@ -441,12 +441,19 @@ This document defines:
|
||||
|
||||
Implementation work remains tracked separately in the roadmap.
|
||||
|
||||
The MVP resource-node implementation stores depletion as existing map/tile
|
||||
actor state. Each `AAgrarianResourceNode` may define a stable
|
||||
`PersistenceNodeId`; otherwise the actor name is used as a fallback. Save files
|
||||
capture `RemainingHarvests` for resource nodes present in the loaded world and
|
||||
restore only matching existing nodes. This deliberately avoids spawning resource
|
||||
nodes from saves, keeping tile-authored resources owned by tile content while
|
||||
letting persistence remember depletion for active tiles.
|
||||
|
||||
## Open Questions
|
||||
|
||||
- Should the first playable MVP use `USaveGame`, JSON, or a hybrid save
|
||||
backend?
|
||||
- What is the first stable `SaveFormatVersion` value?
|
||||
- Which resource nodes should persist depletion in Ground Zero?
|
||||
- Should disconnected players remain in world physically or be removed?
|
||||
- How much inventory should death/respawn preserve?
|
||||
- When do saves move from file-based records to database-backed records?
|
||||
|
||||
@@ -458,6 +458,15 @@ plants remain pure bare-hand gathering. Later nodes can disable
|
||||
`bAllowBareHandGathering` when the game has proper tool equipment, durability,
|
||||
and feedback UI.
|
||||
|
||||
Resource node persistence is map/tile state, not a spawned-actor replay path.
|
||||
`UAgrarianSaveGame` stores `FAgrarianSavedResourceNode` records keyed by
|
||||
`AAgrarianResourceNode::PersistenceNodeId`, with the actor name as a fallback.
|
||||
`UAgrarianPersistenceSubsystem` captures only resource nodes that exist in the
|
||||
currently loaded world and restores matching existing nodes by stable id. This
|
||||
keeps the MVP compatible with later Earth-scale tiles: a tile contributes
|
||||
resource depletion state only when its resource actors actually exist, and tile
|
||||
generation/placement scripts should assign deterministic node ids.
|
||||
|
||||
### Wildlife Navigation
|
||||
|
||||
MVP wildlife movement is server authoritative. `AAgrarianWildlifeBase` uses an
|
||||
|
||||
@@ -69,6 +69,15 @@ immediate benefit:
|
||||
The rule is inventory-based until equipment slots, durability, and explicit
|
||||
active-hand state are implemented.
|
||||
|
||||
## Persistence
|
||||
|
||||
Ground Zero resource actors receive stable `PersistenceNodeId` values matching
|
||||
their placement labels. The persistence subsystem captures and restores only
|
||||
resource nodes that exist in the loaded world, so depletion records stay scoped
|
||||
to active map/tile content. Future generated Earth-scale tiles should follow the
|
||||
same rule: assign deterministic resource node IDs during placement and let the
|
||||
save system record depletion only for tiles whose resource actors are present.
|
||||
|
||||
## Follow-Up
|
||||
|
||||
Future passes should replace the prototype meshes with real coastal scrub,
|
||||
|
||||
Reference in New Issue
Block a user