Storm Game Framework 2.0.0
User guide
Loading...
Searching...
No Matches
NPC behaviour modules

AI states, actions, sensing, navigation, tactics and work.

Back to the module index.

StormAI

StormAI runs an NPC's states and applies the rules that move it between them.

Try it. Create a Storm AI State, give it a tag and set it as the starting state in a Storm AI State Machine Config. Assign the configuration to the NPC's controller and check that it enters the expected state.

C++ entry point. Add StormAI to your consuming module and include AI/Components/StormAIComponent.h. See StormAIComponent.h.

After the NPC starts, inspect the running state on its AI component.

AI.GetCurrentStateTag()

Follow the walkthrough.

StormAIActions

StormAIActions evaluates an NPC's available actions and starts one according to the action set's rules.

Try it. Make a set with Wait as the first action and assign it to a Run Action Selector task in a state. Add other actions after you have verified that the first action starts.

C++ entry point. Add StormAIActions to your consuming module and include Actions/StormAIActionSet.h. See StormAIActionSet.h.

With an authored action set loaded as ActionSet, check its candidates.

ActionSet.GetActions().Num()

Follow the walkthrough.

StormAIActionsEditor

This provides the AI Action Editor and AI Asset Browser.

Try it. Open an SGF AI Action Set to add, order or configure actions and check the configuration. Use SGF > AI Asset Browser to find related state, senses, threat and engagement assets.

Follow the walkthrough.

StormAISenses

StormAISenses gathers observations for an NPC.

Try it. Assign a senses configuration and start with a small area and a filter for one kind of target. Move a test target into and out of range and check which observations the NPC receives.

C++ entry point. Add StormAISenses to your consuming module and include Senses/Components/StormAISensesComponent.h. See StormAISensesComponent.h.

StormAIThreat

StormAIThreat turns observations into awareness and a current threat candidate.

Try it. Use a threat configuration to decide what raises interest and how quickly it fades. Test what the NPC remembers when a target disappears and returns.

C++ entry point. Add StormAIThreat to your consuming module and include Threat/Components/StormAIThreatComponent.h. See StormAIThreatComponent.h.

After the configured NPC observes a target, query its current threat on the server.

Threat.GetCurrentThreat()

StormAINavigation

StormAINavigation handles AI movement requests and reports their outcome.

Try it. Add Unreal navigation coverage to the test map and request a reachable destination. Try an unreachable destination as well so the NPC can respond to a failed move.

C++ entry point. Add StormAINavigation to your consuming module and include Navigation/Components/StormAINavigationComponent.h. See StormAINavigationComponent.h.

While a reachable move request runs, inspect the NPC's navigation component.

Navigation.IsMoving()

StormAISquads

StormAISquads tracks squad membership and leadership and delivers orders to members.

Try it. Put two NPCs in a squad and issue one order from your game. Check that each member receives it and that the squad can continue after a member leaves.

C++ entry point. Add StormAISquads to your consuming module and include Squads/Subsystems/StormAISquadSubsystem.h. See StormAISquadSubsystem.h.

After registering a squad, pass its squad ID to check membership count.

Squads.GetMemberCount(SquadId)

StormAIEngagement

StormAIEngagement manages which NPCs may take positions or act around a target.

Try it. Author one engagement layout and rules for how many agents can act. Test two agents against one target and check that a slot becomes available when its occupant leaves.

C++ entry point. Add StormAIEngagement to your consuming module and include Engagement/Components/StormAIEngagementComponent.h. See StormAIEngagementComponent.h.

After an NPC claims a position, inspect how many assignments are held.

Engagement.GetAssignedCount()

StormAIAbilities

StormAIAbilities lets NPC actions check and use abilities already granted to the NPC.

Try it. Give the character one ability, then have an AI action request it. Compare an available use with one refused because the ability is missing or cannot run yet.

C++ entry point. Add StormAIAbilities to your consuming module and include AIAbilities/Components/StormAIAbilityComponent.h. See StormAIAbilityComponent.h.

StormAICombat

StormAICombat supplies reusable combat actions and the checks that make those actions eligible.

Try it. Add a combat action to a working action set and give the NPC the target and capabilities the action needs. Test whether it becomes eligible only in the intended situation.

C++ entry point. Add StormAICombat to your consuming module and include Combat/Components/StormAICombatContextComponent.h. See StormAICombatContextComponent.h.

StormAITactics

StormAITactics helps agents find and claim authored tactical points, such as cover positions.

Try it. Place and tag a point, register the agent and provide its threat context. Check that it can claim the point when reachable and that another agent respects the claim.

C++ entry point. Add StormAITactics to your consuming module and include Tactics/StormAITacticsSubsystem.h. See StormAITacticsSubsystem.h.

StormAITacticsActionsAdapter

This lets an SGF AI action set act on a tactical point chosen by your game.

Try it. Add the tactical action to a working action set and have the game pass it a specific candidate point and movement setup. Check that the NPC can claim the point, reach it and release the claim when finished.

C++ entry point. Add StormAITacticsActionsAdapter to your consuming module and include TacticsActions/StormAITacticalActionsComponent.h. See StormAITacticalActionsComponent.h.

StormAIWork

StormAIWork lets the game offer a job and an eligible NPC claim it.

Try it. Have an object publish one job with a location and a required capability, then register two NPCs that can do it. Test that one NPC claims it and that cancellation frees it for another.

C++ entry point. Add StormAIWork to your consuming module and include Work/StormAIWorkSubsystem.h. See StormAIWorkSubsystem.h.

StormAIWorkActionsAdapter

This lets an SGF AI action set carry out a specific work offer chosen by your game.

Try it. Add the work action to the set and connect the agent to your game's job start and stop logic. Pass it one offer, then check that the NPC reaches the job and stops if the offer is withdrawn.

C++ entry point. Add StormAIWorkActionsAdapter to your consuming module and include WorkActions/StormAIWorkActionsComponent.h. See StormAIWorkActionsComponent.h.