docs: codify entity systems pattern and record combat extensions
This commit is contained in:
@@ -86,6 +86,25 @@ Current resource gathering should use finite `ResourceNode` instances:
|
||||
- food: berries, animal camps, village stock, future farms/crops;
|
||||
- wood: trees, wood piles, future forestry contexts.
|
||||
|
||||
## Entity systems pattern
|
||||
|
||||
Build every resource, enemy, and animal as a reusable system with shared root
|
||||
behaviour, not as a one-off object. Add a new type through data/definitions
|
||||
plus a small behaviour or visual hook, reusing the root for movement,
|
||||
presentation, serialization, and lifecycle:
|
||||
|
||||
- resources: `ResourceNode` + `ResourceStateRecord` (amount, yield, regrowth);
|
||||
- creatures: `CreatureVisual` shared movement root (navigate to the
|
||||
authoritative simulation position, report position, death), with per-type
|
||||
visuals built from definitions;
|
||||
- enemies: `EnemyDefinition` + `SimulationEnemies` registry driving combatant
|
||||
spawns and hostile visuals;
|
||||
- animals: `AnimalNode` + `AnimalStateRecord` following the same
|
||||
follow-the-authoritative-position contract.
|
||||
|
||||
A new berry, tree, bear, bandit, boar, or goat should be mostly a definition
|
||||
plus a bounded hook — never a new movement/combat/save system.
|
||||
|
||||
Resource additions should preserve:
|
||||
|
||||
- stable unique IDs;
|
||||
|
||||
Reference in New Issue
Block a user