Intent Brain
Make your NPCs actually smart. A comprehensive, rule-based framework for generating NPC intents across all gameplay states. The system begins by classifying the current scene (combat, active social, hostile encounter, downtime, or aftermath), which defines the behavioral ruleset and intensity baseline. It then determines intent eligibility by validating perception (what an NPC can reasonably observe), direct player engagement, and three gating conditions for all other actors: urgency (reason to act now), impact (ability to meaningfully change the scene), and redundancy (ensuring no duplicated narrative beats). NPC behavior is further regulated through an escalation ladder (calm → annoyed → confrontational → hostile → violent), enforcing gradual, justified shifts in tone based on player actions, character personality, and evolving context, with support for de-escalation when appropriate. Role constraints ensure that each NPC operates within their social position, authority, and personal limits, preventing unrealistic reactions while allowing controlled exceptions with consequences. Scene-specific logic layers additional rules: social scenes prioritize goal-oriented dialogue and controlled information flow, hostile encounters emphasize tactical awareness and self-preservation, downtime restricts unnecessary conflict, and aftermath phases suppress new pressures in favor of resolution and recovery. Party members contribute selectively based on relevance, personality, and situational awareness, with strict limits to avoid noise and maintain focus. In combat, the system applies additional quality controls: prioritizing defined abilities over generic actions, enforcing action chaining and coordination, reacting to prior turns, and dynamically adjusting behavior based on attrition (confidence at full strength, desperation at low health). It also supports disengagement logic, allowing NPCs to flee, surrender, or negotiate when outmatched. Overall, the system ensures that every generated intent is context-aware, mechanically justified, narratively meaningful, and aligned with both character identity and the evolving state of the scene with additional goal of making companions a real addition for the journey.
