top of page
Search

First Person Framework: Multiplayer

Writer's picture: Material InteractiveMaterial Interactive

FPFM is a multiplayer ready first-person template for Unreal Engine 5 designed to eliminate busywork, bring your environments to life, and provide a highly modular starting point for your game. The main features included are a customizable locomotion system for realistic bipedal characters, a single animation blueprint for both first person view (of yourself) and third person view (of other players), and an easy-to-use component that can make any actor interactable in seconds. Other Features include:

7 Animations for Commonly Held Objects

Capability to Easily Modify and Optimize Third Person Animations for First Person View

Control Rigs for Procedural Aim Offsets, Procedural Crouch, and Foot IK

2 Animations for Melee Attacks

Expandable Footstep System with Custom Sound FX

Headbob Camera Animation with Controllable Intensity

Interactable Example Actors Such As; Doors, Lights, Torches, Flashlights, and Switches

Functional Main Menu with Server Browser



Getting Started: To start a new project using FPFM as a template, navigate to your Unreal Engine vault, locate First Person Framework: Multiplayer, and click “Create Project.” If you wish to add FPFM to an already existing project, right click on the FPFM folder in the content browser of your new project and select “Migrate.” You will be prompted with a screen that says, “The following assets will be migrated to another content folder.” Click “Okay.” On the next screen, navigate to the content folder of the project you wish to add FPFM to then click “Select Folder.” Movement:

FPFM provides a classic locomotion system that is fully replicated and ready for multiplayer gameplay. This system includes features such as; Gait Changes (Walking, Jogging, Running), Jumping, and Procedural Crouching. All of these features are customizable through variables found in the FPFM_BaseCharacter.





The following is a brief explanation of each variable: WalkSpeed: walking speed, set between 0.0 - 1.0, percentage of 450.0 cm/s JogSpeed: jogging speed, set between 0.0 - 1.0, percentage of 450.0 cm/s SprintSpeed: sprinting speed, set between 0.0 - 1.0, percentage of 450.0 cm/s CrouchDepth: depth of procedural crouch in cm TimeToCrouch: time it takes to crouch and uncrouch in seconds

CrouchSpeedModifier: crouching speed, percentage of current gait speed DefaultGait: gait that character starts with and returns to after gait modulation SpeedUpGait: gait character modulates to when pressing InputAction SpeedUp SlowDownGait: gait character modulates to when pressing InputAction SlowDown MaxStrafeGait: maximum gait that character can achieve while strafing MaxDiagonalGate: maximum gait that character can achieve while moving diagonally MaxBackwardsGait: maximum gait that character can achieve while moving backwards MaxADSGait: maximum gait that character can achieve while aiming down sights MaxCrouchGait: maximum gait that character can achieve while crouching Interaction:

All interaction in FPFM is handled through the FPFM_InteractionComponent. Any actor can be made interactable by adding the FPFM_InteractionComponent to it. Right click the component, navigate to “Add Event” and select “Add OnInteract.” This will create the On Interact event. Any logic connected to this event will execute when a player interacts with the actor.


By default, interactable actors are interacted with by looking at them and pressing the specified key. Switches are an alternative way to interact with actors.



Switches are prepared by entering a unique name in their "Name" variable and assigning that name to each actor the switch should affect using the "Switch Name" variable located in their FPFM_InteractionComponent. These variables are instance editable and can be changed by selecting actors directly in your level.



Interactable actors that are connected to a switch must be activated by looking at the switch and pressing the specified key. The included light example, "InteractableLight_Base", has extra logic to make sure it always stays in sync with the switch.



Interactable actors can be picked up and held by the character if the "Holdable?" variable in their FPFM_InteractionComponent is toggled to True.



Interacting with a holdable actor will pick it up.



Held actors can then be further interacted with by pressing a specified key.



Holdable actors have many variables that determine both aesthetics and functionality. These are detailed below:


Holdable?: determines if the actor can be held

TwoHanded?: determines if the actor should override animation for both hands

CanAim?: determines if the actor should utilize ADS

EquipTime: time to blend from the base pose to the arms pose in seconds

ArmsPose: animation to use while the character is holding this actor

SingleFrame?: determines if the ArmsPose should be single frame or looping

SingleFrameTime: if single frame, use the frame at the specified time

HeldObjectOffset: desired transform of the held actor relative to the hand_rSocket

ArmsOffset: desired transform modification of the arms in component space

ADSOffset: desired transform modification of the arms during ADS

ADSTime: time to blend from the ArmsOffset to ADSOffset during ADS

Can Melee?: determines if the held actor can be used to perform a melee attack

MeleeAnimation: Anim Montage to play when performing a melee attack





Pose Debugging:


One of the most useful features of FPFM is the Pose Debugger. This system allows you to easily modify animations meant for third person games and use them effectively in your first person project. As of writing, there are 565 results under the Animation category on the UE Marketplace, 17 of which have the tag “First Person”. This makes the ability to utilize a single animation for both the view of our own character (First Person) and other players' characters (Third Person) extremely useful. Pose Debug mode can be activated by setting the PoseDebug variable in the FPFM_BaseCharacter to true.



The Debug Settings are described below:


PoseDebug: determines if Pose Debug mode is activated PoseDebugMesh: mesh that attaches to the hand during Pose Debugging

PoseDebugAnimation: animation to apply during Pose Debugging

ArmsOffsetDebug: Arms Offset to use during Pose Debugging

ADSOffsetDebug: ADS Offset to use during Pose Debugging


After choosing the mesh and animation that you'd like to use for your interactable actor, you should select the DebugMesh in the components tab and manually adjust its location and rotation. In FPFM, if your mesh has sights, like the pistol mesh we are using in this example, its recommended that you line these up using front/back view the best you can at this stage; fine tuning can be done later.



Once you are finished with the debug mesh adjustments, click play to enter the Pose Debugger. Here you can make live adjustments and see how they will look in game. I suggest starting with adjustments to the Arms Offset as any changes made to the Arms Offset will affect the ADS Offset.



After you are happy with the view achieved by adjusting the Arms Offset, you can move on the ADS Offset, if desired.



For meshes, like firearms, that are used for precise aiming, you can make small adjustments to the Held Object so that the sights line up with the crosshair.




Once you are finished your adjustments, record all of the values with by screenshotting or writing them down. Entering them into their respective variables in a chosen interactable actor's FPFM_InteractionComponent will reproduce the view you set up while holding that actor.














 
 
 

Comments


Post: Blog2 Post

©2022 by Material Interactive

bottom of page