Posted August 16, 2025 by SirAppleV
#AI
Hey, I’m Jason. I’m part of the team Syntax Error Studios, where we’re currently working on Hypertrack.
While creating our first build of Hypertrack, I was in charge of making the AI racer. I didn’t think much of it at first—I was just thrilled to create a bot that could somewhat think and move on its own.
Boy, was I naive, thinking creating an AI racer would be easy. When I first even tried to start making it, I was completely stuck. That’s when I realized I’d never made something that would race around a map like in actual racing games. Most of my experience with AI was having them roam around, but now I had to make them follow a path—and even get back on it if they ran off the road.
The Problem: How do I make them follow a path and go back to it like in racing games?
When I first started approaching this, I didn’t think using a NavMesh was the best solution at the time. I didn’t need this car to free roam—I just needed it to follow a path—so it didn’t seem necessary yet. My only goal was to have it follow a path along the track in a way that was simple and easy to implement.
I tried using waypoints, but I quickly realized I would need to place a lot of them all around the map. That didn’t seem viable once we started thinking about making more complex tracks. Without a good method, the AI racers wouldn’t be able to navigate the track easily, which would make the gameplay feel off and boring. The AI wouldn’t be much of a challenge, and the player would almost always win.
The Solution: SPLINES!
I decided to do some research on how people usually make AI racer in games, and I learned that they use splines. I had never used them before, so I had to watch some tutorials and do some research to understand how they work and what they do.
They’re similar to waypoints, but instead of multiple points, it’s literally just a continuous line that you can tell the AI to follow. All I had to do was make the AI racer follow this path down the middle and stay on it by steering itself.
From there, I created three sensors—one to check behind it, and one each for the left and right sides. This would help the AI know if it was facing backwards or if the spline was off to its left or right. It did take some time since I had no experience using splines, but that’s the job of being a game developer—we constantly have to teach ourselves new things to keep up!
Even though the AI isn’t perfect just yet, this is just one of many steps that will make the player feel like they are racing someone as skilled as they are or even better.
Current Driving Logic: