Exploratory 3Cs Project

This is an exploratory Unreal 5 project developed in C++ to explore the 3Cs (character, camera, control) and animation under the guidance of a mentor from Ubisoft Singapore. You can download the demo here, and view my presentation slides on the development process here.

Below are the main features I've implemented, including basic third-person character and camera control, turn in place, and feet inverse kinematics.

Basic third-person character and camera control:

  • Broadcasted input from the player controller using enhanced input and delegates to reduce coupling
  • Character animation using state machines and blended animation sequences for smooth animations
  • Additional animations such as the head turning to face the look direction is done using additive blends so they can be overlaid on different states
  • Character animation blueprint is a child class of my own UAnimInstance, which allows variable values to be calculated in C++ and exposed to the character animation blueprint for the animation graph
  • Character state represented in a struct and maintained by the character class to be passed to the animation blueprint
  • Different parameters set through data assets

Turn in place:

  • Initially implemented in a state machine in the animation graph that responds to the character state, but this made the animation hard to control and combine with other animations
  • In the end, I used slots to dynamically insert the turn animation from the character class - this gave me much more control over when and how the turn animation plays and how to blend it with other animations
  • Actual character rotation is driven by the rotation value curve on the turn animation for a more natural feel

Feet IK:

  • Implemented with foot locking using virtual parent bones, referencing the ALS implementation and rewriting it in C++
  • Lerps the location and rotation of the foot lock and foot bone position based on the floor height and current animation

Rope swing:

  • Initially tried implementing this using physics constraints, but I could not get it to work within the remaining timeline of the project
  • Switched to using a skeletal mesh and applying physics to the bones of the rope to cause the rope to swing
  • Flexibility of this approach may be limited due to the fixed number of bones in the mesh.
  • Visual desync is an issue as the character's grip is separate from its attach point, which can cause the hands to leave the rope since the bones no longer line up. Tried to solve this with manual hand bone placements but ran out of time to make it work.

This was my first time developing in Unreal using C++, so the learning curve was steep, especially since I hadn't delved too deeply into the engine even in previous projects. I purposely picked the 3Cs as the main focus of this project as it is a vital component of most games, and it forces me out of my comfort zone.

Greatest takeaways:

  • Animation system - different nodes in the animation blueprint together with general principles and considerations, even outside of Unreal
  • Movement state machine - the different parameters that go into making movement smooth
  • Unreal and C++ - compilation process using Unreal Header Tool and a debugging workflow using live coding

The process of developing this project was highly challenging. But it has been extremely rewarding, giving me the opportunity to deepen my understanding of Unreal and how it works under the hood. It has also allowed me to obtain insight from a professional in the industry. Big thank you to my mentor for giving me feedback on my C++, coding practices, and implementation ideas, as well as providing various resources and advice.