Battle Kin - Mid-level Programmer
A pet collector and battler built for Meta's Horizon Worlds. I was hired as one of the first programmers on the project and helped develop the game from initial construction to the eventual 1.0 release. Most of these features are either very non-visual or were cut from the final game, so excuse my rough sketches as an attempt to explain the work I achieved!
Features
Throughout the two years of work on the project I implemented several core features to the game, though due to the nature of the project feature requirements changed often meaning already implemented features often were cut from the game.
Back when the game was aiming to be a top-down real-time action game, I was tasked with implementing the camera for the creature combats. Since the game was targetted at a casual mobile audience we wanted the camera to automatically move to keep the action in frame and give the player one less control to worry about. Because we were using a proprietary game engine, there were no built-in helper methods for this kind of thing so I had to implement everything from scratch.
To achieve this, we find the two combatants in the arena which are furthest apart - here p1 and p3 - and place the camera object (point C) directly in between. Then to figure out the boom arm length, we can use the FOV of the camera (θ) and the distance between the two combatants plus a small margin (k) and apply some basic trig.
The rotation of the camera object is then found by finding the angle between the vector p1p3 and the x axis using trig. However, we always want the camera to be closer to the side of the player pet (p0) for visibility, so using a rotated coordinate system such that the vector p1p3 is now the new x axis, we can find out whether p0 has a negative z component and add or minus π/2 to the camera rotation accordingly
Overall this was a fairly simple test of trigonometry and a refresher for me on quaternion maths, but still quite a fun system to implement. Finally adding some lerp to the camera rotation using a quadratic curve helps keep things smooth and satisfying. Unfortunately the game moved away from the top-down perspective and moved to a side-on 1v1 game with no character movement and as such the dynamic camera was scrapped.
Refactors
One of the things I pride myself in as a programmer is my ability to identify areas of the codebase that are in need of improvement. Throughout my time on BattleKin I was often finding classes and files that were getting out of hand and when I wasn't preoccupied with a more pressing task would spend some time cleaning things up. I always really enjoy this kind of work. It always feels good to look at the end result like you've just tidied up your kitchen and know that using this will now be just a little bit easier. The only downside is that there's very little to show off on a portfolio at the end.
Process Changes
Another of my responsibilities on the project ended up being to organise various processes for our team. This included a code style guide to keep our code consistent across the project, the Git workflow for the staggered releases we were doing at the time, and since the engine we were using didn't allow for source control on world changes I organised the system we would use for ensuring we don't lose those changes especially during merges.