Crowds of NPCs

Overview

NPC crowds provide a way to populate your world with large numbers of animated characters, bringing your world to life even in areas where players might not naturally congregate.

These NPCs have no networking or physics cost and exist solely client side. They are purely for visual flair and not must not be used for gameplay purposes, nor do they offer a guarantee of being synchronised (in appearance or animation) between two or more clients.

Placing an NPC crowd

Placing the crowd members

Crowd members can added via blueprint. The initializer, transform and anim name can be set when adding a new crowd member with Add Crowd Member

Crowd members can be preloaded via Preload Instances If you know how many crowd members will be added, calling this will make the adding process quicker.

See `BP_NpcCrowdExample for an example as to how this can be done.

Defining a crowd

Start by placing an AM2_NpcCrowdyour level. BP_NpcCrowdExample is an example of an NPC crowd actor. Either duplicate and modify this asset or create a new one for your project.

This actor is an example BP for configuring the crowd, it allows you to configure the meshes it uses and other properties.

Initializers

In your NPC crowd blueprint, the crowd meshes can be configured like below.

BP_NpcCrowdExample Initializers detail panel

Animations

The list of animations can be configured like below.

BP_NpcCrowdExample AnimList details panel

In your AM2_NpcCrowd, set the following properties:

  • Crowd Data: M2Content/Content/AnimatedCrowd/DA_SkeletalCrowdData_LoD1

  • Ism Actor Type: M2Content/Maps/TestGyms/CrowdTestGyms/BP_SkeletalCrowdIsm_LoD1

BP_NpcCrowdExample details panel

If your project has its own crowd assets, you can use those instead.

Move crowd with actor

Enabling Move Crowd with Actor in the NPC Crowd details panel ensures that crowd member transforms are updated whenever the AM2_NpcCrowd actor's transform changes. When this occurs, each crowd member's location is recalculated relative to their position in relation to the actor's transform.

When the actor's rotation is updated, the entire crowd rotates as a unified block relative to the actor's transform.

Similarly, when the actor's scale changes, the crowd members spread out or compress collectively, maintaining their relative positions, rather than altering the individual scale of each member.

Last updated

Was this helpful?