Skip to content

feat(simulation): add metabolism and starvation - #28

Merged
czlin7 merged 1 commit into
developfrom
feat/metabolism-system
Sep 17, 2026
Merged

czlin7 merged 1 commit into
developfrom
feat/metabolism-system

Conversation

@czlin7

@czlin7 czlin7 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a MetabolismSystem that consumes entity energy using simulation dt
  • apply starvation damage after energy reaches zero
  • destroy entities when starvation reduces health to zero
  • register metabolism in SimulationWorld using the existing CEnergy + CHealth signature
  • add regression coverage for energy consumption, starvation damage, and death cleanup

Why

CEnergy and CHealth already exist on spawned animals but previously had no simulation behaviour. This introduces the first life-state progression on top of the deterministic fixed-step foundation.

Design notes

  • structural entity destruction is deferred until after iterating the system membership set to avoid mutating the collection during iteration
  • metabolism runs before AI and movement so life state can later feed behaviour decisions

Validation

  • branch is one commit ahead of develop
  • changed scope is limited to the new metabolism system, SimulationWorld integration, and foundation tests

@czlin7
czlin7 merged commit eba4833 into develop Sep 17, 2026
3 checks passed
@czlin7
czlin7 deleted the feat/metabolism-system branch September 17, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant