Games Development / Task 4: Final Project

  • Week 09 – Week 14
  • Due at 12/01/2025

Task

Develop a game that integrates all the art assets in our game development and produces a fully functional and playable game.



 QUEST FOR THE SCATTERD CRYSTAL

Hierarchy for All Levels 

Figure 1.1 Home Page Hierarchy

Figure 1.2 Level 1 Hierarchy

Figure 1.3 Level 2 Hierarchy

Figure 1.4 Level 3 Hierarchy

Figure 1.5 Level 4 Hierarchy

Figure 1.6 Tutorial Hierarchy


Some Prefabs in Unity

Figure 2.1 Prefabs in Unity

Figure 2.2 Prefabs in Unity

Animation and Animator 

To start the assignment, I focused on the animation. However, it didn’t function as expected despite several rebuilds. After multiple attempts, I decided to shift my attention to creating the background and platform first. This step-by-step approach proved effective, and once the foundation was complete, the animation finally worked as intended.

Below is the Animator that i have :

Player Movement 

  • Soren Idle
  • Soren Walk
  • Soren Jump
  • Soren Attack
  • Soren Die
  • Soren Being Attacked
Figure 3.1 Player Animator

Door 

  • Door Idle
  • Door Open
Figure 3.2 Door Animator

Enemy

  • Spider Idle
  • Bat Flying
  • Bat Idle
  • Demon 1 Walking (Front and Back)
  • Enemy Being Attack Animation (All)
Figure 3.3 Caves Spider Animator (Enemy)

Figure 3.4 Spider Animator (Enemy)

Figure 3.5 Demon Animator (Enemy)

Collectibles

  • HP Item Idle
  • Power-Up Idle
  • Crystal Idle
  • Crystal Collected
Figure 3.6  Collectables Animator 

Final Big Boss

  • Boss Idle
  • Boss Summon/Call
  • Boss Walk
  • Boss Die
Figure 3.7 Final Boss Animator (Enemy)


Level Design and Script Management

Player
  • Player Movement (Player Movement and Animation / Jumping / Combat / Health System / Power-Ups  / Audio Management / Item Collection / Game State Management / Physics and Collisions)
  • Player Movement 3 (Player Movement and Animation / Jumping / Combat / Health System / Power-Ups / Audio Management / Item Collection / Game State Management / Physics and Collisions)
  • Knockback (Player Movement and Combat / Physics and Collisions)
  • Player Fall (Game State Management / Physics and Collisions / Player Death Logic)

Enemy

  • Enemy Damage Spider Cave (Enemy Behavior / Damage and Health System / Animation Handling / Combat Interaction)
  • Bat notflying Level 4 (Enemy Interaction / Damage System / Animation Handling)
  • Follow Enemy (Level Behavior and Combat System) (Player Following / Combat Mechanics / Knockback System)
  • EnemyFinalLevel (Player Detection & Following / Vertical Movement / Damage & Combat / Health Management / Animation)
  • Demon1Level4 ( Movement / Combat Mechanics / Knockback System / Death and Cleanup)
  • EnemyDamageSpider (Movement / Combat Mechanics / Knockback System / Death and Cleanup)
  • EnemyAI (Player Following / Combat Mechanics (damage/Health) /  Knockback System / Death & Cleanup /  Special Features (boss call/enemy spawning/movemet)

Ui 

  • WinController ( Scene Transition / Exit Game / Button Sound / Fade Logic / Error Handling )
  • MenuController ( Scene Transition / Exit Game / Button Sound / Fade Logic / Error Handeling / Scene Loading / Game Quit )
  • PowerUpSliderHandler (  Power-Up Countdown / Slider Management / Error Handling / Coroutine )
  • SceneFadeManager ( Scene Transition / Fade In / Fade Out and Load Scene / Scene Change / Coroutine)
  • BackgroundMusicController (Music Control / Fade Out / Error Handeling)
  • ButtonController ( Button Interaction / Button Sound / Music Fade-out / Error Handeling)
  • GameOverManager ( Game Over UI / UI Button Management / Restart Game / Quit Game )
  • SceneController ( Singleton Pattern /  Level Transition / Custom Scene Loading )
  • PauseManager ( Pause and Resume Game / Button Sound and Interaction / Pause and Resume Toggle / Quit Game / Coroutine for Sound and Action )


Game Data
  • GameData (Track Crystal number / maintain Crystal ID /  Singleton Pattern / Scene Loaded Callback / Player Death Handling / Death Sequence )
  • GameData2 (Crystal Count Tracking / Game Over UI Handling /  Scene Restart Functionality / Scene Loaded Callback / Quit Game Functionality )
  • GameData3 ( Tracks Game Data /  Scene Restart / Scene Loaded Callback / Quit Game)

Collectables
  • HealthPickup ( Health Pickup Behavior /  Healing the Player / Playing Collected Sound /  Destroying the Pickup )
  • HealthPickUp4 ( Health Pickup Behavior / Healing the Player / Destroying the Pickup )
  • UICrystalManager2 ( Initial Setup /  Resetting the Crystal UI  / Updating the Crystal UI )
  • HeroCrystalController - For crystal and hero UI ( Hiding Hero UI / Debugging )
  • PowerUpSliderHandler ( Power-Up Countdown UI / UI Visibility / Error Handling)

I began by designing the first level. For levels two and three, I reused the same script to maintain consistency, while the final level required its own unique script. At times, I found myself confused about which script corresponded to which level. This confusion stemmed from poorly named scripts and a lack of proper tracking for where functions were implemented.

During the scripting process, I often lost track of what each part was doing, making it difficult to distinguish between reusable and redundant elements. As a result, the scripts for the same functionality often ended up slightly different. This inconsistency caused frustration and made it challenging to streamline the code.

When building levels two and three, I encountered a problem with the Game Over UI, which didn’t function correctly. To resolve this, I rebuilt these levels using the foundation from level four, which I had redone from scratch. While some scripts from the original versions were carried over, most were replaced by elements from level four’s finalized script.


Ui and Interface

The game interface was designed to provide a seamless and intuitive experience for players. Key components include:

  • Home Menu: The central hub for navigating the game.
  • Game Over Menu: Displays upon losing a level, offering the option to restart or return to the Home Menu.
  • Winning Menu: Celebrates success and provides an option to proceed or replay.
  • Tutorial Page: Guides players on game mechanics, such as walking, jumping, attacking, and collecting items. This page also introduces the game’s story to set the tone for the adventure.

The interface ensures players can easily navigate through the game and access the information they need to enjoy their experience fully.

Figure 4.1 Home Page

Figure 4.2 Game Over Page (Not Fix)

Figure 4.3 Winning Page

Figure 4.4 Tutorial Page (When Enter)

A simple card design is displayed at the start of each level to inform players about their objectives and the control keys they need to use. This ensures clarity and helps players better understand their tasks before starting the level.

Figure 5.1 Instruction Cart For Level 1/ 2 / 3
Figure 5.2 Instruction Card For Level 4

Sound Effect

Last but not least, I have included sound effects (SFX) and background music (BGM) in the game to make it more immersive and engaging for the player. These sound elements enhance the gameplay experience by providing audio cues for various actions and events:

  • Movement Sound: Lets the player know they are walking.
  • Collection Sound: Confirms when a player has collected or returned an item.
  • Attack Sound: Alerts the player when they are being attacked.

The combination of BGM and SFX in Unity helps to create a dynamic and interactive environment, ensuring that players remain immersed in the game world.

Figure 6.1 BGM and SFX in Unity


Upload Process 

When I tried uploading, I encountered an issue. The first time I uploaded the UI for all levels, it was not positioned correctly. So, I had to adjust and realign everything. After making the necessary adjustments, I published the project on Netlify, but it wasn’t working as expected. To resolve the issue, I attached another script to make it function properly. below is my upload process 

Figure 7.1 Convert To WebGL In Unity



Figure 7.2 WebGL File


Figure 7.2 After Upload to Netlify

Game Document

Below is the Final Game Document
 
Consultation Feedback
  • Sound effect is more important 
  • make attack more faster
  • make the collect item effect for that 
  • the instruction need to be more clear ( make it in all level)

Game Outcome

WebGL/Unity File/Presentation Video/Walkthrough Video (Drive) - Link

Walkthrough Video

Presentation Video


Reflection

In this assignment, which builds upon the Assignment 1 game proposal, it has been the most challenging module of this semester for me. Since I had no prior coding experience and my coding skills were quite weak, I spent a lot of time exploring and learning the basics of Unity and C# scripting. Additionally, this was my first time using Unity, making the process even more difficult.

Although the assignment was very challenging, every time I managed to solve a problem or get something to work, I felt a great sense of satisfaction and happiness. This made the assignment and project more enjoyable. It also gave me insight into how computer games are created.

Throughout the process, I faced several challenges, but I eventually found solutions. For example, the UI button wasn’t working, and I discovered that I simply needed to add an event system for it to function properly. In the final level, the enemy spawning wasn’t working, so I tweaked the attack mechanics for the final boss to achieve a proper boss fight. Additionally, before adding the fade-in and fade-out effects when transitioning between scenes, the scene change looked strange, as if the player was suddenly jumping to another scene. After applying the fade effects, I ran into a new problem: the game-over UI and other elements didn’t appear. I solved this by adjusting the layer sorting.

The biggest issue I faced was with the triggers and collisions in my scripts, which kept malfunctioning. I realized I need to be more careful when handling these in the future.

However, through this assignment, I gained valuable experience with Unity and coding. I became more comfortable with basic coding and learned how code components work together in a game. Overall, this assignment taught me how to develop a 2D game, use Unity, write C# scripts, and enhance my problem-solving skills.


Comments

Popular Posts