Games Development - Task 3 : Game Prototype
27.5.2024 - 9.7.2024 (Week 8 - Week 11)
Tan Yi-Tyng (0353327)
Bachelor of Design (Hons) in Creative Media
Games
Development
Task 3: Game Prototype
INSTRUCTIONS
TASK 3 - GAME PROTOTYPE
Instruction
Students given the task to create the prototype of their game. The
prototype doesn’t need to have the final art asset and the use of grey
boxing is allowed. The focus here is to quickly test out the game
mechanics and to troubleshoot any technical difficulties discovered
during the development. The focus should be the MVP of your game.
This includes :
• Coding movements and actions
• Coding obstacles and enemies’ interactions
• Coding game levels (Logic of the game)
Game Assets
Previous Game Assets
When I started working on the prototype in Unity, I soon realized that the
previous game assets and gameplay I had proposed were difficult for me to
implement. In the previous tasks, I planned to have three different game
backgrounds with different objectives and layouts. It was time-consuming to
continue building that in Unity, especially since some game mechanics, such as
CCTV detection and the player throwing smoke and using stun gun for a quick
getaway to avoid being noticed, took me quite some time to figure out.
Current Game Assets
I decided to switch to focusing on just one game background with one game
objective. In the game, the main character is imprisoned in a jail, and his
main objective is to collect the key and find the exit door to escape.
Throughout the jailbreak journey, the player will face many challenges, such
as spikes and sharp blades, moving platforms, and fire traps. The difficulty
increases as the levels progress.
Main Character
As soon as I started creating the animation for the player movement, I
realized that the previous assets I had created were not sufficient. More
frames in the player movement animation would make the animation look
smoother. So, I went online and searched again, and luckily, I found a
template that provided full and detailed animations for different types of
character movements that suited the game theme. The character movement
animations include idle, run, jump, dead, throw, and attack.
Fig. 2.1 - Player Idle |
Fig. 2.2 - Player Running |
Fig. 2.3 - Player Jumping |
Fig. 2.4 - Player Throwing Knife (attack) |
Fig. 2.5 - Player Death |
Enemy - Police
In the game, the police are the enemies. The player must navigate carefully as
the police patrol throughout the game. If the player is caught by the police
(collides with them), they lose the game. The number of police will vary for
each level.
Fig. 3.1 - Police Death |
Fig. 3.2 - Police Patrol |
Game Environments / Background
I found a tutorial on YouTube that shows how using tilesets to create the
game background is easier and more manageable, as it allows for changing the
layout at any time. Previously, I used images to create the background,
which was time-consuming and inefficient, especially when working in Unity.
So, I found a complete set of game tilesets that suit the jail game theme.
With these assets ready, I can directly build the game levels with the
background and ground platforms smoothly.
Fig.4.1 - Tutorial on how to create Tile Palette in Unity
Fig. 4.2 - Tilesets |
Fig. 4.3 - Process of creating tilesets palette in Unity |
Level 1
In Level 1, there will be a total of two floors, one enemy, two checkpoints, spikes, and blades.
Main Character Animation
After creating the layout of the entire level 1 scene with the ground
platform all placed accordingly, I then started to animate the main
character's movement. This process took me quite a long time to figure out,
as I had to ensure that when the player presses the back or next button, the
character would have a running animation and flip left or right.
Additionally, the player can control the character's jump by pressing the
spacebar and attack by clicking the mouse. I watched several YouTube
tutorials and modified the script to ensure the player can perform all
movements with smooth animation.
Fig. 5.1 - Tutorial on how to create animation for the character
Fig. 5.2 - Tutorial on how to create animation for the character
In the process, I faced challenges where the main character could not switch
to the running animation and remained idle when I pressed the back and next
buttons. So, I looked for YouTube tutorials and also asked ChatGPT to check
my script for any errors. Finally, I solved this issue by modifying the
script and double-checking the settings in the Animator (parameters).
Fig. 5.3 - Process of creating animation for the character |
Fig. 5.4 - Screen Recording of the player animation
Obstacles (Spike & Blade)
Next, I continued to create the obstacles such as spikes and blades in the
game. The placement of the spikes and blades is important and purposeful,
as this will create challenges for the player, making the game more
exciting and engaging. For example, the blade will be placed near a spot
where the player is required to jump, so the player needs to be cautious
to avoid being hurt by the blade.
To make each spike and blade a hurtful item, I used a script named
PlayerHealth. Inside the script, I used the if statement to link with the
tag. This script will be attached to the player component, and I have to
make sure all the spike and blade objects are set with the correct tag.
Instead of adding the box collider for each spike and setting the tag
individually, I created prefabs for the spikes and blades. This saves time
by allowing me to duplicate the objects easily.
Fig. 5.5 - Adding obstacles in the game |
Fig. 5.6 - Player Health script |
Fig. 5.7 - Screen Recording of How the Spike & Blade Work
Checkpoints
In the game, there will be checkpoints in all levels. These checkpoints
serve the purpose of allowing the player to resume from the checkpoint
instead of the starting point upon death. Once the player reaches a
checkpoint, it becomes activated, changing color from red to green. The
placement of the checkpoints is usually in areas with more obstacles and
difficulties for the player to pass through. To create this needed a script
and attached it to the checkpoint game object.
Fig. 5.7 - Checkpoints in the game |
Fig. 5.9 - Script for the checkpoints |
Fig. 5.10 - Screen Recording of How the Checkpoints Work
Level 2
In Level 2, there will be a total of three floors, two enemies, two checkpoints, a moving platform, spikes, and blades.
Moving Platform
The moving platform appears in Levels 2 and 3 to increase the game's difficulty. The platform can move vertically and horizontally, and as the player progresses to the third level, the speed of the moving platform will increase, requiring the player to move precisely.
Creating this moving platform took me almost the whole day, as I faced issues when the player jumped on the platform. When the player wanted to move, it would jitter, and sometimes it couldn't continue to jump. I tried many methods and asked for help from ChatGPT, but the issue remained. Eventually, while scrolling through the comments on a YouTube tutorial, I found out that the scale of the moving platform object must be the same as the player's, which is 1. This prevents the player from jittering while moving. To solve the issue of the player not being able to jump, someone suggested modifying the script to add an if statement and set the player as the child of the moving platform when the player jumps on it.
Fig. 5.11 - To solve the issue of player can't jump |
Fig. 5.12 - Screen recording of the Moving platform
Level 3
In Level 3, the game environment will be larger compared to Levels 1 and 2. There will be 3 enemies, four checkpoints, two moving platforms, spikes, blades, boxes that need to be activated to fall off, fire traps, and swinging blades.
Falling Boxes Activation
In this level, there will have a spot where have a long spike on the ground, in order to let the player pass through, the player need to find the switch to activate in order to let the boxes fall off so the player can pass through the obstacles.
Fig. 5.13 - Process of creating the falling boxes activation |
Fig. 5.14 - Screen Recording of the Falling Boxes Activation
Summary
What has been done:
- Level 1 map layout
- Level 2 map layout
- Level 3 map layout (semi-complete)
- Player control (includes run, jump, attack)
- Enemy patrol between certain areas (waypoints, attacked)
- Traps (spikes, blades, moving platforms, falling boxes activation)
- Item collectibles (only collect the key to open the exit door)
- Checkpoints
What has yet to be done:
- Level 3 (map layout, fire traps, swinging blades)
- Player sound effects (run, jump, attack, death)
- Sound effects (collect key, activate falling boxes, checkpoints)
- Background music
- Animate the characters (police and player death)
- Start menu page
- Instruction page
- Level unlock page
- Game over and level success pages
- Replace the blue background color
- Camera zoom
FINAL SUBMISSION
**Apologies for the Zoom screen recording causing a delay or lag in showing the gameplay. Please refer to the video (Fig. 6.2) for a clearer view.
YouTube Link: https://youtu.be/kxwVhx9aPn4
Fig. 6.1 - Video Presentation of Task 3 Game Prototype
Youtube Link: https://youtu.be/YjtmgdBtlIc
Fig. 6.2 - Video Walkthrough of All Levels
REFLECTION
When I started building the prototype in Unity, I struggled because the previous game mechanics I proposed were hard to implement, and there weren't many tutorials available. After consulting with Mr. Razif, I realized that some parts of the game didn't make sense. For example, it was difficult to determine how the police could notice the player within a certain distance, and the gameplay was too easy, lacking challenge and excitement. Although changing almost the entire gameplay and game environment felt wasteful since the previous work wasn't used, I'm glad that with the new idea, I now have a better and smoother workflow in Unity. I was pleasantly surprised to feel so motivated while working on the game in Unity. Finding various ways to solve errors felt like quite an accomplishment. I am very excited and can't wait to keep working on the game until the final task and try out the final outcome!
Comments
Post a Comment