I don't need to test my programs. I have an error-correcting modem.

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[edit]

Property group 'GameCrowdPopulationManager'[edit]

bWarmupPosition[edit]

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[edit]

AgentArchetypes[edit]

Type: array<SeqAct_GameCrowdSpawner.AgentArchetypeInfo>

Archetypes of agents spawned by this crowd spawner

AgentCount[edit]

Type: int

Number of currently spawned crowd members.

AgentFrequencySum[edit]

Type: float

Sum of agent types + frequency modifiers

AgentLightingChannel[edit]

Type: LightComponent.LightingChannelContainer

Lighting channels to put the agents in.

Default value:

Member Value
bInitialized True
Crowd True

AgentPool[edit]

Type: array<GameCrowdAgent>

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

AgentWarmupTime[edit]

Type: float

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

Default value: 2.0

bCastShadows[edit]

Type: bool

Whether agents from this spawner should cast shadows

bEnableCrowdLightEnvironment[edit]

Type: bool

Whether to enable the light environment on crowd members.

bForceNavMeshPathing[edit]

Type: bool

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

bForceObstacleChecking[edit]

Type: bool

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

bHaveInitialPopulation[edit]

Type: bool

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

bSpawningActive[edit]

Type: bool

Controls whether we are actively spawning agents.

Default value: True

HeadVisibilityOffset[edit]

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[edit]

Type: float

How much population to add first tick

Default value: 0.2

KilledCount[edit]

Type: int

Agent spawning stats

MaxAgentPoolSize[edit]

Type: int

Maximum size of agent pool

Default value: 20

MaxSpawnDistSq[edit]

Type: float

Square of max distance allowed for spawns

Default value: 4.0E8

MinBehindSpawnDistSq[edit]

Type: float

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

Default value: 2.5E7

PlayerPositionPredictionTime[edit]

Type: float

How far ahead to compute predicted player position for spawn prioritization

Default value: 5.0

PoolCount[edit]

Type: int

Agent spawning stats

PotentialSpawnPoints[edit]

Type: array<GameCrowdDestination>

List of all GameCrowdDestinations that are PotentialSpawnPoints

PrioritizationIndex[edit]

Type: int

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

PrioritizationUpdateIndex[edit]

Type: int

Index into prioritization array for updating prioritization

PrioritizedSpawnPoints[edit]

Type: array<GameCrowdDestination>

Ordered array of prioritized spawn GameCrowdDestinations

Remainder[edit]

Type: float

Used by spawning code to accumulate partial spawning

SpawnedCount[edit]

Type: int

Agent spawning stats

SpawnNum[edit]

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[edit]

Type: float

How frequently to reprioritize GameCrowdDestinations as potential spawn points

Default value: 0.4

SpawnRate[edit]

Type: float

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

Default value: 50.0

SplitScreenNumReduction[edit]

Type: float

How much to reduce number by in splitscreen

Default value: 0.5

Default values[edit]

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

Functions[edit]

Events[edit]

PostBeginPlay[edit]

event PostBeginPlay ()

Overrides: Actor.PostBeginPlay


SpawnAgent[edit]

event GameCrowdAgent SpawnAgent (GameCrowdDestination SpawnLoc)

Actually create a new CrowdAgent actor, and initialise it

Tick[edit]

event Tick (float DeltaSeconds)

Overrides: Actor.Tick

FIXMESTEVE - Nativize?

Other instance functions[edit]

AddPrioritizedSpawnPoint[edit]

function AddPrioritizedSpawnPoint (GameCrowdDestination GCD, Object.Vector ViewLocation)

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

AddToAgentPool[edit]

function bool AddToAgentPool (GameCrowdAgent Agent)

Specified by: GameCrowdSpawnerInterface.AddToAgentPool


AgentDestroyed[edit]

function AgentDestroyed (GameCrowdAgent Agent)

Specified by: GameCrowdSpawnerInterface.AgentDestroyed


AnalyzeSpawnPoints[edit]

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


CreateNewAgent[edit]

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

Create new GameCrowdAgent and initialize it

DisplayDebug[edit]

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[edit]

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[edit]

function OnGameCrowdPopulationManagerToggle (SeqAct_GameCrowdPopulationManagerToggle inAction)


PickSpawnPoint[edit]

function GameCrowdDestination PickSpawnPoint ()

Returns:

best spawn point to spawn next crowd agent

PrioritizeSpawnPoints[edit]

function PrioritizeSpawnPoints (float DeltaSeconds)

Prioritize GameCrowdDestinations as potential spawn points

ValidateSpawnAt[edit]

function bool ValidateSpawnAt (GameCrowdDestination Candidate)

Determine whether candidate spawn point is currently valid