UEFirstPersonStoryAdventureTemplate Documentation
UEFirstPersonStoryAdventureTemplate Documentation
Documentation
Dennis Pauly, 2019
www.dennispauly.com
[email protected]
Content
Preface ...............................................................................................................................................3
1. Personalization .............................................................................................................................. 4
2. Setting up your Character .............................................................................................................. 4
3. Configure Input .............................................................................................................................. 4
4. Game Controller Blueprint ............................................................................................................. 4
5. Interaction Outlines ....................................................................................................................... 4
6. Master Blueprints .......................................................................................................................... 4
7. Inspectable Objects ........................................................................................................................5
8. Collectable Objects.........................................................................................................................5
9. Use Actions ....................................................................................................................................5
10. Inspection Objects with Hidden Clues .......................................................................................... 6
11. Readable Letters .......................................................................................................................... 6
12. Menu, Inventory, Journal ............................................................................................................. 6
13. Journal and Collectable Entries ..................................................................................................... 7
14. Doors and Keys ............................................................................................................................. 7
15. Cupboards and Drawers ................................................................................................................ 7
16. Drag Input.................................................................................................................................... 8
17. Flashlight ..................................................................................................................................... 8
18. Save and Load ............................................................................................................................. 8
19. Level Streaming ........................................................................................................................... 9
20. Example Content ......................................................................................................................... 9
21. How to Migrate ............................................................................................................................ 9
22. Changelog & Update Help .......................................................................................................... 10
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 2
Preface
Thank you for checking out my template, I hope it’s of good use for you.
This documentation should include everything you need to know to use the template. If you have any
questions, found a bug or ran to any other issue with it, please feel free contact me. And please, before
leaving a bad rating, tell me how I can improve. Please also check the Discord server for help:
https://discord.gg/KeBSxhK
If you’re happy with the template, please help me by leaving a good rating on the marketplace page.
Also, I’m always interested in your suggestions and wishes for future updates as I’m continuously
working on improving this package. Leave a comment under the product info or write a mail to:
[email protected]
Cheers,
Dennis (palinoia gamedev)
PS: If you like what I’m doing and want to support me, please check out my Ko-fi page, as asset
development is so much easier with coffee:
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 3
1. Personalization
Inside the folder Blueprints->Settings you’ll find two structures: BP_StoryAdv_Settings and
BP_UserInterfaceIcons. In the first structure, you can adjust general settings like trace distance, depth
of field, etc. BP_UserInterfaceIcons stores button icons for gamepad and keyboard keys. You can
change the icons inside the structure, so you don’t have to change it inside the widget.
Note: Please only change the default values, not the structure itself (top area inside the structure).
The included character blueprint includes a simple sprint event. Copy it to your own character, if you
like.
3. Configure Input
All needed input is already set up for both mouse and keyboard and gamepad. Do some changes if
you don’t like the default key bindings. Keep in mind that you will have to change some control hints
within the user interface.
5. Interaction Outlines
To enable outlines for interactive objects, you need to have a Post Process Volume in your level. Add
a Post Process Material to this volume and assign PP_ObjectOutline to it. You can change parameters
like outline color and thickness by opening this material.
6. Master Blueprints
This template contains various master blueprints you can create child blueprints of (or use the
example child blueprints). One of them, BP_Master_InteractableObject is the basic blueprint used for
interaction. All other blueprints are children of this “main” master blueprint. If you want to create a
new interactive object, for example a lamp, you may create a child blueprint out of
BP_Master_InteractableObject. If you want to create a new door blueprint, create a child from
BP_Master_SimpleDoor, BP_Master_DoubleSwingDoor or BP_Master_Door_DragInput as it
contains all you need for the specific kind of door. All you need to do is set up your mesh and place it
into your level. You can of course also duplicate an example blueprint.
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 4
All these blueprints (except BP_Master_Trigger) contain a component
called Object and an event called Interaction. This event will be called
when clicking on the containing Object Component. An interactable actor
can also have multiple Object components. Duplicate the inherited object
or create a new one with the tag “Interactable”. The object must have
collision enabled and block line traces at least. If you want to create a new trigger, you may create it
as a child of BP_Master_Trigger, as all children of this blueprint are saved in the save game file.
Note: The default Object doesn’t have to be interactable. If you delete it’s tag it’s just a static mesh you
can use as frame or container.
7. Inspectable Objects
The X-Y-Pivot an inspectable object is rotated in hand is the X-Y-Pivot of the actor (every object will
be placed in the middle of its Z-Axis automatically). Place your object relative to the scene to change
the inspection pivot as in the example actor blueprint. You can also change the distance an object is
inspected individually in the details panel (Inspect Distance). This number represents the distance
from the camera to the object in hand.
8. Collectable Objects
Children of BP_Master_CollectableObject_Inspect or copies of BP_CollectableObject_Inspect can be
stored in the players inventory or put back in place when they are inspected. After placing the actor
in your level, you will find various options in the details panel. Under the point “Setup” you can change
all important data about an inventory object.
9. Use Actions
Use actions are actors of a specific class that can be assigned to inventory items. If an item is used the
use action is spawned and will call its event (for example compare key IDs to open a door). The easiest
way to create your own use action is to duplicate BP_UseAction_Key and replace the existing “Event
Use Event” by your own use event. After the “Event Use Event” node place your code and then don’t
forget to destroy the actor afterwards.
Please have a look at the example use action to see how you can use the “Discard when Used?” value.
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 5
10. Inspection Objects with Hidden Clues
Since version 2.0 there are master blueprints for
objects you can inspect and find clues in. For this
you can find BP_Master_InspectableObject_Clue
& BP_Master_CollectableObject_Clue. The first
one is meant to be inspected without option to
add it to your inventory, the second one can be
inspected, put back or added to inventory.
In both blueprints, you can use an additional object, players can find (use the inherited “Clue” static
mesh component for this). Or you can place the inherited box collision called “ClueTrigger” at the spot
of interest you have on your object.
Focus on Clue Rotation The orientation the object should rotate to in order to show the clue. You need
to set this up manually by trying out values. I couldn’t find a working automatic
solution to this, but I assume this is fine.
Voice Over Sound A sound cue that’s played as the clue has been found. Leave this empty if you
want.
Voice Over Delay The time between the object has been found and the Voice Over Sound starts
playing.
Added Item This is the inventory item structure for collectable objects. If you want to add an
object to the players inventory after the clue has been found, fill in the
information about the object here. Leave this empty otherwise.
Journal Entry Add an entry here, that’ll be added to the players journal after the clue has been
found. Leave this empty if you don’t want to use it.
Clue Description This text will be added to the object description once the clue has been found.
You can also display the letters content as plain UI text using the BP_Master_ReadableLetter_HUD
blueprint as master. Place your text in the respective fields inside the Setup panel. To add a new line,
press Shift + Enter while editing the text variable.
Since template version 1.5, you can choose another master blueprint for letters, called
BP_Master_ReadableLetter_Font. This blueprint allows you to display the letter’s content as user
interface text.
To use this menu, go to Window->Levels and add MenuScene to your persistent level. By clicking on
the little icon on the upper left corner you can change the levels details. Make sure it’s not initially
visible or loaded and set the translation far away from your level so it won’t interfere with it.
The game controller will then load and unload it to create the menu, inventory or journal and also
switch the Menu Pawn and back.
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 6
13. Journal and Collectable Entries
To create a journal entry, use the BP_Master_CollectableJournalEntry as master blueprint. Every child
actor of this blueprint will be added to the inventory (stored within BP_GameController) and can then
be read in the journal. The journal menu can be opened by pressing J on the keyboard or the left D-
Pad up on the gamepad.
Like the readable letters, journal entries can have content over multiple paragraphs. There’s no
limitation by the user interface, since it is scrollable. A journal entry must have a valid name and
headline. All information is set within the Setup category in the details panel.
When setting up your door actor make sure the door object’s relative rotation Z is zero, otherwise it
wont work.
With the new update, doors have a new variable called Select Key From Inventory. Enabling this
option in combination with Is Locked? will open the inventory to search for the correct key when
player interact with that door.
You only need one mesh for cupboard doors. The one (right door) is placed regularly, the other door
(left door) must be flipped on the x-axis! This is essential, so the system knows in which direction the
door opens.
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 7
16. Drag Input
There are also master blueprints that allow players to “drag” doors and drawers as long as the button
is pressed. These blueprints have another variable called Rotation Factor or Movement Factor.
Changing this value allows you to control the translation from input to rotation or translation of the
drawer or door.
17. Flashlight
To use the flashlight with your own character you need to make some changes and additions:
1. Create a new animation asset for holding the flashlight. Check the provided example animation
for reference.
2. Create a new animation montage containing your new animation, create a new slot called
“RightArm” and select this slot for your montage. Make sure your section is set to play a loop, see
the screenshot below for reference.
3. Animation Blueprint: Change the event graph so it matches the provided example
“ThirdPerson_AnimBP”. (Right click on new copied variables and hit “Create Variable”)
4. Animation Blueprint: Change your character’s anim graph to match the provided example. If your
skeleton hierarchy and naming differs from the mannequin skeleton, replace the bone names
within following nodes to match your characters skeleton: Layered Blend per Bone & Transform
(Modify) Bone.
5. Add a socket to your character’s skeleton parented to its hand bone. Set your new created
flashlight animation and add the flashlight as preview mesh to the socket. Transform the socket
to place the flashlight correctly in your character’s hand.
6. Correct your animation and socket if the placement is incorrect / not perfect.
7. The flashlight’s material has a parameter that controls its emissive value (to make to front of the
flashlight glow). Keep this in mind when you change the material or textures of the flashlight or if
you’re going to exchange the mesh. The parameter value is set within BP_GameController.
Next, open BP_GameController. There you’ll find two functions, LoadGame and SaveGame. Open the
SaveGame function and set the variables you want to save within BP_SaveGame before the “Save
Game To Slot” node (Use the variable SaveGameInstance).
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 8
To load your variables, open the LoadGame function and drag all variables you need out of
SaveGameInstance before the loading process ends (commented out).
There are a few things to be aware of in order to use streamed in sublevels together with this
template, since we must manage collected objects, journals, etc. while we stream in or out parts of
the game world. First, add all your sublevel names to the enumeration “StreamingLevels”. This makes
it easier to keep track of all your sublevels and allows an easy selection of levels you want to stream in
or out.
Then open BP_GameController and look for the array variable called “Sublevels”. Add all sublevels of
your main level as elements to this array. You can of course also make this variable Instance Editable
and change the array content on the instance inside your level, if you have multiple persistent levels
with different sublevels assigned to them.
Now, the game will stream in (but hide) all sublevels automatically when the game starts. To stream
in a level, please use the integrated trigger actors called BP_LevelStreamingTrigger or use it as
reference if you want to stream levels in a different way. The important part is to use the functions
inside BP_GameController, instead of the default streaming nodes. This way the game controller
stores which levels are loaded when you save or load the game.
Another important thing to be aware of is that all sublevels of a main level must be loaded at all time
but can be invisible of course. This is necessary to handle interactive objects in streamed levels.
If you’re having questions about how to use level streaming with this template, please have a look at
the example level or check out the Discord channel for further help.
Mesh and textures are either engine demo content or created by me for demonstrational purposes.
Feel free to use those in your projects with suitable attribution.
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 9
within the Game Controller there are two functions: "PreLoad” and “LoadGame”. Open
these functions and change the cast node there, too.
Documentation: First Person Story Adventure Template for Unreal Engine, created by Dennis Pauly, 2019 10