top of page

STRUGGLE

October 2020 - February 2021

Professional Game Development Environments [CI5515]

​​

Engine: Unity
Programming Tools: Microsoft Visual Studio

Language: C#

Artwork Tools: Photoshop

Struggle_edited_edited.jpg

Game Plan

Welcome to the Struggle blog!
 

I'll be posting every 1 to 2 weeks, keeping you updated on my progress.
 

This solo project showcases Object-Oriented programming techniques, with attention to time and memory resource management, and focuses on implementing robust, well-tested code using advanced 3D game libraries and engines. The game is being developed in Unity using C#, and it is a single-player game designed exclusively for PC.
 

Last year, I created a defender game in C++. Now, I want to expand on that idea and develop a 3D tower defence game.

 

​

​

​

WEEK ONE

Tiles and Camera

I've created a 16x16 platform made up of white tiles, which will serve as the turret placement grid. Once the map was laid out, I deleted specific tiles to form a path for the enemy to follow, and I set both a spawn point and a home base.

​

Now that the map is complete in its structure, I have set the camera to face down at a slight angle.

​

5th October 2020

WEEK THREE

Enemy AI

Currently, I'm using a placement holder for the enemy. I have created waypoints for the enemy to follow that are placed on each turn, taking the enemy to the home base from the spawn point.

​

There was an issue at first with the enemy only heading towards the first waypoint, however I fixed it by incrementing waypoint index.​

​​

19th October 2020

WEEK FOUR

Enemy Waves

I've now created a simple spawning system for the enemy, setting their spawn point and adding a UI with a timer to control the spawn interval.
 

Initially, two enemies were spawning at the same time and overlapping. To fix this, I implemented a coroutine, which allowed me to pause the spawning process and prevent them from appearing inside each other.

 

26th October 2020

Base Turret v1.PNG

WEEK SIX

Turret

I've introduced the base turret, which can identify and lock onto its closest target within a specified range. I ensured that the turret rotates smoothly rather than snapping from one target to another by using quaternions, allowing it to rotate only around the Y-axis. If the turret loses its target, it will freeze in place rather than returning to its original position. The turret can now fire bullets at the enemy, with a set speed determining how fast they travel. I've also added particle effects that display on impact with the enemy.

​

Initially, the turret head wasn't rotating properly from its base. I resolved this by making the head a child object of an empty object positioned at the base. To ensure the bullets fire from the correct position, I set up another child object, similar to how I configured the turret's rotating part.

 

9th November 2020

WEEK SEVEN

Build Manager

Before I initiated the build manager, I needed to determine which node the user was selecting. I created a simple hover animation that changes the colour to grey on mouse enter and exit, signalling to the player which node they are interacting with. Then, I implemented the build manager, allowing users to build a turret in any available node while preventing them from rebuilding over an existing turret through a straightforward null check.

​

I encountered a minor issue where the turret was being placed inside the node, so I added a position offset to the transform to resolve this.

16th November 2020

WEEK EIGHT

Camera v2

The player can now move the camera using the WASD keys or the mouse. For testing purposes, I’ve set the Escape key to pause camera movement, making it easier to evaluate the gameplay.

​

Zooming in and out is accomplished with the mouse scroll wheel, and I’ve implemented limits to prevent users from zooming too far in or out, ensuring they stay within the game environment.

​

23rd November 2020

WEEK NINE

Shop

The UI has been designed to allow users to select from the available turrets, currently limited to two options.

​

The build manager now stores the different types of turrets that can be built using prefabs, along with a shop script that selects the turrets from the build manager. The selection animation only appears when the user has chosen a turret to place while hovering over the nodes.

​

I encountered a small bug where clicking the turret button would place a turret if a node was behind it. This was easily resolved by using IsPointerOverGameObject(), which I implemented within the on mouse enter and on mouse down functions.

​

30th November 2020

One Cannon Turret v1_edited_edited.png

WEEK TEN

Cannon Turret

Using a different model, I created a second turret that can shoot from a greater distance but has a longer reload time between shots. I ensured that the UI is linked to this new turret by creating a new button image and adjusting the shooting interval and range accordingly. Additionally, I added the rotating mechanism and firing point for this turret, along with a new bullet impact effect.
 

7th December 2020

WEEK ELEVEN

Missile Launcher Turret

I’ve implemented the rotating mechanism and firing point for the missile launcher, similar to how I did with the base turret. I also added the new missile launcher to the shop script and linked everything through the UI.

​

Next, I applied the bullet script to the missile, assigning it a travel speed and setting its range for mid to long-range attacks. Upon hitting the target, the missile triggers a particle effect explosion, which damages other targets caught within its vicinity.​​

​

14th December 2020

WEEK TWELVE

Shop Currency and UI 

By extending the shop script, I created a turret blueprint script that includes the turret's name and cost. The player’s stats, specifically their money, are now recorded, allowing them to spend funds on turrets. Once the player runs out of money, they can no longer build.

​

To enhance user experience, I added colours to the nodes to indicate whether building is allowed or if insufficient funds prevent construction. Players can now see their available money through a simple text string in a separate MoneyUI script. Additionally, the wave countdown format has been updated to display milliseconds. Once turrets are built, their prices are visible on each turret button, and a build effect plays upon construction.

​

21st December 2020

WEEK THIRTEEN

Lives

In addition to tracking player stats, I’ve included a record of lives in the same space as the money. The UI is positioned at the top to display the number of lives remaining, which updates through a text string in the LivesUI script.

​

Currently, every time an enemy reaches the home base, the game deducts one life; however, the game does not end when lives reach zero. To address this, I created a game manager and established a game-over condition based on the number of lives.

​

I also set up health for the enemies, along with a specified damage amount for the turrets. When an enemy is defeated, the player receives money to spend on additional turrets.

​

Finally, I added a death effect that plays upon the enemy’s defeat.

​

28th December 2020

Laser Turret v1.PNG

WEEK FOURTEEN

Laser Turret

I created the UI button for the new turret, including its price, and set it up within the shop script. The laser is designed using a line renderer, and with the materials prepared, I updated the turret script to incorporate the laser under a separate heading, allowing it to be enabled or disabled.

​

The laser will also slow down any enemy it contacts by 50% while dealing damage over time.

​

I configured the line renderer to stretch from the turret's fire point to the target's position. I encountered a minor issue where the laser continued to hit the last known position of the target even after it had exited the range. I resolved this by adding a condition in the update function: if the target is null while the laser is active, it will stop firing and only resume when a new target is acquired.

​

A new laser impact effect has been created, simulating continuous damage as if the laser is burning the enemy. This effect plays at the target’s position while it is being attacked and stops when the attack ceases. Additionally, I added a glowing effect that works similarly to the impact effect.

​

4th January 2021

Sentry Gun Turret v1_edited_edited_edited_edited_edited.png

WEEK FIFTEEN

Sentry Turret and Game Over

I created a new sentry turret that fires rapidly at close range with little damage. This process was quick, as I only needed to edit the relevant variables from the standard turret and apply them to the sentry. Players can now select each turret and choose to upgrade or sell it. Upgrading costs double the turret’s initial price, while selling returns only half of what the player spent. I also developed new animation effects, bullet types, and materials for the upgraded turrets, using different models.

 

I encountered a minor issue where players could keep upgrading a turret, but I addressed this by ensuring that once a turret has been upgraded, the upgrade button becomes inactive.

​

Additionally, I created a Game Over UI that activates when the player's lives are reduced to zero. Camera movement is disabled during the game-over state. There was a small issue with the game getting stuck in the game-over state when changing scenes, so I implemented a reset function to clear this condition each time the scene reloads.

The UI now allows players to see how many rounds they survived and offers options to retry or return to the main menu.

11th January 2021

WEEK SIXTEEN

Menus Extended, Health Bar and Audio Manager

I introduced a pause menu and a main menu, complete with UI, animations, and functionality. The main menu allows players to start the game, select a level, learn how to play, and quit.

​

I also added a health bar to the base enemy, creating both the UI and the script to display the enemy’s health.

​

After incorporating sound effects and music managed through an audio manager, I created an options menu that enables players to adjust the volume, toggle fullscreen mode, and change the graphics quality. I ensured that the pause menu includes an options menu with the same settings as mentioned previously.


18th January 2021

Soldier

Soldier

The basic enemy with average health and speed.

Crawler

Crawler

A small but fast enemy with below-average health.

Runner

Runner

The fastest enemy, possessing basic health.

Ghost

Ghost

An enemy with low health that can ghost and avoid detection by the turrets.

Tank

Tank

The slowest enemy, but it has extremely high health compared to its counterparts.

WEEK SEVENTEEN

Enemies 

Each enemy has unique health, speed, and abilities to help navigate toward the home base. The most challenging aspect was implementing the ghosting ability, which I achieved by changing the enemy's tag to "ghost" every few seconds to prevent the turrets from targeting it as each enemy is targeted through a tag named "enemy".

​

25th January 2021

WEEK EIGHTEEN

Scene Fader, Enemy Waves, Selecting and Unlocking Levels and Win Condition

I added a scene fader to smoothly transition between scenes, replacing the instant load with a more visually appealing effect.

​

I extended the enemy waves, allowing players to choose the types of enemies that spawn, the quantity, and the rate at which they emerge from their base.

​

Additionally, I designed the UI for level selection and integrated it into a new scene. I linked all the buttons to each of the three levels, created new levels, and adjusted the difficulty by modifying the starting lives, initial money, and enemy counts. Levels 2 and 3 are locked and can only be unlocked by completing the previous level.

Finally, I implemented a win condition and designed the UI to allow players to advance to the next level once it has been completed.​

​

1st February 2021

Level 2_edited.png

FINAL PROTOTYPE

The game is now complete with three levels, and all bug fixes have been addressed. It took a significant amount of time to understand the creation process, but the effort was definitely worth it.
 

Please take a look at the video link below to view the gameplay: Gameplay Video.
 

Thank you for your time, and onto the next project!

07446820908

  • avjix4tms
  • Linkedin
  • Instagram

©2020 by Aymen Baccouche

bottom of page