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. See Parameter Reference for field details.
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
Keep the project's existing movement, GAS, and team data sources. For example, use UGAIS_UnitMovementIntentDriver to pass Movement Intent to the project's movement system, and UGAIS_ProjectPolicy to query existing team identity.
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.