Project 2
— GAD170 —
— GAD170 —
Table of contents
References are located at the bottom of this page.
This project has an alternative objective from the one originally scheduled as a result of unexpected events (the original lecturer went on sick leave).
In this project, I recreate one of the most iconic games in gaming history, the game that was included with every Nokia 3310 and was one of the most noteworthy things about that phone, a game that was simplistic yet regarded by some as one of the best games in gaming history, and that is Snake Game. I created this classic game in none other than the Unity Engine, which unfortunately does not support building games for the Nokia phone platform.
My version of the game may not be as good as the original, but gosh dang it, I'll certainly try.
Reef (n.d.) [1]
This document contains all the information I could find on this brief, including the deprecated information with the originally scheduled objective for this project. I use this document to keep track of all the information and keep it in one place, which helps with organisation.
When we were told to recreate Snake game instead of our original objective, my first thought was "oh yeah, this has to be like the Nokia Snake game", so that's exactly what I set out to try and do.
Using reference pictures and videos of the original Snake game for the Nokia 3310, I decided to make my version of Snake as close to the original as I can with the time constraints I have (because despite what you may think, making it in Unity takes quite a deal longer than it does in the way it was originally created, at least for me).
While the snake itself had to be reduced to just a simple block snake and the original start screen couldn't be implemented, everything else looks and works the same as the original, and it even has a Nokia 3310 overlay around the game borders!
The Adam of the game: the snake
The first most important part of any snake game is the snake, which allows the player to have control in the game. The snake only has four controls in its control scheme, that being move up, move down, move left and move right. The snake moves every half second, and the direction the snake goes in will depend on what key was retroactively pressed closer to the half second.
The lose condition of this game is if the snake runs into its body. As the snake grows (which will be discussed in the next section), it becomes increasingly harder to not accidentally run into the snake's own body, and if that happens, the snake will die. The screen shakes upon this happening and the game stops for a second, indicating that the game is over.
You can find a breakdown of the script for the snake with the button below.
The Eve of the game: the apple
The second most important part of any snake game is the apple, the player's target. The main objective for the game is the snake (or the player) to eat as many of the apples as possible. While the apple can't be considered a "win condition" to go with the lose condition, it is the main reason why the player may want to continue playing.
Every time the apple is eaten by the snake, the apple will disappear from where it originally was and will reappear in another place within the game space, the snake will get one portion of its body size longer, and a point will be added to the score counter above the game space.
The incentive to keep going: the score counter
The score counter, while not essential to the Snake game, was in the original Snake game and is an incentive for the player to keep playing the game, that is to get the highest possible score that they can achieve.
The score starts off at "0000" and will count up by one point at a time as the player continues to eat the apples. When the score reaches "9999", it is predicted that the score counter will then break. This can technically be considered a win condition of the game as the player has reached the maximum score that the score counter can count up to, but to reach this maximum value, assuming that the player collects the apple every 5 seconds, the player would have to play this game for a total of almost 14 hours! That's almost double that of Penn and Teller's 1995 SEGA CD game Desert Bus, comprised entirely of just doing the same thing!
You can find a breakdown of the script for the score counter with the button below. This script also uses arrays for the counter, which is my first time ever using this function.
I have used systems and functions in this project that I either was not familiar with, such as the array system and switch statements, as well as, most importantly, Events. I have used the Events system in my pre-SAE project, named "Project Intruder", to allow navigation between menus in the main menu, but I haven't used it since then, which was probably over a year ago.
In this project, I use Unity Events twice, each for a separate purpose.
The first one is shown in the picture to the right, where I add a listener to the Event system that accesses the SnakeTweaked script of the SnakeHead GameObject and calls one of its public methods, Death. I have also set up the Event system to trigger via invoking it in the script once the isSnakeDead boolean is detected as true. Once the Event system has been invoked, the Event system calls the Death method, which will then stop the snake from moving, enable the main camera's animator to shake the camera a bit, wait a second, and then restart the game.
The second purpose for which I've used the Unity Event system is for a UI button, more specifically the quit button. Because of the way Unity's UI system is set up coming right out of the box, the Event system is already implemented for buttons when created, saving the trouble of having to add it manually through scripting.
The quit button's event system also adds a listener that accesses the SnakeTweaked script of the SnakeHead GameObject, but this time it calls the public method QuitGame, which quits the game in both the Unity Editor or in the standalone build. The Event system is invoked once the player has clicked the quit button on the screen.
You can see a further breakdown of my use of the Unity Event system for the first use of it, which is for the Snake Death method, in the SnakeTweaked script page. You can access that page with the button below.
How to play
As opposed to Project 1, Project 2's Snake Game has the simplest control scheme, with only four controls (excluding support for the mouse cursor), each one for moving in different directions. It is shown below.
How did it go?
Just like with the previous project, this project was pretty fun to do, aside from the lateness of it and aside from the moments where I ran into problems with my code.
Even though this was supposed to be just a simple Snake recreation in the Unity Engine, I decided to go the extra mile and recreate the Nokia version of Snake as best as I could, even going as far as to include a border of the Nokia 3310. I did this because I wanted to add some extra flare to my project and really make it mine. I wasn't able to get everything perfect down to each detail though, as I wasn't able to make the original Snake sprites and get it fully working with the time I had (I did recreate the sprites for the snake but I didn't have enough time to get the rotation of all the sprites working and made sure they turned correctly), so I just had to settle for a simple blocky snake, just like how it was initially supposed to be and how everyone else went about it.
I made the overlay for the game, the Nokia 3310 over a neon grid background, using Paint.NET. I just found the two pictures online, upscaled the picture of the Nokia 3310, cut out its screen to be transparent, then put the two together and put it into my project. All the rest of the stuff, from the colour of the game background to the game borders and score, I created that from scratch using videos of the original Snake for Nokia 3310 as reference videos to make and position the elements perfectly. While the design side of the project, with the sprites and graphics, was pretty simple to do and effective at adding some flare to the project, the scripting was a bit more tedious to do.
There were a few issues I ran into throughout the project with the scripting, which I was fortunately able to solve in the end. One of the problems included the score counter, which was a bit harder for me to get going with my experience at the time of starting it as it used sprites for the digits instead of just normal text (text would've been very tricky to make a custom font for and position it right so that it's of the right size and doesn't move when the screen scales). This is where I used switch statements (thanks to my friend Woody for telling me about switch statements, saving me from the YandereDev method of using if/else statements over and over again) and arrays for the first time to make the sprites swap every time the score changes. It felt like such a big accomplishment when I finally got this problem fixed, as it took way too long to solve it.
I think the consequences of doing this was that it gave me less time to complete the project, which gave me less time to get the project in by the deadline, accompanied with things such as the disruption of the project deliveries caused by the original lecturer leaving for the trimester. In saying this, however, Glen has been very patient with me and has allowed me the time to complete the project with my standard of quality, and I'm very thankful for that. I think a good thing about this experience was learning about functions that were completely new to me, such as arrays and switch statements, which will no doubt assist me in other modules in the future.
The main thing this tells me is that I have fun working on these projects, which is a good sign. That shows that I have the passion to make games, and also with the quality that I made the project at, albeit a bit excessive for what was expected of me, that also shows that I care about the quality of my games and I would do well at making sure I don't release obviously schüt games that are just absolutely godawful. When I overdid the design part of the project, just like with my previous project, I wanted to make this project the best that I could to truly make it something I could be proud of (and hopefully get a good mark for).
There is some things I should have done differently from the start, such as with the snake sprites, I should have just stuck with the blocky snake that was already there instead of the custom Nokia 3310 Snake game sprites as that would've saved quite a deal of time. I also should've used the Event system for what it was used for earlier instead of just doing everything through scripting, which would've ticked off the last remaining LO, LO2, way earlier in the project's production. I decided to do everything through scripting instead of using the Event system because I actually forgot all about the Events system (I used it quite a few times in my pre-SAE project, Project Intruder, mentioned earlier) and thought that just doing things through scripting was just as effective as it basically did the same thing as the Event system. I know now that by using the Event system, I can make my code look tidier and also have more control over things happening in the game without having to put in all these other variables for each GameObject.
The positive about working on this project this extensively was that I produced this project at a standard that I think is at least good enough to pass in my books. While it's unfortunate that I didn't get to do everything exactly like the Nokia 3310 Snake game, such as with the snake sprites, and some bugs still persist in the game such as the snake teleporting to the other side of the screen and going a tiny bit outside of the game boundaries, I think that what's here is at least good enough. The negative about this is the stress that I put onto myself by leaving this project too late and not doing it earlier. If I had of done more of this project earlier instead of just fluffing around like I was, I might of even have a bit more time to fix the bugs that still persist in the current build of the game, such as the aforementioned bug with the game boundaries.
In the future, the main thing to do is to not leave things for later if I actually want to do well in the projects. While I do think that I did well in this project, other projects in the future will most likely require more time and effort to do well as well, and if I make the same mistake of leaving it as late as I have for this project, I probably won't be able to make a project that's good enough to pass in my books (I get that some people would compromise to at least get a pass on their project, but that simply doesn't fly with me). If I want to do well with my future projects, I have to get on top of my time management and get stuff more organized so I can do better.
Of course, that then raises the problem of procrastination. I think a way to deal with procrastination is to do two things: make sure I remain in contact with my lecturer and anyone else that can help me with my projects if needed, and break down the projects into smaller tasks that are easier to understand for me. I find that looking at the project's entire objective can sometimes be a little confusing for me, so I think it may help to have smaller tasks to do that will allow me to understand what I need to do to get the project done. I also need to make sure that when I'm asking for help from others and I get stuck on that (which is something that happens, and can cause even further delays), I should make sure that I don't switch to other tasks until I actually send off the email or message or whatever to the person, unless I'm doing something like going for a 5 minute walk to try and clear my mind.
Something I need to do differently next time is to really take project scope into mind. Project scope is something I learned about in my GAD171 class, and as I can clearly see from this project, I didn't learn it for nothing. Unless I know that I have the time to do small details (such as, in this case, the custom snake sprites), I shouldn't be spending valuable project time on the small things instead of doing the right thing for myself and possibly even other project partners and putting that valuable time on what's actually important to get the project done. The consequences of this action could be that I might not have enough time to add the small details that I really want to add into projects, but it would mean that I (or my group) have a better chance of getting the project done on time.
[Header] WallpaperAccess (n.d.). Cool Aesthetic Vaporwave 4K Wallpapers [Image]. https://wallpaperaccess.com/full/653097.jpg
[1] Reef (n.d.). Nokia's Snake [Image]. Dribbble. https://cdn.dribbble.com/users/5614085/screenshots/12483302/media/327f1409e1c38bfd035fe7539888f49d.gif