Mostly Harmless

UE3:GameCrowdAgent (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> Actor >> CrowdAgentBase >> GameCrowdAgent

Contents

Package: 
GameFramework
Implemented interfaces
Interface_NavigationHandle
Direct subclass:
GameCrowdAgentSkeletal


Properties

Property group 'Behavior'

DeadBodyDuration

Type: float

How long dead body stays around

Default value: 10.0

DesiredGroupRadius

Type: float

Try to keep Members this close together - probably will be obsolete when have formations

Default value: 200.0

EncounterAgentBehaviors

Type: array<BehaviorEntry>

Behaviors to choose from when encounter another agent (only if no current behavior)

GroupWaitingBehaviors

Type: array<BehaviorEntry>

Behaviors to choose from when waiting for other group members.

PanicBehaviors

Type: array<BehaviorEntry>

Behaviors to choose from when agent panicks.

RandomBehaviorInterval

Type: float

Average time between random behavior attempt (only if visible to player and no current behavior)

Default value: 30.0

RandomBehaviors

Type: array<BehaviorEntry>

Behaviors to choose from randomly at RandomBehaviorInterval.

SeePlayerBehaviors

Type: array<BehaviorEntry>

Behaviors to choose from when see player (only if no current behavior)

SeePlayerInterval

Type: float

How often see player event can be triggered. If 0, never retriggers

SpawnBehaviors

Type: array<BehaviorEntry>

Behaviors to choose from when agent spawns.

Property group 'GameCrowdAgent'

AmbientSoundCue

Type: SoundCue

Ambient Sound cue played by this agent

bPreferVisibleDestination

Type: bool

If true, agent will prefer destinations with line of sight to player if starting from non-L.O.S. destination

bPreferVisibleDestinationOnSpawn

Type: bool

If true, prefer visible destination only for first destination chosen after spawn

Default value: True

Health

Type: int

Current health of agent

Default value: 100

Property group 'LOD'

MaxLOSLifeDistance

Type: float

Max distance to keep agents around if they haven't been rendered in NotVisibleLifeSpan, but are still in player's potential line of sight

Default value: 20000.0

NotVisibleLifeSpan

Type: float

how long to wait before killing this agent when it isn't visible

Default value: 5.5

NotVisibleTickScalingFactor

Type: float

Scaling factor for agent ticking when not visible

Default value: 0.02

ProximityLODDist

Type: float

Distance to LOD out proximity checks for non-visible agents

Default value: 2000.0

VisibleProximityLODDist

Type: float

Distance to LOD out proximity checks for visible agents

Default value: 5000.0

Property group 'Movement'

bAllowPitching

Type: bool


bClampMovementSpeed

Type: bool

Whether to clamp movement speed

Default value: True

ConformTraceDist

Type: float

How far to trace to conform agent to the bsp/world.

Default value: 35.0

ConformTraceInterval

Type: int

Every how many frames the ground conforming line check is done.

Default value: 10

ConformType

Type: EConformType

How agent conforms to surfaces

MaxRunningSpeed

Type: float

Max running speed (if not using root motion velocity)

Default value: 300.0

MaxWalkingSpeed

Type: float

Max walking speed (if not using root motion velocity)

Default value: 100.0

MaxYawRate

Type: float

Crowd agents rotate to face the direction they are travelling. This value limits how quickly they turn to do this, to avoid them spinning too quickly

Default value: 40000.0

RotateToTargetSpeed

Type: float

When a 'target' action occurs, agent will rotate to face the CrowdAttractor. This controls how fast that turn happens

Default value: 30000.0

VelocityDamping

Type: float

Agent velocity damping (friction).

Default value: 0.0010

Property group 'Pathing'

AvoidOtherRadius

Type: float

The radius used to check overlap between agents (basically how big an agent is).

Default value: 100.0

AvoidOtherStrength

Type: float

How hard agents are pushed apart when they overlap.

Default value: 1000.0

AvoidPlayerStrength

Type: float

How hard agents are pushed away from player.

Default value: 10000.0

AwareRadius

Type: float

Controls how far around an agent the system looks when finding the average speed.

Default value: 200.0

AwareUpdateInterval

Type: int

Every how many frames the agents 'awareness' is updated (attractors and other agents

Default value: 30

bCheckForObstacles

Type: bool

Whether to have obstacle mesh block agents

bUseNavMeshPathing

Type: bool

If TRUE, use navmesh for pathing

Default value: True

FollowPathStrength

Type: float

Agent acceleration along the path direction (towards their target).

Default value: 300.0

GroupAttractionStrength

Type: float

How hard group members pull together

Default value: 50.0

MatchVelStrength

Type: float

How aggressively an agent matches the speed of its neighbours.

Default value: 0.6

Property group 'Rendering'

GroundOffset

Type: float

Distance from ground to agent center (used to adjust foot positioning)

Default value: 40.0

MeshMaxScale3D

Type: Object.Vector

Max 3D drawscale to apply to the agent mesh

Default value:

Member Value
X 1.0
Y 1.0
Z 1.0

MeshMinScale3D

Type: Object.Vector

Min 3D drawscale to apply to the agent mesh

Default value:

Member Value
X 1.0
Y 1.0
Z 1.0

Internal variables

See GameCrowdAgent internal variables.

Default values

Property Value
bCollideActors True
bNoEncroachCheck True
bProjTarget True
Components[0] DynamicLightEnvironmentComponent'MyLightEnvironment'
Physics PHYS_Interpolating
SupportedEvents[4] Class'Engine.SeqEvent_TakeDamage'
SupportedEvents[5] Class'Engine.SeqEvent_Death'
TickGroup TG_DuringAsyncWork

Subobjects

MyLightEnvironment

Class: Engine.DynamicLightEnvironmentComponent

Property Value
bEnabled False
MinTimeBetweenFullUpdates 2.0

Enums

EConformType

CFM_NavMesh 
CFM_BSP 
CFM_World 
CFM_None 

Structs

BehaviorEntry

Modifiers: native

Describes a behavior type and its frequency

GameCrowdAgentBehavior BehaviorArchetype 
Archetype based on a GameCrowdAgentBehavior class
float BehaviorFrequency 
How often this behavior is picked = BehaviorFrequency/(sum of BehaviorFrequencies)
bool bNeverRepeat 
If true, agent will never repeat this behavior
bool bHasBeenUsed 
Whether this behavior has been used by this agent
bool bCanBeUsed 
Temp Cache whether this behavior can be used

Default values:

Property Value
BehaviorFrequency 1.0

RecentInteraction

Modifiers: native

name InteractionTag 
float InteractionDelay 

Functions

Native functions

IsIdle

native function bool IsIdle ()

Returns:

true if CurrentBehavior and CurrentBehavior.bIdleBehavior is true

IsPanicked

native function bool IsPanicked ()

Returns:

whether this agent is panicked (true if agent has a CurrentBehavior and CurrentBehavior.bIsPanicked==true

NativePostRenderFor

simulated native function NativePostRenderFor (PlayerController PC, Canvas Canvas, Object.Vector CameraPosition, Object.Vector CameraDir)

Overrides: Actor.NativePostRenderFor

Hook to allow actors to render HUD overlays for themselves. Assumes that appropriate font has already been set

PlayDeath

native function PlayDeath (Object.Vector KillMomentum)

Stop agent moving and pay death anim

SetCurrentBehavior

final native function SetCurrentBehavior (GameCrowdAgentBehavior BehaviorArchetype)

Instantiate a new behavior using BehaviorArchetype, and set it to be the current behavior.

Events

ActivateBehavior

event ActivateBehavior (GameCrowdAgentBehavior NewBehaviorArchetype)

Activate the passed in NewBehaviorArchetype as the new current behavior for this agent FIXMESTEVE - currently kills old behavior - instead, should have stack of behaviors

Destroyed

simulated event Destroyed ()

Overrides: Actor.Destroyed


FellOutOfWorld

simulated event FellOutOfWorld (class<DamageTypedmgType)

Overrides: Actor.FellOutOfWorld

called when the actor falls out of the world 'safely' (below KillZ and such)

FireDeathEvent

simulated event FireDeathEvent ()

Death event is script class, so need to call from script

GeneratePathToActor

event Object.Vector GeneratePathToActor (Actor Goal, optional float WithinDistance, optional bool bAllowPartialPath)

Generate a path to Goal on behalf of the QueryingAgent

HandlePotentialAgentEncounter

event HandlePotentialAgentEncounter ()

Called when agent encounters another agent

NearbyDynamics list has been updated with agents, and potential encounters have their bPotentialEncounter set to true

InitNavigationHandle

event InitNavigationHandle ()

spawn and init Navigation Handle

KillAgent

event KillAgent ()

Kill this agent or add it to population manager's spawn pool

NotifySeePlayer

event NotifySeePlayer (PlayerController PC)

Called when see PC's pawn where PC is a local playercontroller, Notification only occurs if bHasSeePlayerKismet=true

OverlappedActorEvent

event OverlappedActorEvent (Actor A)

Called when crowd agent overlaps something in the ReportOverlapsWithClass list

PlayIdleAnimation

simulated event PlayIdleAnimation ()

Play a looping idle animation

PostBeginPlay

simulated event PostBeginPlay ()

Overrides: Actor.PostBeginPlay


PostRenderFor

simulated event PostRenderFor (PlayerController PC, Canvas Canvas, Object.Vector CameraPosition, Object.Vector CameraDir)

Overrides: Actor.PostRenderFor

PostRenderFor() Hook to allow agents to render HUD overlays for themselves. Called only if the agent was rendered this tick. Assumes that appropriate font has already been set

SetCurrentDestination

event SetCurrentDestination (GameCrowdDestination NewDest)


StopBehavior

event StopBehavior ()


StopIdleAnimation

simulated event StopIdleAnimation ()


TakeDamage

event TakeDamage (int DamageAmount, Controller EventInstigator, Object.Vector HitLocation, Object.Vector Momentum, class<DamageTypeDamageType, optional Actor.TraceHitInfo HitInfo, optional Actor DamageCauser)

Overrides: Actor.TakeDamage

(Description copied from Actor.TakeDamage)
apply some amount of damage to this actor

Parameters:

  • DamageAmount - the base damage to apply
  • EventInstigator - the Controller responsible for the damage
  • HitLocation - world location where the hit occurred
  • Momentum - force caused by this hit
  • DamageType - class describing the damage that was done
  • HitInfo - additional info about where the hit occurred
  • DamageCauser - the Actor that directly caused the damage (i.e. the Projectile that exploded, the Weapon that fired, etc)

UpdateIntermediatePoint

event UpdateIntermediatePoint (optional Actor DestinationActor)

Update current intermediate destination point for agent in route to DestinationActor

WaitForGroupMembers

event WaitForGroupMembers ()

Too far ahead of group, pick waiting behavior

Other instance functions

ActivateInstancedBehavior

function ActivateInstancedBehavior (GameCrowdAgentBehavior NewBehaviorObject)

Activate a new behavior that has already been instantiated

CalcCamera

simulated function bool CalcCamera (float fDeltaTime, out Object.Vector out_CamLoc, out Object.Rotator out_CamRot, out float out_FOV)

Overrides: Actor.CalcCamera

Calculate camera view point, when viewing this actor.

Parameters:

  • fDeltaTime - delta time seconds since last update
  • out_CamLoc - Camera Location
  • out_CamRot - Camera Rotation
  • out_FOV - Field of View

Returns:

true if Actor should provide the camera point of view.

DisplayDebug

simulated function DisplayDebug (HUD HUD, out float out_YL, out float out_YPos)

Overrides: Actor.DisplayDebug

(Description copied from Actor.DisplayDebug)
list important Actor variables on canvas. HUD will call DisplayDebug() on the current ViewTarget when the ShowDebug exec is used

Parameters:

  • HUD - HUD with canvas to draw on
  • out_YL - Height of the current font
  • out_YPos - Y position on Canvas. out_YPos += out_YL, gives position to draw text for next debug line.

GetBehaviorString

function string GetBehaviorString ()

Get debug string about agent behavior

GetDestString

function string GetDestString ()

Get debug string about agent destination and movement status

InitializeAgent

simulated function InitializeAgent (Actor SpawnLoc, GameCrowdAgent AgentTemplate, GameCrowdGroup NewGroup, float AgentWarmUpTime, bool bWarmupPosition, bool bCheckWarmupVisibility)

Initialize agent archetype, group, destination, and behavior

OnPlayAgentAnimation

simulated function OnPlayAgentAnimation (SeqAct_PlayAgentAnimation Action)


PickBehaviorFrom

function bool PickBehaviorFrom (array<BehaviorEntryBehaviorList, optional Object.Vector BestCameraLoc)

Pick a behavior from the BehaviorList, for a camera at BestCameraLoc, and activate this behavior Caller is responsible for setting bHasBeenUsed on picked behavior entry.

Returns:

true if new behavior was activated

PlaySpawnBehavior

function PlaySpawnBehavior ()

Called when agent spawns and has SpawnBehaviors set

ResetPooledAgent

function ResetPooledAgent ()

Agent is coming out of pool, so rev him up

ResetSeePlayer

function ResetSeePlayer ()


SetLighting

simulated function SetLighting (bool bEnableLightEnvironment, LightComponent.LightingChannelContainer AgentLightingChannel, bool bCastShadows)

Set agent lighting

Parameters:

  • bEnableLightEnvironment - controls whether light environment is enabled
  • AgentLightingChannel - is the lighting channel to use (GameCrowdAgentSkeletal only)
  • bCastShadows - controls whether agent casts shadows (GameCrowdAgentSkeletal only)

SetMaxSpeed

function SetMaxSpeed ()

Set maximum movement speed

SetPanic

function SetPanic (Actor PanicActor, bool bNewPanic)


TryRandomBehavior

function TryRandomBehavior ()

Called when random behavior timer expires

If not currently in behavior AND player can see me, do a random behavior.