top of page

Tower Defense

For a computer science class at Sheridan, a group of friends and I created a game using Processing. This helped us learn how older games functioned and gain a more in depth understanding of frame by frame game computation. 

​

Processing provided us with the ability to create elementary shapes, make calculations, and render once per frame. It was my responsibility to create an animation system inside of Processing as well as handle various other coding hurdles. 

Game Balance

Wave Scaling

We designed the wave scaling in Tower Defense to be infinite so the player would keep trying out new turret combinations and eventually would wonder "when will it end?"

​

The waves scale in two ways. I programmed the first to scale by increasing the overall unit count. The equation for how many enemies will be in the wave is 5 + (WaveNumber * 2). This produced the cleanest raise in unit count during testing, and the best gameplay experience.

​

The second way the wave changes as you play is the ratio of light to  medium to  heavy units. As the player completes a wave,  2.5% of light units are turned into heavy or medium units until light units comprise only 30% of the wave population.  

LINK TO: Tower Defense 2D Asset BreakDown

Enemy Armour Scaling

Late in the design process my teammates and I realized that it was becoming almost impossible to scale out turret damage output. We always had one turret type that could be easily spammed to win the game. Most of the time it was the light turrets. This was because they could deal a small amount of damage very quickly (as opposed to the heavy turrets which dealt a large amount of damage in one shot), which allowed them to spend the shortest amount of time killing an enemy. 

​

The team knew that we wanted all the different turrets to be relevant and have their own job or enemy unit to counter. It was my job to make this possible.

 

The solution that I found was to give enemy units armor.  

​

I took inspiration from Path of Exile, one of my favorite games, and programmed the armor so the amount of armor you needed to reduce the damage from the hit increases exponentially with the damage of a hit. This way, I could weaken the light turrets significantly against heavier enemies and moderately against medium enemies while still keeping the medium and heavy turrets relevant through heavier hits and lower rates of fire.

​

To go into more detail, the armor value needs to be 5x the hit value to reduce the damage from a hit by 1/3. To protect against 2/3 the damage of a hit the armor value must be at least 20x the hit value - and so on, until to protect against 9/10 the damage of a hit the armor value must be 90x the hit value. This means that when a heavy unit (2,500 health, 1,500 armor) is attacked by a light tower, it has an effective health pool of 14,600 -- so it will take 40 seconds of constant fire from a single light tower to kill. This is contrasted with when a heavy unit is attacked by a heavy tower (effective health pool of 3,290) and will take 7 seconds of constant fire to kill.  

​

This system makes heavy hits significantly more valuable than light ones. In order to ensure the heavy towers weren't overpowered, I made the light and medium units significantly faster then the heavy units. This coupled with the slower fire rate of the heavy towers prevented light and medium units from being easily handled by a heavy tower. 

​

My Contributions

LINK TO: Tower Defense 2D Asset Breakdown

> Animations for all 3 enemy types

> Animation code within Processing that can be applied across multiple enemies and methods

> All sprites, tiles, animations & sound FX

> Game balance

> Enemy class

> Spawn class

> Wave controller

> Wave timer

> Turret classes

Sound FX Design

For designing the sound effects in this game I initially started by using FL Studio -- in particular I experimented with using the synthesizer Harmless. After numerous failed attempts at making a laser sound I decided to try my luck with Harmor.  

​

I ended up using Harmor for all of the sound synthesis in Tower Defense. Through control of the pitch envelope and volume envelope, I was able to create the light tower attack sound effect. 

​

After that I increased the distortion, lowered the total pitch of the sound, and then increased the chorus to 6 to create the heavier firing sound associated with the medium tower. 

​

In order to get a more guttural sound with my heavy tower firing I increased the number of modulations in my pitch envelope and lowered the pitch further. To really drive the growl of the heavy cannons I cranked the distortion to maximum, lowered the chorus slightly to reduce clutter, increased pitch, and then set an offset in order to get more modulations in a short time span. This made it so even when the shot overlapped with itself it still remained distinct.

​

However, I soon discovered that with all the turrets firing at once, the game player would quickly experience audio fatigue. To combat this I randomized the pitch of every shot and did the same with the volume. By randomizing the volume and pitch from 0  to X I was not only able to reduce audio fatigue but also able to stop a significant portion of the sound effects from triggering. And all this without taking away from the implementation of each sound.

Only Assets Created by joseph ballantyne are showcased

bottom of page