Character Configuration

NOTE: This page refers to features that are only available in v27 onwards

There are a few differences from native unreal in how we set up the character that the player uses.

How we Define the Character

The Main Classes

We use a Pawn and PlayerController, same as native Unreal, but also define a MorpheusPawnActor, which handles the replication. For more details on this, see Introduction to Morpheus Networking.

Like in native Unreal, these can be controlled via the GameMode.

The core Unreal classes, like Pawn and PlayerController do behave slightly differently when using Morpheus networking. For more details, see Changes to Core Unreal Classes.

Your Avatar

Instead of using regular static meshes for your character, we use an interoperable avatar system. For details of how this is used, see Updating your character avatar

Your "Render Target"

To handle large scale, we don't use "full actors" (i.e. Pawns) per Morpheus Actor in the world. Instead, we dynamically switch between full actors, and "the crowd" (a high performance way of representing distant actors - see Crowd Rendering) based on the distance the character is away from you. For more details, see Creating a new character.

By default, the "full actor" used, both for yourself and for nearby other players, is the DefaultPawnClass defined in your GameMode. In release v40 onwards, your "crowd" is configured automatically for you. These can be controlled in your Morpheus Actor class. For more details on how to do this, see Updating your character avatar

From your Morpheus Actor class, you are able to configure your default avatar Url, and your render target. For most player characters, all you will need to set is "Use Default Pawn as Render Target Actor", and "Crowd Enabled", and it will configure things as expected.

Pawn Sets

NOTE: From release v40 onwards, using Pawn Sets to configure your render targets is no longer needed - you can instead configure your character for most use cases directly from the Morpheus Actor. For more details on how to do this, see Creating a new character

In basic cases, you will only need to modify your Pawn in the GameMode to control which class is used to represent player characters. However, there are some cases where you will need further configuration, which is controlled in the "Pawn Set". This controls all possible render targets used for the Morpheus Actor, including in the animated crowd, and what class is used on other clients.

The main fields to consider:

  • OverrideAuthPawnClass - if one is provided, this will change the pawn used when using the given pawn set, when you are the auth client. Otherwise the DefaultPawnClass in the game mode will be used.

  • LodGroup Bucket - explained in more detail in LOD Group Buckets, this allows you to specify that the given MorpheusActor is "higher priority" than others, and so should e.g. use the LOD0 Actor over other "lower priority" clients, even if they are closer.

  • LOD Levels - this ties in to MSquared's rendering system, and how it supports >1000 player events. A limited number of nearby characters are represented as complete characters (Actor render targets), and ones in the distance are represented by the animated crowd. (For more details, see Crowd Rendering)

    • For now, the only recommended class to change would be the LOD 0 Override Actor Class - this will control what actor is used to represent the nearby other players (if left as None, it will also use the DefaultPawnClass from the game mode).

How to specify the Pawn Set

The pawn set can be controlled in the following places:

  • The default pawn set can be controlled via Project Settings - Engine - M2 Engine Default Pawn Set - Default Pawn Set

    • By default, the pawn set used is DA_Pawns, which has no overrides present, meaning that the LOD0 character used will be that defined in your game mode.

    • From Release v36 onwards, the default pawn set can be obtained via the GetDefaultPawnSet helper function

    • NOTE: This requires that your character implementation applies the pawn set somewhere. This will be done for you in the example assets, but would not be the case if you started from the M2M_CharacterBase code class

  • Manually setting the pawn set, via the ApplyPawnSet helper.

    • NOTE: This is done for the local machine. If you want the pawn set to be updated on all clients, you will need to call this on all clients.

    The example character sets the pawn set to be the default pawn set on begin play.

Gameplay Changes/Additional Functionality (Deprecated)

Our default character and controller have some gameplay related additions:

Gait Speed

Instead of defining a single MaxWalkSpeed which controls the grounded move speed, we split the speed into three modes: Walk, Jog and Sprint. This gives us easy out-the-box movement speed control, e.g. starting in Jog, but pressing Shift to enter Sprint mode, or pressing Ctrl to enter Walk mode.

This is controlled via the J_CharacterMovementComponent, on the BP Character.

If you are using the deprecated roles table, you can customize the speed per role, by adding Gait Speeds to the RoleConfigurationOverrides. If no override is provided, it will use the default in the J_CharacterMovementComponent.

Jump Count

Like with native Unreal, the jump count can be controlled via the Jump Max Count field on the character (e.g. setting it to 2 will allow you to double-jump, setting it to 0 will disable jumping).

We also add the Character.JumpMaxCount live config value. This defaults to -1, but if set to a value >= 0, it will override the value in the character, allowing for live enabling/modifying the number of jumps.

Last updated

Was this helpful?