I love the smell of UnrealEd crashing in the morning. – tarquin

UE3:GameCrowdPopulationManager (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 06:39, 17 January 2010 by Wormbo (Talk | contribs) (1 revision: class descriptions for UDK January update (part 2))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UDK Object >> Actor >> GameCrowdPopulationManager
Package: 
GameFramework
Implemented interfaces
GameCrowdSpawnerInterface

Manages adding appropriate crowd population around player

Agents will be spawned/recycled at any available active GameCrowdDestination

Properties

Property group 'GameCrowdPopulationManager'

bWarmupPosition

Type: bool

If true, and initial spawn positiong is not in player's line of sight, and agent is not part of a group, agent will try to find an starting position at a random spot between the initial spawn positing and its initial destination that isn't in the player's line of sight.

Default value: True

Internal variables

AgentArchetypes

Type: array<SeqAct_GameCrowdSpawner.AgentArchetypeInfo>

Archetypes of agents spawned by this crowd spawner

AgentCount

Type: int

Number of currently spawned crowd members.

AgentFrequencySum

Type: float

Sum of agent types + frequency modifiers

AgentLightingChannel

Type: LightComponent.LightingChannelContainer

Lighting channels to put the agents in.

Default value:

Member Value
bInitialized True
Crowd True

AgentPool

Type: array<GameCrowdAgent>

Pool of agents available for re-use: these are agents close to being removed

AgentWarmupTime

Type: float

Average time to "warm up" spawned agents before letting them sleep if not rendered

Default value: 2.0

bCastShadows

Type: bool

Whether agents from this spawner should cast shadows

bEnableCrowdLightEnvironment

Type: bool

Whether to enable the light environment on crowd members.

bForceNavMeshPathing

Type: bool

If true, force nav mesh navigation for all agents from this spawner

bForceObstacleChecking

Type: bool

If true, force obstacle checking for all agents from this spawner

bHaveInitialPopulation

Type: bool

flag set when first adding agents. Extra fill on first tick

bSpawningActive

Type: bool

Controls whether we are actively spawning agents.

Default value: True

HeadVisibilityOffset

Type: float

Offset used to validate spawn by checking above spawn location to see if head/torso would be visible

Default value: 40.0

InitialPopulationPct

Type: float

How much population to add first tick

Default value: 0.2

KilledCount

Type: int

Agent spawning stats

MaxAgentPoolSize

Type: int

Maximum size of agent pool

Default value: 20

MaxSpawnDistSq

Type: float

Square of max distance allowed for spawns

Default value: 4.0E8

MinBehindSpawnDistSq

Type: float

Square of min distance allowed for in line of sight but out of view frustrum agent spawns

Default value: 2.5E7

PlayerPositionPredictionTime

Type: float

How far ahead to compute predicted player position for spawn prioritization

Default value: 5.0

PoolCount

Type: int

Agent spawning stats

PotentialSpawnPoints

Type: array<GameCrowdDestination>

List of all GameCrowdDestinations that are PotentialSpawnPoints

PrioritizationIndex

Type: int

Index into prioritization array for picking spawn points, incremented as agents are spawned at each point

PrioritizationUpdateIndex

Type: int

Index into prioritization array for updating prioritization

PrioritizedSpawnPoints

Type: array<GameCrowdDestination>

Ordered array of prioritized spawn GameCrowdDestinations

Remainder

Type: float

Used by spawning code to accumulate partial spawning

SpawnedCount

Type: int

Agent spawning stats

SpawnNum

Type: int

The maximum number of agents alive at one time. If agents are destroyed, more will spawn to meet this number.

Default value: 700

SpawnPrioritizationInterval

Type: float

How frequently to reprioritize GameCrowdDestinations as potential spawn points

Default value: 0.4

SpawnRate

Type: float

How many agents per second will be spawned at the target actor(s).

Default value: 50.0

SplitScreenNumReduction

Type: float

How much to reduce number by in splitscreen

Default value: 0.5

Default values

Property Value
bHidden True
bOnlyDirtyReplication True
bSkipActorPropertyReplication True
CollisionType COLLIDE_CustomDefault
NetUpdateFrequency 10.0

Functions

Events

PostBeginPlay

event PostBeginPlay ()

Overrides: Actor.PostBeginPlay


SpawnAgent

event GameCrowdAgent SpawnAgent (GameCrowdDestination SpawnLoc)

Actually create a new CrowdAgent actor, and initialise it

Tick

event Tick (float DeltaSeconds)

Overrides: Actor.Tick

FIXMESTEVE - Nativize?

Other instance functions

AddPrioritizedSpawnPoint

function AddPrioritizedSpawnPoint (GameCrowdDestination GCD, Object.Vector ViewLocation)

Prioritize passed in GameCrowdDestination and insert it into ordered PrioritizedSpawnPoints list, offset from current starting point

AddToAgentPool

function bool AddToAgentPool (GameCrowdAgent Agent)

Specified by: GameCrowdSpawnerInterface.AddToAgentPool


AgentDestroyed

function AgentDestroyed (GameCrowdAgent Agent)

Specified by: GameCrowdSpawnerInterface.AgentDestroyed


AnalyzeSpawnPoints

function AnalyzeSpawnPoints (int StartIndex, int StopIndex, Object.Vector ViewLocation, Object.Vector PredictionLocation)


CreateNewAgent

function GameCrowdAgent CreateNewAgent (GameCrowdDestination SpawnLoc, GameCrowdAgent AgentTemplate, GameCrowdGroup NewGroup)

Create new GameCrowdAgent and initialize it

DisplayDebug

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

Overrides: Actor.DisplayDebug

Use 'GameDebug' console command to show this debug info

Useful to show general debug info not tied to a particular concrete actor.

InitializeSpawnPoints

function InitializeSpawnPoints (Object.Vector ViewLocation, Object.Vector PredictionLocation)

Fill PotentialSpawnPoints list. Once it is filled, initially fill PrioritizedSpawnPoints with visible points for first frame pop fill

OnGameCrowdPopulationManagerToggle

function OnGameCrowdPopulationManagerToggle (SeqAct_GameCrowdPopulationManagerToggle inAction)


PickSpawnPoint

function GameCrowdDestination PickSpawnPoint ()

Returns:

best spawn point to spawn next crowd agent

PrioritizeSpawnPoints

function PrioritizeSpawnPoints (float DeltaSeconds)

Prioritize GameCrowdDestinations as potential spawn points

ValidateSpawnAt

function bool ValidateSpawnAt (GameCrowdDestination Candidate)

Determine whether candidate spawn point is currently valid