featured
​Student BAFTA nominated, Harp Song, is a game I worked on for 8 months as my graduation piece from a Masters in Game Development at the National Film and Television School.
​
Please watch the trailer below and scroll down to see systems that I implemented.
trailer
Harp Song is a narrative-adventure game set in ancient Ireland.
​
Inspired by Irish mythology, our heroine, Clár, is pulled into an on-going war between the old Gods.
​
I was responsible for the gameplay design, programming and technical design amongst other things.
character controller
I created a state-based character controller with flexibility and scalability in mind.
​
The controller was built from the ground up using a rigidbody and featured movement states such as: idle, walk, run, jump, traversal of stairs and slopes and also a levitation/flight state. It also incorporated foot/leg ik.
​
The state machine is a fully encapsulated system that acts as a collection of components that can be attached dynamically to an object when the state is changed. The player can only be in one state at a time, and the state changes are controlled from within the system itself; the state machine does not allow for changes from outside of the system.
​
This system also worked in tandem with Unity's mechanim system for animations which was a challenge in itself!
![](https://static.wixstatic.com/media/c3c09a_b8e2a640fce746dab13f5eb5abd8341d~mv2.png/v1/fill/w_951,h_661,al_c,q_90,enc_avif,quality_auto/c3c09a_b8e2a640fce746dab13f5eb5abd8341d~mv2.png)
![](https://static.wixstatic.com/media/c3c09a_80b2cb19c3d1430cab776ba078e61867~mv2.png/v1/fill/w_895,h_602,al_c,q_90,enc_avif,quality_auto/c3c09a_80b2cb19c3d1430cab776ba078e61867~mv2.png)
![](https://static.wixstatic.com/media/c3c09a_b8e2a640fce746dab13f5eb5abd8341d~mv2.png/v1/fill/w_951,h_661,al_c,q_90,enc_avif,quality_auto/c3c09a_b8e2a640fce746dab13f5eb5abd8341d~mv2.png)
![ClarPhoto.PNG](https://static.wixstatic.com/media/c3c09a_518fa14107a94483908d417bcbd73231~mv2.png/v1/fill/w_296,h_438,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/ClarPhoto_PNG.png)
interactions
I designed and coded an object interaction system for the game.
​​
I wanted a system that would display an icon to show any and all nearby interactable objects, and to ensure efficiency, make sure this wasn't being checked for from within the update loop.
​
I then wanted a different icon when you were close enough to interact providing there is nothing blocking the player's line of sight.
​
I wanted it to be 'drag and drop' onto any object, and depending on the type of item being interacted with, the interaction event had to differ.
audio & subtitles
As Harp Song is primarily narrative, I wanted to have a robust audio and subtitle system that would be easily editable.
​
Having the text be easily editable meant that I decided to store the script in a json and trigger the lines as needed using a dictionary. This worked well enough until I wanted to trigger events using audio cues which meant modifying the dictionary to output two values for every key.
If the event value was null no event would be called.
​
There was to be a mix of world space and canvas subtitles, however having multiple world space canvases is costly, so I decided to only have the one and reorient it as needed.
Some of the voices/sfx were to come from randomly positioned 3D audio. Likewise, some of the subtitles would be randomly positioned canvas text boxes.
​
I did not want to be checking for every single audio trigger within the update loop so I created some master nodes that would perform distance checks and activate the relative audio triggers as you entered each section of the game. These audio triggers then also worked off distance checks.
patterns
When first designing the project, I took into account scalability and efficiency of the code.
In addition to the State pattern used for the character controller, I decided on a few game development patterns that I thought would be useful and implemented them:
A Service Locator to decouple complex relationships between dependencies - this took the form of referencing a dictionary of non-mono-behaviour scripts relating to the character controller.
​
An Object Pool to store all my visual effects for calling as needed.
​
A (mono/generic) Singleton and made sure it was not overused!
The singleton was responsible for ensuring each script it was attached to was the only copy of itself in the scene - deleting others if necessary and using lazy instantiation in order to create the object if one does not already exist in memory.
![Object Pool Code](https://static.wixstatic.com/media/c3c09a_8ea97118abbf4de284833333748ebff0~mv2.png/v1/fill/w_311,h_481,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/ObjectPool_PNG.png)
tools & extensions
In order to make iterative testing quick and easy I implemented a number of tools and extensions.
​
Editor Scripts:
A reposition script - which would move selected object(s) to a pre-determined position and rotation.
​
A sunrise/sunset script which was responsible for altering the position, rotation, temperature and intensity values of the directional light. Altering the post processing values for the correct time of day, and adjusting the sunrise timer cycle because of the changes.
​
Extension Scripts:
I added a function for an IsNullOrEmpty() check that can be used on Lists (the same as how Unity has built in functionality for this check on strings).
​
I also added multiple Tweens for lerping and smooth-stepping floats and Vectors.
​
With all my distance checks and in particular with my interaction code, I always draw gizmos in order to visually adjust the variables in real-time in the editor.