I graduated from the DigiPen Institute of Technology a couple of weeks ago with a B.S. in Computer Science and Game Design. Following a very needed week-long break I began working on a project between job searching and posts like these will be a place for me to talk about my process, explain my thinking, and show off the progress I'm making.
Technology Used
The primary software I'm using for this project is Unreal Engine 5.1.1. I chose to use UE because it was the game engine I have the most experience with, and I want to continue learning more about it. Another decision I made was to use C++ in the project because while blueprints are powerful, I find organization and debugging in C++ to be better with larger projects, along with just being more comfortable in C++. Blender is another software I've started using whenever needing to alter FBX files.
I am also heavily using assets taken, usually for free, from the Unreal Engine Marketplace.
The First Week
What does the project look like now?
Camera
Rotation
The camera is an important part of the game and was the focus the start. I've had little experience working on third-person cameras prior to this project.

At first, I created a system using a camera on a spring arm (seen to the left). The main issue with this approach was that the interaction between changing the yaw (left/right) and pitch (up/down) would cause the camera to roll in unwanted ways. Initially, I attempted to fix this by using quaternions to handle the camera rotation, but this solution felt more complicated than necessary, leading me to look for another option.

After taking some time to think, about the problem, separating the yaw and pitch rotations into different components felt like the obvious way to handle rotation. Using this idea, I created a new setup for the player camera by having a scene component (gimbal) be a parent to the spring arm. Doing this allowed me to isolate the yaw to the gimbal and the pitch to the spring arm, removing the unwanted rolling effect from the previous version.
Zoom
Once camera rotation worked, I looked for ways of making it feel more dynamic. I've always liked a close over-the-shoulder camera in a third-person game. Despite enjoying this type of camera, it comes with the limitations of having the character blocking a large amount of the player's view and a cramped feeling when moving around and fighting. To combat these limitations, I decided to make the camera pull back when the player starts moving or is in combat and reset once the player returns to an idle state.
To start, I created a custom spring arm component, inheriting from UE's spring arm, called SmartSpringArm. With this component, I could create a custom interpolation curve that would move the camera between two distances from the player using a Bezier curve. Using graphing software I was able to visualize the curve and adjust the values.

Using the values and equation from the graph I was able to write code to handle adjusting the spring arm length to this curve.


Once this was working I exposed the points on the curve and the time it should take in the editor.
Conclusion
Working on this project has been a great experience, and I'm excited to see where it will go. More of these updates will be happening each week to show the progress of the project and highlight different areas. Thank you to everyone who has taken time to read this. I'll see you next week.
Comments