Skip to content

avainslie/CPSC-565-Assignment-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 

Repository files navigation

Quidditch

CPSC-565-Assignment-2

This project simulates a simplified version of the game of quidditch from Harry Potter. In the game, wizards ride brooms and chase an object called a snitch. This snitch moves quickly and randomly. Each time a player "catches" the snitch, they score a point for their team. "Catches" that follow eachother are worth two points. The first team to reach 100 points wins the game.

Unity3D engine is used to create the simulation and implement the algorithms that dictate the behaviour of the players and the movement of the snitch.

Screen Shot 2021-02-26 at 8 11 11 PM

An image of the snitch

The two competing teams are differentiated by their colour with red representing Slytherin and green for Gryffindor.

Players start on their side of the field before beginning to fly after the snitch.

Screen Shot 2021-02-26 at 9 49 58 PM

Players at starting positions

When a player becomes unconscious, they stop moving, fall to the ground, and return to their teams starting side. They must rest for 10 seconds before entering the game play again. The image below shows some unconscious players.

Screen Shot 2021-02-26 at 9 14 52 PM

Unconscious players

Players movement is based off a balance of avoiding colliding into objects that are not the snitch while also chasing the snitch. Players of opposing teams collide differently than players that share the same team, with the former taking aggressiveness into consideration and being more likely to lead to a player becoming unconscious.

Players also exert themselves as they move. If a players exhaustion reaches their maximum, they will become unconscious. In order to avoid this, players will rest for a little bit when they start getting close to being over tired.

The behaviour of each individual player is dependant upon six unique traits:

  • Weight: How heavy the player is. Affects the acceleration of the player.
  • Max velocity: How fast players can go.
  • Aggressiveness: How likely a player is to "win" in a collision with another player and not become unconscious.
  • Max exhaustion: How tired the player can get before becoming unconscious. Affects when a player decides to rest.
  • Disctraction: How focused the player is. More distracted players have a higher chance of being distracted and going a random direction everyonce in a while.
  • Laziness: Affects how much force the player will have to move towards the snitch. Lazier players use less force.

These traits are implemented by selecting a random value from a normal distribution based on the teams unique means and standard deviations for each trait. As such, each player has it's own unique traits and can behave in a slightly different way than other players. All together, these players create unique emergent team behaviours which affect which team will win the game of quidditch.

Example game play

game

above

Quick Start

You must have Unity 2019 or above installed to run this project. Please visit https://unity.com/ for more information.

  1. Clone this repository to your local machine
  2. Open the project in the Unity editor and select the Play button.

Future Directions

Aside from improving and correcting some of the faults with this version of the simulations implementation, there are a few other modifications that could be done to increase the value of this project. One example of this is that assets could be implemented to add nicer visuals to the project and further traits could be added to the players such as communication and team spirit. These would produce interesting emergent behaviours and could be implemented in a variety of different ways.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published