GenericAISystem Best Practices
These are recommended practices for project integration, configuration maintenance, extension layering, and verification.
Integrate in layers
Integrate a minimal command Unit, squads, formations, Movement Intent, Tactical Assignment, and deep StateTree integration one layer at a time. Each has a clear verification point; do not configure every Source, Filter, Allocator, and custom Command in the first pass.
First make a concrete player/script command work, then add StateTreeStack override and fallback. Add Queue for complex execution sequences, and finally let Tactical Assignment choose Units and targets automatically. Each step then has a clear failure boundary.
Do not put all AI in one StateTree
The most common long-term failure is placing basic AI, squad overrides, top-level commands, combo execution, tactical assignment, and target filtering in one StateTree. A more stable division is: Stack owns control, Queue owns execution sequence, Tactical Assignment owns AI command allocation, and CommandSystem owns concrete command lifetime.
Maintain parameters centrally
Maintain command fragments, squad roles, formation slots, Tactical Assignment Batches, and StateTree Keys as configuration assets. Core feature docs do not repeat parameter detail; return to Parameter Reference for changes.
Put extension points at boundaries
- Extend command semantics in
UGAIS_CommandDefinition. - Map Tactical Assignment intent to Commands in
UGAIS_UnitComponent.CommandIntentMappingsor a Unit/Actor/componentIGAIS_CommandIntentResolver. - Put behavior-layer overrides in StateTreeStack and complex sequences in StateTreeQueue.
- Put squad eligibility and role rules in
UGAIS_SquadDefinition. - Integrate movement through
UGAIS_UnitMovementIntentDriver. - Integrate teams through
UGAIS_ProjectPolicy.
Preserve project sources of truth
GAIS should not take over existing project truth for Movement, GAS, Team, or Animation. Use Drivers, Policies, Interfaces, and CommandDefinitions as adapters.
Separate network ownership from gameplay authorization
Mutable Command, Squad, Formation, Team, and Movement Intent state is server-owned. GAIS Server... RPCs are an owning client's request path, not gameplay authorization. The project still checks on the server whether a player may control a Unit/squad, change formation or role, or issue a Command. Route requests for non-owned Actors through PlayerController or project networking.
Start diagnosis from summaries
Inspect GameplayDebugger summaries for Blackboard, Stack, Queue, CommandSystem, Formation, Squad, and Team before drilling into fields. Slot-score diagnostics are available only outside Shipping/Test builds.
