docs: mark simulation definitions phase complete

This commit is contained in:
2026-07-05 13:35:42 +02:00
parent f816f3976a
commit 81df7b5939
8 changed files with 118 additions and 25 deletions
+8 -6
View File
@@ -218,19 +218,21 @@ signal reservation_changed(node_id: StringName, agent_id: int)
@export var node_id: StringName
@export var action_id: StringName = &"gather_food"
@export var resource_id: StringName = &"food"
@export var amount_remaining: float = 10.0
@export var initial_amount: float = 10.0
@export var yield_per_action: float = 2.0
@export var enabled: bool = true
@export var initial_enabled: bool = true
@export var can_npcs_use: bool = true
@export var can_player_use: bool = true
@export var hide_visual_when_depleted: bool = false
@onready var interaction_point: Marker3D = $InteractionPoint
var state: ResourceStateRecord
```
Use `StringName` IDs as a small migration step away from duplicated free-form
`String` values. Later, action and resource definitions can become custom
`Resource` assets without changing every world node's conceptual contract.
Action IDs now use canonical `SimulationIds` values and resolve through
validated `ActionDefinition` resources. ResourceNode's exported amount and
enabled values are initialization defaults only; its bound
`ResourceStateRecord` owns live mutable state.
### Avoid duplicated state
@@ -239,7 +241,7 @@ Derive it:
```gdscript
func is_depleted() -> bool:
return amount_remaining <= 0.0
return state.is_depleted() if state != null else initial_amount <= 0.0
```
If regeneration or non-depleting sources later require more states, introduce