Professional Documents
Culture Documents
Character: FPS Game Starter Kit
Character: FPS Game Starter Kit
Version 2.7
Documentation Page
CHARACTER
BP_CharacterBase is one of the core Blueprints and is located in
Content/FPS_Game/Blueprints/
When you start working on your game or follow any tutorials you find online,
whenever it says “Cast To Character”, this is the blueprint you Cast To, you can
add new variables to it and access them from where you need them. I
recommend to beginners to create a child class from this blueprint and use the
child class instead, unless you want to add new features or modify the existing
setup, a child class will do the job just fine, plus it’s easier to upgrade when I
release a new version, because if you change the base classes, and I release a
new version, we don’t have the same source file anymore, so you will need to
add your changes to the new version as well. Advanced users usually branch it
off and make it their own build, then only add the new features that they actually
need.
The point is, this is the base class for the character blueprint, everything related
to it is located here, there are only 4 other blueprints that are relevant to it, those
are:
BP_WeaponBase
BP_ProjectileBase
BP_Save
W_PlayerHUD
Everything else can either be replaced or deleted, few other widgets do get
created from the character BP, but they are only there as place holders (pause
screen, etc.)
The camera switching from FPP and TPP perspectives uses 2 cameras and 2
meshes (arms for FPP and body for TPP), You can check out the tutorial I made
on how to change the character mesh in the Tutorials section or by clicking here.
The skeleton used is the default one from Epic Games, all retargetting tutorials
out there still apply.
All input keys are set in Project Settings, the character then uses them to perform
an action (jump, run, shoot, etc.)
To add a new feature that you need in your game, for example an action skill or
something, simply add a new input key, then on the character create the
necessary variables and logic to do what you need it to do.
The save system is set on the character, to make it easier to save the inventory
and other variables, such as money for example. For more info about the save
system, click here.
Because there is no custom GameInstance, any settings menu you have can be
added, simply connect it to the character at begin play.
ANIMATIONS
FPS Game Starter Kit uses the default UE4 skeleton, the only change is a
GripPoint socket for where the character is holding the weapon. Any retargetting
tutorials out there still apply. To see how to change the mesh click here.
The animations are set up so that they support IK for the left hand in order to
fine-tune its position based on what kind of weapon the character is holding. The
AnimBP reads the value from the weapon and adjusts the position, this makes it
possible to reuse the same animations for multiple weapons.
FPS and TPS meshes use different AnimBP’s, both are based on the default
UE4 skeleton, FPS template and TPS template respectively.
On a side note, the new optimization feature from 4.19 can be disabled if it’s
causing issues on your PC.
WEAPONS
All weapons in the template are child classes from 1 base class. The provided
examples are there to showcase how you would make a pistol, a shotgun, a
sniper. etc.
In general there is no need to make any changes to the base class, unless you
want to implement new features that each child class should have.
Child classes have all the functionality from the base class, plus something else
that it’s supposed to do, see the provided example weapons on how to tweak a
child class to behave a certain way.
To see a few examples that extend beyond that of the base class, see the add-
ons HERE.
See how money is being saved as reference for saving and loading “normal”
variables.
Weapons are saved automatically, you don’t need to make any changes to any
Blueprint in order to save the weapons you made, just create a weapon, pick it
up, save, done.
Enemies and other world objects do not get saved, as they aren’t part of the
Character or its inventory.
In this tutorial we will save the players location and restore it when the player
spawns, to begin, create a new variable (vector) inside BP_Save
Then open BP_CharacterBase and open the SaveGame function and set the
actors location to be the saved location vector we made in BP_Save
Last, still in the character, on begin play, set the location to be the saved location
and check the teleport checkbox
…and that’s it, the save system now has the player location too. You can repeat
the entire process for rotation as well if you want.
Basically the idea is to send the data from BP_CharacterBase to BP_Save, then
bring it back during loading.
TIP: when working with save data, it’s good to delete the save file after each
change and start a new game, to avoid unexpected behavior.
TUTORIALS
Weapons
How to make new weapons
How to add a starting weapon and why it’s related to the save system
How to make an Armory (weapon selection screen) and use it from the Main
Menu
How to bypass the inventory (drop current weapon when equipping a new one)
Character
How to change the Character Mesh
How to implement dynamic offset for TPS camera (switching position from left to
right)
How to import Substance Painter textures into UE4 and set up the material