
描述
Behavior trees, response-curve utility, and GOAP planning — deterministic NPC brains on ticks.
NEXUS AI is a deterministic NPC foundation for Unity. Every decision resolves through typed systems with canonical ordering: the same inputs always produce the same choice, and every choice is journaled under a fixed key. Frame rate never touches AI logic — all windows and timers are simulation ticks.
- Three decision systems that compose: BehaviorTree (selector/sequence over condition and action leaves, typed Success/Failure/Running), UtilitySelector (constant/linear/quadratic response curves, weight x mean scoring, ties break to the smallest id), GoapPlanner (uniform-cost search over immutable facts with preconditions, effects, removals, and a depth bound).
- Needs that behave: per-tick decay, satisfy and drain clamped 0..100, and a Lowest() that breaks ties canonically — "what does this NPC want next?" is always answerable.
- Schedules and personalities: non-overlapping hour windows with wrap-around (22..6 is legal) plus an optional fallback; five canonical traits scale any base score deterministically.
- Replay-proof decision journal: BeginDecision(key) refuses a repeated key BEFORE any state changes — replays become observable DuplicateDecision lines instead of silent double-choices. A rolling checksum folds every commit; print it and compare decision logs.
- Canonical NAI v1 snapshots: byte-stable JSON envelopes with a checksum folded over the canonical member text the loader re-derives. Strict decode returns a typed taxonomy — Ok / BadMagic / BadVersion / Corrupt / ChecksumMismatch — and never throws for bad payloads.
- Authoring that validates itself: duplicate node, action, fact, need, and trait ids are rejected at construction; menus, bounds, and costs are checked before anything runs.
- Editor tools: Create NPC Agent, the Utility Designer (live scoring of the demo brain), and About — all under Tools > NEXUS AI.
- Zero class-level mutable static fields and zero singletons: safe with Enter Play Mode Options even with domain reload disabled.
Zero shaders, zero materials, zero rendering code. Unity 2021.3 LTS or newer, all render pipelines, all renderers. 93 EditMode tests included — run them in Test Runner right after import, no Play Mode needed.





