Goat Simulator

GitHub

Overview

This was a project I worked on for 1 month in December 2022.

For this project, I was given the task of creating a game inspired by Goat Simulator in C++, by building on top of a Rendering framework which we were given. 

The gameplay loop is relatively simple. The player navigates around a map as a goat, colliding with the checkerboard textured objects to collect points. They can scare the cream-coloured humans who will also collect points for the player if they collide with these checkerboard objects. In order to navigate through the maze the player will have to press buttons to raise and lower doors as well as jump across a rope bridge. The game ends after 6 minutes or once the player has collected all the objects, whichever comes first. 

Physics

As part of this project I developed the skills to organise objects in a world into a quad tree, detect and implement collisions between AABBs, Spheres and Capsules and apply position and orientation constraints to a group of objects. These features can be demonstrated through the use of Spherical colliders on the player, capsule colliders on the Human AI, AABB colliders on the floor and walls and a mixture of all three collider types on the checkerboard objects. Orientation and position constraints are used for the platforms which form the rope bridge, this gives the rope bridge a rickety and tumultuous feeling every time the player lands on one of the panels which make up the bridge.

AI

The humans in the world are the primary AI. They use a behaviour tree to operate. They begin by completing a route that they already have programmed, if they reach their destination they check for the player. The player is always considered seen if they are within 8 units of the human. If the player is between 8 and 20 units away they have only been seen if the dot product between the forward vector and the vector between the player and the human is greater than or equal to 0.5 and a direct ray cast to the player doesn’t hit another object. This essentially gives humans a 120-degree vision cone between 8 and 20 units in front of them. Otherwise they are idle.