Final Adjustments

April 28, 2021

 I fixed and added a few things to make the game more user friendly. I decreased the size of the table so that a user is able to reach the "neutral zone." I enlarged the player so there's a better angle for the user to play. I increased the hit area for the striker to make hitting the puck smoother. It helped, but there are still some misdirected hits. I adjusted the difficulties of the cpu just a bit to get a more realistic difficulty range. I was able to fix a bug where the difficulty would not change on a new game. I decided to reset the striker with the puck whenever the puck got stuck or when a goal is scored. When I did not, the striker would just push the puck to the other side of the table and get stuck on that side. I added a boundary for the striker so that it cannot fall off the table or cross the neutral zone. I added music to the game to make the game more interesting. There is a sound effect when the puck collides with any object, when the puck resets, and when a goal is scored.

Gameplay Finished

April 27, 2021

 The project is presentation ready. The user is able to fully interact with any of the UI. The game fully runs and can restart or create a new game at the end of the game. The CPU is working with an easy, medium, and hard difficulty. There was an issue where the CPU would pin the puck against the wall. I added a timer that started when the puck gets stuck and if it is there too long, it resets the puck back to the center. I was also able to add pausing the game using the controller's menu button. I attempted to add vibration on collision, but Oculus' controller input only offers a vibration that lasts two seconds so I decided not to implement it. The last step would be adding music to the game which I will see what Unity's asset store has to offer. For the next couple days, I will be preparing my presentation and fixing any bugs I notice while continually testing the game.

UI Redesign

April 23, 2021

 I decided to merge my scenes into one. Now the user starts in the scene with the main menu and once they start the game, the table, strikers and puck loads in front of them. Now that everything is in the same scene, it helped me remove multiple scripts and move that code into my main Game Manager script. This fixes the dark lighting issue when the game loaded in from a different scene. Next I have to finalize the game loop. When a user clicks "Restart" or "New Game", the game does not reload the objects correctly. Once I finish that game loop, I am going to work on the medium and hard levels for the CPU. I also want to add small ideas that would make the game feel more intractable: vibration on collision with the puck, pausing the game using the controller's button, and music during the game.

Main Menu and End of Game

April 19, 2021

 I implemented a Main Menu for my game. A user clicks "Play" which leads to a different screen that gives the user the option to change the difficulty and the score. For now, only the score slider works. Once a user clicks "Start", the game loads and a user is able to start playing. One problem I am having when the new scene loads is that the lighting is very dark in the room. The game is still able to play normally but the lighting needs to be fixed. Once the user or cpu reaches the target score, a pop-up text shows up stating "Game Over" and gives two options to either restart the game or quit. The quit button just takes the user back to the Main Menu. The restart button is not working at the moment. When you press it, it is supposed to reload the scene, however the scene reloads but the screen just remains black. The next step is just making sure these necessary game functions are working and fix the lighting. Once that is complete, I can focus on the different levels for the CPU.

UI and CPU

April 11, 2021

 I created a pause menu for the game. There is a "Resume" button, "Main Menu" button, "Restart" button and "Quit" button. As of now, only the resume and quit buttons are working. The pause menu is brought up by clicking the pause button in the lower right corner of the table. This button also "freezes" the time and when the "Resume" button is pressed, the time is set back to normal. As of now, there is a delay when clicking the button, however when you are in the pause menu, there is no delay when choosing an option. For the main menu, I was having trouble loading the UI from a different scene, so that is another part I will be working on.
 I also created a simple CPU. I just duplicated the original striker prefab and set it on the other side. For now, I set up a timer so that a force is added to the striker on the x-axis to move it either left or right the length of the goal. The goal is to have the CPU track the position of the puck and move accordingly.

Scoring, Repositioning, and Redesign

April 10, 2021

 I redesigned the table to add back the walls where the goal is and I added a gray block to signify where the goal. I increased the size of the goal because I was having trouble scoring a goal without a goalie even being there. I found a prefab for a striker which looks a little more realistic and also allows me to set a height limit for the striker. I have not implemented it into this video because there are issues with collisions, but I will continue working on that. I was able to make the puck reset on the other side when a player scores a goal against the CPU. Originally I was trying to destroy the puck each time a goal was scored and then respawn it. Instead, I realized I could just reposition the same puck into the new position after the goal was scored which made things much easier. I was stuck on that issue for a couple days. Also in the video, I set the score limit to 7 so that once that number is reached, a message will pop up saying whether you won or lost. I will most likely make that a big pop-up message, but for now it is written on the table. I have also been working on UI for the Main Menu and Pause Menu. I have a basic setup, I am just waiting until I get controller interaction before I begin using it.

Scoring

April 5, 2021

 I was able to implement scoring into the game. I moved the walls of the goal for now and added an invisible box that is used to represent the goal. When the puck collides with the invisible box, a point is added depending on which side the puck scored on. For now, I placed the score text on the table to the bottom left just so its easy to see when I am testing (this may or may not be moved). I also have to move the invisible goal back and not lined up with the wall because the second it touches it, it counts as a goal, even if it is just the edge. Backing the collider up will give the impression that the puck went into the user's or CPU's goal. I also have to replace the walls of the goals so the puck doesn't just disappear into thin air. Lastly, the puck always respawns in front of the user even if the user scored on the opponent's goal. Now I have to make sure the puck spawns on the other side when a user scores a goal against the CPU.

Redesign and Walkthrough

March 31, 2021

 I was able to redesign the table in order to make the corners rounded like an actual hockey rink. This fixed any issue with the puck getting stuck in the corner which is shown in the video. Although it is not super smooth, the puck is able to be moved out of the "corner." I also added a thicker border for the walls to make the table look more realistic. This will also give the puck a place to "go into" when a player scores. I also worked with sprites for the first time. Sprites are 2D graphic objects that are used as a texture for an object. For my sprite, I found an image that is similar to the floor of an arcade with the black carpet and neon colored images. I then tiled those images across the whole floor. I also added walls around the environment so it doesn't look like the player is floating in space.
 I gave my walkthrough of my current progress yesterday. I was able to go through my progress from the beginning up until the redesign. I was having trouble casting my point of view from the goggles onto my computer. I'm glad this happened during the walkthrough instead of the actual presentation because now I know I have to work on that. I also received suggestions about gameplay and other features that could be added. My next step will be implementing the score ability.

Controller Interaction

March 21, 2021

 I took a couple unintended weeks off from the project because of other class work, exams, and other personal reasons. This break did not help the progress, however I was able to get back into things and get a lot done in a weekend. I created the legs of the table and put the whole table on a floor. The design is simple for now; I am just using it to determine the height I want the user to play at. I was able to create a "player" which is just a first-person camera rig with hands. The player's hands are controlled using the Quest controllers. The player can now grab the striker and use it to hit the puck. Now that I have finally made it to this important step, I've run into some bugs that I will have to work on.
 The collision between the striker and the puck does not always go in the direction that I am intending and I believe it is because of the way the striker's collision points are set up. I'll have to work on the physics of the collision. Another annoying issue with that is that if I hit the puck softly and it goes onto the other side, I have to rebuild the game just in order to test the physics of hitting the puck. For debugging purposes and future use, I want to write a script that makes the puck respawn in front of the user after coming to a stop for a certain amount of time. I could use the idea of this script for when a player scores and the puck needs to respawn. Or if a puck ever gets stuck in a corner, I'll apply this same script (I'm no longer having issues with this because of the use of the controllers, but it may be good to implement just in case). Another bug is the way in which a user spawns. They start far away from the table and have to move towards it, but unless the user clicks the controller's reposition feature, the user can't reach the table based on the boundary they set up. I'll be working on these bugs this upcoming week while also trying to set up a CPU.

Brainstorming Session

March 5, 2021

 On Thursday, I had a brainstorming session for my project. I showed a few students and Dr. Diederich my current progress. I was able to add a boundary for the striker so that it cannot go onto the opponents side. I also had some good feedback and ideas. I was having a problem where the puck would get stuck in the corner and could not get out. A couple ideas were to create invisible angled corners so that the puck can just bounce off it. Another idea was to round the corners of the table so that this was not a problem. I'm going to try and implement both and see which one I prefer.
 I also asked for ideas on the CPU. The basis of the discussion was to start simple with just a striker that moves back and forth on one axis its own. The next step would be to implement a tracking based on the position on that axis. After that I can try to create a range of error and speed for the CPU. Lastly, add another axis so it has the ability to move around more freely. The next step I want to work on is setting up the striker with an Oculus controller so the player can grab the striker and hit the puck.

Striker and Puck Collision

February 27, 2021

 I was able to create the motion of the puck, I decided to create a striker. This was interesting because you have to create multiple 3D objects of different shapes and combine them into one. For example, my striker object is made up of a wide, short cylinder, a thin, tall cylinder, and a sphere at the top of the handle. After designing the striker, I implemented the same script that I used to make the puck move from last week. This worked well, I just had to adjust the speed and mass of the striker, so it doesn't move as quickly as a puck would. I also figured out how to lock the position of the puck and the striker so it is sitting on the table and not just floating in space.
 The next part was figuring out collisions between two objects. I worked on a script for the puck that would increase velocity when the striker hit it. At the moment, the script is working and there is movement after the collision. However, it doesn't seem as smooth, so I have to research different ways to implement velocity on objects. I also have to figure out a way to limit the user's position so it cannot go past the half court line. After I perfect the motion and collision of the puck and striker, I'm going to move on to the CPU. I want to figure out how I want the CPU to interact with the puck and the different difficulties the user can play with.

Puck Movement

February 20, 2021

  After reading a lot of documentation and a lot of experimentation, I was able to create a basic feel of an air hockey table. I created a table with barriers and a puck. The table surface has less friction which makes the puck able to travel around faster. The walls offer the ability for the puck to bounce off of them. The puck also slightly sits above the surface of the table as if it is being pushed up by air (not necessarily by choice, but I'm working with what I have so far). Although I have made progress, the puck's initial movement can only be controlled by the arrow keys. The next step is to be able to apply force to the puck so it can move on its own.

Building a Simple Game

February 15, 2021

  I learned the basics of Unity today. On the Oculus website, there is a short tutorial to build a small game. The basic idea is to roll a ball in a small plane with four walls. If the ball hits any of the walls, the color of the wall changes and a message pops up on the screen. The user controls the ball with the Oculus controller's joystick. From this tutorial I learned how to create objects, reposition them, apply physics to them and give action to them. The concept of the ball bouncing off the wall and changing the color is very similar to how the hockey puck will interact with the walls of the rink.

Project Setup

February 11, 2021

  I spent the first part of the week creating my website using Brackets. I figured it would be a good thing to learn along with my project. I spent a few days learning HTML basics and getting into the design of the website. I will probably continue to play with it here and there, but most likely keep it the way it is in order to focus more attention on the project.
  Along with creating my website, I integrated myself with the Oculus and the technology. I have never used any type of virtual reality before, so I spent some time learning how to use the device and get familiar with the controls. I chose to create my game with Unity, a cross-platform game engine. After downloading Unity and the necessary modules for the project, I was able to set up the Oculus in Developer Mode and connect it to a 3D project in Unity.
  Now that I have the setup complete, my goal for next week is learning how to use Unity. I have a textbook on the engine and I will watch tutorials online to get a better idea. I will most likely creating a simpler project just to get familiar with the engine and see what can be done with this technology.