|
The development of an AI system for a racing title might broadly be broken down into three main sub-tasks:
- Path, or racing line,
specification for a car (which includes speed information too)
- Car
control, or keeping the car on the specified path
- Racing strategy:
overtaking, blocking, pitting etc
In other words, to obtain a given car behaviour, the first thing we typically do is specify a desired line and speed for the car to follow around the track (or through the streets etc), assuming in the first instance that there are no other vehicles or obstructions present. For convenience, let's call this the "racing line" on the "track" for now.
Given this information, we could then exploit our omniscience as game developers and of course simply place the car on the track in the desired position in the world, frame by frame. However, this tends to look very unsatisfactory, as it is clear to the player that the AI car is driving in a highly unrealistic manner, and from a competitive viewpoint, is unfairly not subject to the same laws of physics as the player (or indeed, any laws of physics ). Realism is, of course, something we seriously aspire to in racing game development, and overall this approach to racing AI leads to an unsatisfactory gameplay experience, and is basically a lot less fun.
Instead, and this is pretty much conventional in modern racing games, the racing line data is fed to a "controller" which will attempt to actuate the AI car's steering, accelerator and braking systems in a manner vaguely analogous to the way a player might. This control information is then fed into the games physics simulation engine which does the rest. This solution clearly provides the best gameplay, but there is a big problem: controller design is really tough as we discuss later. Because of this, in the end most implementations understandably "cheat" in one way or another.
Now the earlier "racing line" data assumed that there were no external factors dictating the choice of path for the vehicle. During racing or driving, this may often be the case, but for the majority of the time there may well be other cars to block or overtake, debris to avoid etc. To implement such "interaction" strategies, a separate subsystem needs to be bolted-on to post-process the racing line where required.
The diagram below is a relatively simplistic decomposition of the Drivatar AI system, and illustrates how the above sub-systems might be combined. In addition to these general racing AI components, we have also shown how the Drivatar's novel in-game learning system is integrated into the system as a whole. As we discuss later, the built-in AI opponents in Forza Motorsport are actually
just a set of "pre-trained" Drivatars.
More detail regarding some of these elements are available via clicking on the relevant module in the diagram, or by following these links:
|