Space Rides

Style: 3D , school project

Platform: Windows

Software and languages: Unity, C#

Space Rides is a project created to practice implementing basic game AI. Systems like AI, steering behaviour and collision detection were implemented from scratch. The game is a space battle simulator where the participant navigates around the map collecting bonuses to improve the capacity of their spaceship. My principal contributions to the project were movement and steering behaviour, collision detection, and team and project management.

The team was only made of programmers, so we used Mario Galaxie's assets to create the map.

Movement

To implement a stat system, we created a movement system that could be used by both the AI and the player. Both actors use the "seek" steering pattern to move. The principal difference between the two is the target they are seeking.

Player control

We used a "carrot on a stick" system to control the player. Nine invisible cubes are placed around the player ship. When the player inputs a direction, the appropriate cube will be set at the target for the " seek" steering behaviour.

  

AI

AI movement

The AI navigates around the map using a navigation graph. The agent uses the A* algorithm to find a path to their destination. They navigate from node to node using the "seek" steering behaviour.


AI collisions prevention

The AI uses six rays to handle collision prevention. Three of them are cast forward to detect incoming walls; one is cast upward and the other downward. When a ray hits a wall, the agent will turn to prevent the collision. At the same time, an additional ray is cast in the direction of the previous detection to check if the obstacle is still present. The extra ray will prevent any jittering in the AI movement.

Stat system

The stat system present in the game allows the player to improve their spaceship. The players can improve their handling by collecting "turn" and "max speed" power-ups.

Collisions system

The game uses a manual collision detection system and the one present in Unity. Manual collision detection is done to detect a hit between two spaceships. The code calculates the angle between the collision normal and the steering velocity. The spacecraft gets destroyed if hit on the side or the back. They do not get destroyed if the collision happens in the front.

A video example

Demo video of the Space Rides project

 

Teammate

  • Shadi Jiha

  • Runze Zhu


Previous
Previous

Ice Ice Fishing

Next
Next

Slime and seek