How to create a NPC crowd

NPC crowds are an Alpha feature and should be used with care. Ensure you profile your world early to stay on target for your performance target.

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.

Example map

An example map can be found in /M2Content/Maps/TestGyms/CrowdTestGyms, which contains a crowd of 7200 characters.

Placing a NPC crowd

Defining a crowd

You can only have one NPCCrowdActor present in your level.

Start by placing a BP_NPCCrowdActor in your level. This actor manages your crowd, allowing you to configure the character it uses and other properties.

In your NPCCrowdActor, set the following properties:

  • Crowd Data: M2Content/Content/AnimatedCrowd/DA_SkeletalCrowdData_LoD1

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

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

If you only want your NPC crowd to play a restricted set of animations, you can untick the Auto Anim States checkbox and list the desired animations in the Anim State Names array. See the example mapโ€™s BP_NPCCrowdActor instance for reference.

You can leave all the other parameters as defaults.

Placing the crowd members

Place as many instances of M2_NPCCrowdMemberActor in your level as required.

These are very basic actors which you can orient as necessary. When you run the game, each one of these will be replaced with an animated crowd member.

Last updated