CGDD: Real ‘Fake’ Game

Documentation Log

For this real ‘fake’ game, I decided to go with a concept I’ve seen quite often for mobile game ads, where the player is running away from danger and in order to get past more enemies and obstacles, they must solve a simple puzzle to destroy what is in front of them and clear a path to escape.

I first started off by making a simple landscape in 3D on Unity, and placed down a long rectangular floor, the player object (red cylinder), and enemies (purple cubes/rectangular prisms). I wanted to make a simple foundation of the game first before implementing the puzzle aspects of it. To do this, I attached a script for player control, where the player can only move forwards, backwards, and jump through using the arrow keys. Because the vision for this game was from a side view, I believe that initially starting with the 2D game layout may have made this process much simpler, however, I liked the visual effects of 3D more. After implementing player controls, I constructed the player life script where once a collision between the player and the enemy is detected, then the game automatically restarts, inferring that the player has failed the game and died. 

Then, I wanted to add a more interesting component, collectable items that are like “power ups,” however, because the prompt for this project was to keep the game simple, I decided to make these items into collectable coins. My vision for a prospective finalized version of this game was for the player to purchase power ups through collecting coins. Adding onto the visual aesthetic of these coins, I made them continuously rotate to differentiate these collectables from the other still objects. 

The actual puzzle game took quite a while due to trial and error. This was my first time utilizing Unity along with coding in C#, so I had to do some research for this game to work. My initial vision was to replicate a simple puzzle of 6 items, matching up the 3 identical ones (similar to games like Candy Crush). However, most of the examples I saw were made with 2D, which was obviously a given since using 3D’s platform is much more difficult for this idea. I first made a Battle point where once a player reaches it, this puzzle will show up and they must solve it to move on. This idea unfortunately did not translate well because the array of the puzzle pieces spawned on the floor of the game, rather than on the screen. I also wanted the puzzle game to be solved using the mouse, but after numerous tries, I decided to go with a simpler version of the puzzle game.

I changed the amount of puzzle pieces to 3, and had one misplaced so that the player could be controlled to shift the piece up, which completes the puzzle. At first, I coded the puzzle so that once the piece was detected to be at a certain y-axis value, it would trigger the disappearance of the enemy object along with the wall placed to block the player from moving forward in the game. However, this action was not detected so I created a tiny sphere as a point for the collision detection. Upon colliding the puzzle piece with this point, I was able to make the enemy object and wall disappear, allowing the player to move onto the next level.

On the screen game, there are two texts: Level & Coins. I made each coin disappear after being collected by the player, which also increased the coin count on the screen. The Level would change in accordance to the puzzle game object making contact with its intended point. In terms of when the game ends, it is ideal to have the player fail the puzzle game, which would release the wall and have the enemy advance towards the player, killing them upon contact. However, I decided a simpler way to “end” the game was to have the player directly contact the enemy without any obstacles to conquer. Overall, it was quite an interesting experience to use Unity to compose a game, and I found it convenient to create various items that could just have code scripts linked to it.

Achievements & Challenges

As I have never used Unity or coded in C#, I struggled quite a bit with the entire process of making the game. To better understand the foundations of C# itself, I looked over the class slides and lecture recording. I also went through some Youtube videos to grasp why certain functions are used and how they contribute to the game. As using ChatGPT is allowed in coding assistance for this project, I gave it some prompts to help me fix a code, or to generate one that helped me achieve what I wanted the game items to do.

While I used Unity, I found it quite helpful and simple to use, though it is a little bit confusing to navigate. I particularly liked how easily you could make new objects, and overall design the environment to your liking without having to implement a code to make it. I also think that 3D visuals are appealing to see in games. I became more familiar with the inspector tool and connecting the codes to the game objects was not as difficult as I expected it to be. I also appreciate that variables can be interchangeable in Unity, rather than changing things within the scripts.

Some challenges I faced revolve around the code not functioning as I wanted it to. Like I mentioned above in the documentation log, I had trouble making items disappear after the puzzle piece reached its intended y-axis value. To counter this, I made a new object and rewrote the code so that the collision would be detected rather than the puzzle piece’s position. Another difficulty I faced was trying to spawn the puzzle board with randomly placed puzzle pieces. Because I composed this game in 3D, the automatic spawn of the array was not on the screen, but on the floor of my game, which is not what I envisioned. I felt that this was too complicated for a simple game, so I decided to change the solving method of the puzzle instead. Overall, it was quite an interesting experience to make a real version of a ‘fake’ game ads, and it will definitely take some time for me to adapt to using Unity and coding in C#.

Leave a Reply

Your email address will not be published. Required fields are marked *