MSquared Character Configuration
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
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 .
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 in the given role/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 , 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).
The pawn set can be controlled in the following places:
The default pawn set can be controlled via Project Settings - Engine - M2 Engine Defaults for Roles - 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.
NOTE: This flow is planned to be deprecated in favour of using MML Avatars, or the Avatar System
These are what control the default visuals for your character. We have a number of scheme sets, that can be set for a role from the roles table. If you add AvatarSchemeSet
, to the RoleConfigurationOverrides
, and specify some entries in the Avatar Scheme Sets
list, characters will be randomly created using those definitions:
Our default character and controller have some gameplay related additions:
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 want to customize this speed per role, you can do so in the roles table, by adding Gait Speeds
to the RoleConfigurationOverrides
. Otherwise, it will use the
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.
The roles table (see ). By using a different pawn set for different roles, you can make the client change pawn upon switching role (e.g. switching to the "Observer" pawn when switching to the observer role).