Jens Petter

Game Programmer

WarFair

2020


WarFair offers players a unique experience in the world of turn-based strategy gaming. It will provide you with an immersive experience where information gathering through 3D audio, the use of a third-person camera and a movement system that encourages exploration.


A link to the Itch.io page of WarFair can be found here



Project info

  • Project: WarFair
  • Role(s): Tools & Gameplay programmer
  • Engine: Unity
  • Platform: PC
  • Development time: 8 weeks
  • Team:
    6 programmers
    7 artists
    3 designers
    2 producers
My responsibilities

Lead

  • I was the programming lead for this project for about 3 weeks

Gameplay

  • Health and damage handling for the players and enemies
  • Stats for the player
  • Implementation of a backend turn system
  • Implementation of missions which are randomly chosen per level based on our procedural level generation system
  • Implementation of collectibles which were the main objectives to complete a level in the game
  • Implementation of spawning game items in a level based on our procedural level generation system

Tools

  • Implementation of a custom event system by extending the default event system of Unity

Analytics

  • Setup of an analytics pipeline using the default analytics dashboard of Unity
  • Setup of a form system in Unity where data of this form is send to the analytics dashboard of our game

Continuous Integration

  • Setup of a continuous build pipeline using Jenkins and the build pipeline of Unity
  • Implementation fo an automated Itch.io upload system using Jenkins

UI

  • In game UI
  • Tutorial UI
  • Weapon choose and upgrade UI
  • Menu

Extending the event system of Unity

I wanted to see how far I can push Unity as a tools programmer regarding events. I had around 6 years of Unity experience before this project started which is why I felt confident to tackle this interesting problem. I came across this resource which is where the current implementation of the event system for Warfair is based upon.

Implementation of this system allowed technical designers and other programmers in the team to create their own events which resulted into faster iteration of already existing gameplay elements and faster implementation of new gameplay elements.

The images here show a few examples of event listeners that are in the project. Event listeners listen for certain events to be triggered. Events triggers but also events themselves can be created by everyone where events are scriptable objects. Scriptable objects can hold any data whatsoever which makes passing these event types around in the project very powerful.

Example of all the event listeners in Warfair

Example of an event listener that executes another function via the Unity event window

Example of all the event objects in Warfair


A code snippet on how an event can be invoked is shown here where the example here shows how the audio cue event is triggered in game

public void TriggerAudioCueEvent()
{
  if (Application.isPlaying)
  {
    audioCueEvent.Invoke(new AudioCueData(audioCue, audioOwner));
  }
}     

Continuous Integration

I set up automated builds with Jenkins through the Unity build pipeline. These builds ran on working days in the evening where it notified us in the morning when everyone put on their computers if something broke in the build.

Deploying to Itch.io is also something that is done through Jenkins. A single button click will build the project and upload to Itch.io. The uploading to Itch.io was done using Butler which is the automation tool of Itch.io.

The build script in Unity that is run by Jenkins can be found here.


Scriptable objects

Scriptable objects were heavily used in the development of Warfair. Here one can see some examples of scriptable objects that exist in the project.

Example of scriptable objects for health pickups

Example of scriptable objects for characters

Example of scriptable objects for challenges

Continuous Integration

I set up automated builds with Jenkins through the Unity build pipeline. These builds ran on working days in the evening where it notified us in the morning when everyone put on their computers if something broke in the build.

Deploying to Itch.io is also something that is done through Jenkins. A single button click will build the project and upload to Itch.io. The uploading to Itch.io was done using Butler which is the automation tool of Itch.io.

The build script in Unity that is run by Jenkins can be found here.

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using BuildPipeline = UnityEditor.BuildPipeline;

public class BuildScript : MonoBehaviour
{
  static void PerformBuild()
  {
    string[] defaultScene =
    {
      "Assets/Scenes/Main_Menu.unity",
      "Assets/Scenes/Levels/Example.unity",
      "Assets/Scenes/Levels/Generated.unity",
      "Assets/Scenes/Levels/Tutorial.unity",
      "Assets/Scenes/PostGame_Menu.unity"
    };
    BuildPipeline.BuildPlayer(
      defaultScene,
      "../Build/Windows/WarFair.exe", 
      BuildTarget.StandaloneWindows,
      BuildOptions.None);
    }
}     

What I learned from this project

I learned many things about continuous integration and analytics during development of this project. I learned how to work with Jenkins to an extend that Jenkins will perform other tasks than just building a project. One of the examples for this is my implementation with Itch.io and Jenkins. I also learned how analytics are seen in games and how analytics work in Unity.

I also learned how to act as a programming lead for a team of 6 programmers. We were split up into feature teams however the task of managing 6 programmers is something that can be a bit challenging when one has barely any knowledge about leading a team. Luckily this went quite well for me I think.

Let's have a chat!


I'm always happy to talk! Feel free to contact me at any time.