Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Gamasutra: The Art & Business of Making Gamesspacer
The Pure Advantage: Advanced Racing Game AI
View All     RSS
July 18, 2019
arrowPress Releases
July 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 5 of 5

Extra Mechanisms used in Pure

As mentioned previously, we developed a few extra mechanisms to have the AI perform as expected:

  • At the very start of the race it's really important for the AI to overtake the player as then they become an obstacle the player has to avoid to progress. The group structure is also harder to form correctly if the player gets ahead.

    Thus the AI will have the top skill in every category for the first seconds of the race (10-20 seconds). Then the AI characters interpolate to the final skills for another few seconds (~5 seconds). This usually helps forming the groups. It doesn't work so well for very high difficulty levels, since in that case their skills are already close to the 1 value.
  • We found out people sometimes found it a bit easy during the initial part of the race. It didn't happen for everybody, but some people seemed to have it happen more often than others. We decided to include an additional modifier that reduced each lap until it was 0 in the final lap. For example, in a three lap race we would have all the AI characters with a +0.05 skill bonus during the first lap, then a +0.025 skill bonus the second lap and no bonus the last lap.
  • The script says that the player should be fighting for the first position during the last 20-25% of the race. If the "advanced group" is aiming for +0 meters at the end of the race then the player is only fighting with these riders for the very last meters (if any at all).

    We decided to apply the moving target point mechanism only during the first 80% of the race. Thus the human player should be surrounded by the advanced group for the last 20-25% of the race and it should make it easier for him to achieve a first place. Note that when we talk of percentages of the race, we are referring to having covered that percentage of the total race length.
  • Even with the previous measure it may still be hard for the player to achieve first place in the race, and it won't be very forgiving. If you make a mistake in the last meters you will probably suffer the consequences. We decided to stop the AI characters from improving their initial skill in the last meters of the race.

    We actually decrease the maximum skill modifier in that last 20% of the race so that it is 0 at the end. That makes it harder for the AI to recover from their mistakes, giving the human player some room to maneuver. They still decrease their skill if the human player gets caught behind. This usually allows the player a bit of room in the final meters so that even if he makes a mistake at the very end the loss is minimal.


The algorithm presented here offers a solution to "configure" or "script" your race in a fixed, predefined way, but allows a dynamic evolution of the race that tries to match the human player's performance -- but in a subtle way, and with bounds, so that it doesn't break the sensation of fairness.

We hope that the system explained here, which is the underlying AI behaviour in Pure, was never obvious to the player and kept the rewarding sensation from working their way through the race positions.

We think this method fits pretty well for our game since the genre is arcade racing. We wanted to present the player with exciting races where they are almost always surrounded by other guys and where they could easily progress, gaining positions, and overtaking opponents.

We wanted the top positions accessible but they had to fight for those positions at the end of the race, so that it's as thrilling and as exciting as possible. So we found this method fits our Hollywood-like goals very well.

We also think the algorithms described here may be used in any other kind of race game (simulators) and should be easy to implement.

We also think it could be used for other kind of games like FPS, RTSs, RPGs, etc. For instance, in a shooter you may want to have the player reaching certain strategic points with a certain amount of energy (assuming you don't have auto-regeneration).

If the player is over that energy, then you know your AI guys must press harder, but if the player is below that zone your guys should leave him some room to recover.

Then you can put some bounds to that, so that your guys never stop fighting and never have a lucky 100% headshot rate, and you set these bounds based on the difficulty level.

On easy levels they shouldn't press very hard, no matter what the human player's energy and the strategic points should have a higher reference energy values. It should be the opposite on the hardest difficulty level.

In short, this methodology presents a set of tools or values (the skills) that determine the way the AI characters behave. Then it uses those tools to try to match the player's experience to a predefined script, dynamically modifying the values of the skills based on the player's performance.


I would like to credit the people that worked shoulder by shoulder with me developing the Pure AI and whose ideas you may find in this article. It was thanks to working together and a lot of iteration and sharing our ideas that we ended up with the successful AI system we finally had.

The article presented here is the result of one year of hard work iterating over the initial ideas and doing lots of tests to improve and evolve the existing systems. The focus tests that we had were especially important, and helped us realize what the problems behind the AI were.

I would like to thank, in no particular order, Jason Avent, Michael Benfield, Jim Callin, Iain Gilfeather, and Tom Williams for their input as well as all of the people who helped us blind-test the product throughout development, without whom we couldn't have achieved the quality level we have.

Article Start Previous Page 5 of 5

Related Jobs

Tangent Games LLC
Tangent Games LLC — Burbank, California, United States

Lead Engineer
MADFINGER Games — Brno, Czech Republic

Platform Developer
Vicarious Visions
Vicarious Visions — Albany, New York, United States

Software Engineer
Disbelief — Chicago, Illinois, United States

Senior Programmer, Chicago

Loading Comments

loader image