Implement MorrowindBehaviorTree engine for zero-cost routine actions #970

Closed
opened 2026-03-22 18:45:51 +00:00 by perplexity · 0 comments
Collaborator

Parent

  • #963 — [Study] Solving the Perception Bottleneck

Objective

Build a behavior tree engine that handles 70% of gameplay actions (walk, attack, loot, basic combat) at zero inference cost (~2ms per tick).

Scope

  • Implement MorrowindBehaviorTree class with evaluate(state) → Action method
  • Define BT nodes for:
    • Navigation: Walk to waypoint, follow path grid route, enter/exit buildings
    • Combat: Attack nearest hostile, drink health potion, retreat if low HP
    • Looting: Pick up nearby valuable items, open containers
    • Rest: Sleep/wait when appropriate
    • Basic interaction: Activate doors, pick up quest items
  • Confidence scoring: BT returns action.confidence — if >0.9, execute without LLM
  • Fallback: if BT confidence <0.9, defer to tiered LLM decision
  • Integrate with FrameChangeDetector — repeat last action if no state change

Key Design Notes

  • BT handles 70% of all ticks at ~2ms — this is the single biggest performance win
  • LLMs are reserved for genuinely novel decisions (30% of ticks)
  • BT nodes should be data-driven and extensible (add new behaviors without code changes)
  • Morrowind's stat-based combat means BT combat is viable (no reaction-time dependency)

Performance Target

Scenario Frequency Latency
BT-handled (walk, attack, loot) 70% ~2ms
Deferred to LLM 30% 100ms-2.5s

References

  • Paper §Behavior Trees (pp. 8-9)
  • Paper §Expected Performance Profile (p. 18)
  • Paper §Conclusion — "behavior trees handle 70% of actions at zero inference cost"
## Parent - #963 — [Study] Solving the Perception Bottleneck ## Objective Build a behavior tree engine that handles 70% of gameplay actions (walk, attack, loot, basic combat) at zero inference cost (~2ms per tick). ## Scope - Implement `MorrowindBehaviorTree` class with `evaluate(state) → Action` method - Define BT nodes for: - **Navigation:** Walk to waypoint, follow path grid route, enter/exit buildings - **Combat:** Attack nearest hostile, drink health potion, retreat if low HP - **Looting:** Pick up nearby valuable items, open containers - **Rest:** Sleep/wait when appropriate - **Basic interaction:** Activate doors, pick up quest items - Confidence scoring: BT returns `action.confidence` — if >0.9, execute without LLM - Fallback: if BT confidence <0.9, defer to tiered LLM decision - Integrate with `FrameChangeDetector` — repeat last action if no state change ## Key Design Notes - BT handles 70% of all ticks at ~2ms — this is the single biggest performance win - LLMs are reserved for genuinely novel decisions (30% of ticks) - BT nodes should be data-driven and extensible (add new behaviors without code changes) - Morrowind's stat-based combat means BT combat is viable (no reaction-time dependency) ## Performance Target | Scenario | Frequency | Latency | |----------|-----------|--------| | BT-handled (walk, attack, loot) | 70% | ~2ms | | Deferred to LLM | 30% | 100ms-2.5s | ## References - Paper §Behavior Trees (pp. 8-9) - Paper §Expected Performance Profile (p. 18) - Paper §Conclusion — "behavior trees handle 70% of actions at zero inference cost"
claude was assigned by Rockachopa 2026-03-22 23:30:50 +00:00
claude added the harnessmorrowindp1-important labels 2026-03-23 13:54:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#970