feat(ecology): F2 — NaturalNode runtime model (entity + registry + World wiring + startup load) #253
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!253
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/ecology-f2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
F2 of the ecology foundation (epic #250, slice #251; builds on F1 #252): the pure server-side runtime model for natural nodes. No player-facing surface yet — nothing creates a node until the F3 spawner — so this is infrastructure, deliberately invisible in-game (like F1).
NaturalNode— authoritative entity (sibling ofMobile), species-agnostic: its current stage is derived lazily from(SpeciesDef lifecycle + stageEnteredAt + now)via F1'sSpeciesDef.StageAtElapsed(wallclock seconds, survives restart, no scheduler). Intrinsic self-validatingAdvanceStage.NaturalNodeRegistry—internal, one-node-per-cell, exercised through theWorldfacade like the 4 sibling registries (noInternalsVisibleTo).World— owns the registry +EcologyData; thinAddNaturalNode(resolves species → baseline stage) +NaturalNodeAt/NaturalNodeCount; stays delegation-only.content/ecology.txtonce (liketiledata.txt; copied to GameServer + test output), never in the tick.Deferred to later slices (NOT here): baseline/delta persistence +
EcologySpawner(F3), AoI +NaturalNode*DTOs + protocol bump (F4), client render (F5), and the whole harvest system + skills.Two decisions worth flagging:
9ec9c64): main went red under Sonar S8969 when F1'sdir!met the #220 SonarAnalyzer 10.31 bump (two green PRs → red main). This PR repairs it — merging greens main.internalregistry split from its only consumer fails the unused-member analyzer, and the repo tests registries viaWorld, not directly — so noInternalsVisibleTo, and the registry is trimmed to what F2 uses (Add/At/Count; by-id lookup / removal / enumeration land with their F3 consumers).How it was tested
IsoMmo.GameServer.Tests/Ecology): lazy stage (multi-hop growth, block-flags follow current stage, backwards clock-skew),AdvanceStage, one-node-per-cell, distinct ids, species resolution + guard rejections; a boot smoke test (server starts withecology.txtloaded — RED without the csproj copy, GREEN with it).check-doc-refsresolves; fulldotnet testgreen.AddNaturalNode; add a by-id index for harvest; theGuidis per-session so persistence keys on the cell).Screenshots: N/A — F2 has no visible surface (no runtime node creation until the F3 spawner; no rendering until F5).
Checklist
just lint(CSharpier + analyzers, 0 warnings)just testgreen (whole solution)check-doc-refsgreen