Gamasutra: The Art & Business of Making Gamesspacer
The Pure Advantage: Advanced Racing Game AI
View All     RSS
February 18, 2019
arrowPress Releases
February 18, 2019
Games Press
View All     RSS

If you enjoy reading this site, you might also want to check out these UBM Tech sites:


The Pure Advantage: Advanced Racing Game AI

February 3, 2009 Article Start Previous Page 4 of 5 Next

Since we are aiming to a point relative to a human player, we realized we could dynamically modify this point during the race. This is a key concept, as it allowed us far more control over the behavior of the AI.

Since now we are aiming at a point in the track relative to the player we can modify this point to simulate the ideal script we had written. The best way to illustrate this is using an example:

  • We had three groups of AI characters corresponding to the advanced, middle, and back groups described. All of those groups had four AI characters. This gave 12 characters in total, plus the human player, so there were three characters not assigned to any group.
  • Those three remaining characters were assigned to another group we called the "close group". This group always aimed to be with the human player (0 meters ahead of him) to try and simulate the characters that progress from one group to the other with the player. This group ensured some AI characters were near the player all the time, unless the player was outside the skill margins of the AI.
  • The "back group" was aiming to be with the human player (+0 meters) at the beginning of the race and 500 meters behind (-500 meters) at the end. This group was crowding the player's first meters, but was easily left behind soon after the race start.
  • The "middle group" was aiming 250 meters ahead of the player (+250 meters) at the beginning of the race and 250 meters behind (-250 meters) at the end. This group passes the player at the beginning, getting some advantage over him, and should progressively lose that lead. From the player's perspective he was gaining the positions slowly, and eventually left the group behind because of his skills. It doesn't feel like the group is letting you pass, because it's progressing slowly enough that it feels like you deserve to beat them.
  • Finally the "advanced group" was aiming 500 meters ahead of the player at the beginning of the race (+500 meters) and to be with the player (+0 meters) at the end. Thus at the beginning of the race this group tends to leave the player behind easily, but after the player passes the middle group, they would seem accessible.

    Then, he could eventually catch them and fight for the first position right at the end of the race. Players feel rewarded as they work their way through the groups to finally join the last group (the one that you lost sight of at the beginning) and even beat them in the final meters. It should be rewarding and exciting, keeping the thrill of the race right until the end.

The previous image shows how a race would typically evolve. The white dot is the player, while the blue dots are the back group, the green ones the middle group, the red ones the advanced group and the orange ones the close group.

There are a number of subtle extra mechanisms used to try to adapt to the script, but the one described above is key to the whole system. Every AI character may be set up to follow a different progression in relation to the human player, but they are also constrained by their skill limits. They will only increase or decrease their initial skills so much, so if this isn't enough to get to their position they will fail, performing better or worse than "expected".

It's important to note that we don't allow the AI to increase or decrease their ability as much as they may want, but instead limit their improvement to a range determined by the difficulty level. This helps to bring on the illusion of fairness to the game.

We really wanted the player to feel they have earned their place in the race. If they have a very bad race, they will see themselves punished for that (not getting to the first group at the end of the race). They will also be rewarded (by adding some distance to the next AI character) if they have a great race.

Article Start Previous Page 4 of 5 Next

Related Jobs

Boston Dynamics
Boston Dynamics — Waltham, Massachusetts, United States

Software Engineer
Skydance Interactive
Skydance Interactive — Marina Del Rey, California, United States

Lead Engineer
The Behemoth
The Behemoth — San Diego, California, United States

Experienced Network Programmer
Funcom — Oslo, Norway

Tools Programmer

Loading Comments

loader image