/RingetteSandbox

A ringette video game made in Unity using C#. The assets were made using Blender.

Primary LanguageC#

Ringette Game

Link to teaser: https://www.youtube.com/watch?v=MpjZ63gPdxs

This is a game made to imitate the sport of ringette at a very low level. I have implemented basic concepts such as stabbing the ring (spacebar), shooting (e), and skating (wasd). The game includes two players and two goalies (in reality ringette has ten players and two goalies). The goal of the game is to score more than the opponent team by shooting the ring into their net. Although this is a very low-level implementation of ringette, this game pushed me to explore many topics including AI, modeling in Blender, creating sound effects, and more. Below I will explain my work in these topics and why I feel this game meets the complexity requirements of this assignment.

This game heavily involves AI usage as the player is playing against another team and only controls one player on their own team. There were two different types of AI needed: goalies and players. For the goalies, it was important that they track the ring, but not too quickly. If I had allowed the goalies to track the ring at computer speed, the player would never be able to score, so I delayed their movement speed. The goalies have a box collider on them so that if the ring hits them, it bounces off and doesn't go in the net. For the players, more complicated scripts were needed. The players must stab the ring when it's near them and depending on whether they have the ring or not, move towards either the ring or the net. They also need to shoot when they are close enough to the net and stop moving after their shot. The main factor for this AI system was a boolean called HasRing. I found that whether or not the AI has the ring is not only a factor in whether to move the ring with their stick or not, but it was also vital in the decision-making process for an AI player. I also made sure the AI players move slower than the controller player so that the player could beat the AI to the ring.

I made all of the models in Blender for this game. The only visible asset that I did not make was the skybox. I am fairly new to blender still, so the assets were very basic, both in shape and color. Going through the process of making the models allowed me to consider not only what shapes or components I could use to make different objects, but it also pushed me to consider how to best make the model to interact with Unity. For example, I originally had the player sticks as one object, but I realized if I made the stick tip a separate object it would be much easier to have the ring follow the stick tip when the player has the ring. This made the script much less confusing for me. I did something similar with the ice surface. I don't know how to make textures yet, so instead, I made the red line and blue lines on the ice surface separate obejcts and simply colored them different in Unity. Although not ideal, this still gave the ice the look I wanted.

I started this game using free sound effects I found online, but when I discovered how much of a hastle it was to find free sounds that don't involve a subscription and that I would have to reference all of the people and websites whose sounds I used, I figured I would try to make my own sounds. I downloaded a free app on my phone that records sound as MP3 and made some stick sounds with it using an upside-down hockey stick on some cement. In adding sounds, I also learned how to use multiple audio sources on one game object such as the stick tip, which had a shot sound and a ring stab sound. This allowed me to dive further into audio clips and find the PlayOneShot() function which plays a sound without interupting any of the other sounds that are already playing in the scene. I also learned to use [Serialize Field] when declaring audio clips in my script so that I could make them private but still be able to change them in the Unity editor.

This game also pushed me to extend my knowledge of colliders and rigidbodies. For a sports game, there is a lot of physics that need to be implemented properly and Unity's built-in physics engine made it pretty simple for me to do so. The rigidbody I found myself working with the most was the one for the ring. The main part I had to work on was when the ring is shot because it not only needs to be shot in the direction the player is looking, but it also needs to fall realistically and the velocity needs to come to a resting point eventually. I struggled with this at first, but after some Googling I was able to make this work by changing the ring's position and velocity based on the Camera's forward position found in its transform. As for the ring falling when it has been shot, I learned that the drag on the rigidbody affects the speed at which the ring falls, so I played with this value until I found a falling speed that I liked.

The UI in this game is used in every scene, but the most complicated to implement was the UI for the Play scene. In the Play scene, I decided to display the score at the top center of the viewport and the running time at the top right. The score was fairly easy to write code for, as I simply added score tracker scripts to the nets and had box colliders in each net that added a point to the respective team when its trigger was entered. Then I made a score script for the score text that retrieved these values and displayed them. The time script involved some Googling on how to convert delta time to an actual running clock that a human could understand and that counted down. I ended up using moduluses and subtracting delta time from the remaining time variable. The minutes left were time remaining divided by 60 and the seconds left were time remaining mod 60. Then it was just a matter of adding a zero in front of seconds when the seconds were in the single digits so that it looked like a normal clock and didn't change in length.

I really enjoyed making this game and hope to continue developing it after this. I've played ringette since I was young and always wished there were a ringette video game for me to play, so I made this for other young ringette players who wish for the same thing. Time permitting, I hope to add more players and more of the rules such as blue line passing and free rings. Having played and loved EA Sports' NHL franchise for many years, I take a lot of inspiration from their games and have many ideas to continue development of my game.