UnrealProjectBanner.png

Unreal engine third person controller

Engine: Unreal Engine 5 Early Access

Tools: Blueprints, C++ 2019, C++

Marketplace: Amplify Animation Pack

test footage

 
 

Summary

A “controller” (as I understand it) is a container of logic that reads player input and applies that input to a series of rules, with the end end result being a set of instructions to move a character or characters in the game. A “third-person controller” is specifically a controller for games in which the player-character can be observed and controlled in a three-dimensional environment. The games I am deriving this from include Legend of Zelda: Breath of the Wild, the Uncharted series, and Assassin’s Creed.

Goals

I have several objectives for this project:

1.       To prove to potential employers that I have the skills to make 3d action-adventure titles as a technical designer.

2.       Learn how to use the Unreal Engine to prototype and implement features with minimal technical assistance from team members.

3.       Learn how to program 3D games in C++ using the Unreal Engine in case Gameplay Engineer roles are more readily available.

4.       Learn how to design 3D environments for third-person action-adventure games.

5.       Create additional content for my demo reel. It would be great if I could append this to my demo reel for future employers to view.

Features

Game Design

  • Intuitive and performative: I want the character’s controls to be as simple as possible so the player is able to focus their attention on more important tasks in action-adventure games such as navigation and the detection of opponents and consumable items.

  • Minimize “Button Twister”: many action and adventure games suffer from a button layout that makes certain play styles and/or strategies more difficult due to the order buttons have to be pressed and/or held, resulting in what I like to refer to as a variation on the board game Twister on the controller. As I develop features for this game, I want to find ways to minimize “Button Twister.”

Control State System

  • I am using a design pattern known as the state pattern to develop a system that interprets player input based on the character’s current location and action - walking on the ground, in midair, hanging on a ledge, etc.

  • The parent, abstract class is implemented in C++, while child classes are implemented in Blueprints. This allows designers to iterate features while minimizing the number of nodes required in Event Graphs, making systems easier to navigate and program.

  • An enumeration in the Animation Blueprint is updated each time the Control State System switches between states. This allows the Animator’s state system to be synchronized with the Control State System. Additionally, more enumeration values can be added in case multiple animations need to be played in a single state.

Platforming Function Library

  • Problem: Many functions I create inside a single State Class often can be reused in a different State class, which requires either a reference to the State class containing the function in another class. Placing a frequently used function in the Abstract class is also bad because not every State class will need it, and the function might also be needed by non-State classes.

  • Solution: was to create a C++ function library that inherits the UBlueprintFunctionLibrary class. It contains functions that handle behaviors common to platforming, such as vector math and line tracing. Because it inherits from UBlueprintFunctionLibrary, and all functions must be static, I can use these Blueprint functions in State Classes, the Character class, and any other class I will add in this project.

  • All functions static: in this library is declared static, and its parameters are declared const as best practice to ensure any objects passed into these functions remain unchanged.

Phase 1 (complete)

This first phase had several key tasks:

  • Project Setup: I set up the Visual Studio project, learned how to use their macros to implement the design patterns I needed, and inserted C++ classes between blueprints and Unreal’s classes to create a hybrid Blueprint/C++ project.

  • Animation Replacements: I swapped out the complementary animations Epic provides with Amplify’s equivalent animations. I estimated if I kept Epic’s animations the character’s movements would be less consistent.

  • New Abilities: each ability required almost identical steps to implement: retargeting animations to the Unreal Engine mannequin character, creating new Input State classes and defining their logic, creating new animation states in the Animation Blueprint, and updating logic in the Animation Blueprint’s Event Graph. Additional work was necessary if an animation had to be triggered with a Montage.

    • Sprint: press a button to sprint. Eventually many abilities will have a regular and a fast animation, so “Sprint” will also tell the character to climb or sneak faster.

    • Hang on ledges: The character will snap onto ledges they couldn’t reach (if movement is upward) or step onto (if falling). Ledge detection is “programmatic”, meaning line traces are used to determine the character’s proximity to walls and ledges.

    • Climb up ledges: a mantle animation will play when the character is in the climb state, either by tilting the analog stick upward or pressing the jump button.

    • Climb small ledges/high steps: A mantle animation for the character to climb up a step whose ledge reaches the character’s midsection.

    • Mount a ledge in midair: when the character is in midair but can’t quite reach a ledge (if their knees bump into it, for example) if they are close enough the character will still be able to take a huge step forward and climb successfully.

Phase 2 (in development)

What’s next for the project:

New Abilities

  • Ladder Climbing: the character will be able to detect ladders, interact with them on contact, and climb and descend.

  • Scaling Ledges: the character will have the ability to move left and right when in the Hanging state using the analog stick.

  • Crouching: I would like to implement crouching and crouching movement, tying the control to a single button on the game controller.

  • Vaulting: in the Sprinting state, the character will be able to vault over obstacles of particular heights and depths.

new features

  • Distance Matching: I would like to incorporate distance matching techniques into this game to create more realistic movements. If my theory is right, it will also make some animation states easier to detect.

  • Foot IK Solvers: I want to have more control over the character’s foot positions to add a sense of realism to ordinary walk and sprint cycles. Foot IK solvers would let me detect where steps are and at what position/angle each foot should take.

  • Updating the Midair Mantle: Mantling ledges while in midair needs a new animation and some additional code to run smoothly.