Devlog 7: Getting Started With the New AI System

Hello there.

Recently, I've decided to overhaul the current AI system in place for a new one. Instead of using inefficient machine learning, I've decided to go with a system that can generate AI from player racing. Unfortunately for me, implementing this will be a big challenge. Let's take a look at some of the tactics I'm currently employing, shall we?


Simple, good-old-fashioned waypoints. You can't possibly mess this up! This implementation incrementally places invisible checkpoints around the map when recording. Then, in AI mode, the vehicle will drive towards each checkpoint until it has finished a lap.

The problem with this? The vehicle's physics are too complex to handle. The AI will often drive too fast, causing it to have little time to turn toward a checkpoint. Not good! To fix this, I had to dumb down a lot of the checkpoint management, which meant placing several checkpoints with quite forgiving colliders.

Navigation Mesh

This method involves creating a "mesh" above all driveable areas, then using Unity's advanced algorithm to generate waypoints that accommodate braking and steering.

However, it turns out that such a high-level system leads to plenty of random bugs, which caused the vehicle to refuse to drive. This wasn't really ideal! There really wasn't any sort of fix for this, so I dropped the navmesh idea pretty quickly.

Imitation Learning

Ironically, this tactic is intertwined with Machine Learning. Unlike my previous ML implementation, which uses an inefficient reinforcement learning strategy (think of it as brute-forcing), the new version uses a guideline called a teacher agent. The teacher, which is controlled by the player, generates a model for the students (actual AI) to follow. If you want more info, check out the video above!

Although I haven't tried it out yet, IL seems like the best choice for my new AI system. It's a lot more responsible, clean, and advanced than any other solution.

Before I go ahead with this, however, I'm going to be working on other parts of the game, including the tutorial and menu. Constantly testing and failing in AI implementation has burned me out quite a bit, so I want to take a short break to recharge.

Stay tuned!

Get Rotor Drift

Download NowName your own price

Leave a comment

Log in with to leave a comment.