F1 2012 This is how F1 2012's AI works

F1 2012 The Game (Codemasters)
I've been on the lookout for that thread since F1 2012 came out (and the demo).

To me, that hat thread is telling, and I didn't want to write this post until I had more than my own observations on the topic to go by.
So here's my comprehensive explanation of how the AI in F1 2012 works.

This is in fact a continuation and condensation of discussions which were active in the old CM forums - now deleted (that to me is a no-no, but it is what it is).

Historically, i.e.. 2010 and 2011, F1 has had an AI engine that works something like what I'm about to explain below. It now seems that 2012 has the same, and this is how it must be working.
Even though I have posted threads like this for years now, CM has never commented on any of it.

First I need to explain how I've come up with the explanation or theory.
There are three main reasons I think this is the case:
1. Many modders have adjusted the AI for F1 2010 and 2011, and never been able to fix the "catch up" effect.
2. The method described has been used previously in advanced games, most notably Falcon 4, in which I was part of the modding community.
3. The game uses the engine from the Dirt games, games that were never meant to deal with more than a maximum of 8 or so AI-Cars, none of which were very often too far away from you, Also a game in which the AI never had to be realistic nor deal with long races or precision details such as tire wear, fuel load, weather, etc.

MODDERS take note, the explanation below might save you a whole lot of head ache.

THE THEORY

"Real" cars
=========
Cars that are close to you (with one exception, see note 2 below) are "real", that is, the game is driving the cars for real. Which means that they will perform at the same level as you, and take into account the fuel load, the tire wear, etc. A car close to you, will always lap as you do. This naturally depends on how well you drive and at what setting you set the AI. But as long as you're close to other cars, those will behave realistically.

Two notes on the above
1. I don't know exactly how many cars in front/behind you this is, nor how far away from you this is true for, but there is a limit in number of cars and distance from you,
2. In a few cases, there are more cars around you than there are "real" cars, such as the start. In these situations you will run into odd behavior, such as cars "ghosting" (lots of debate on this topic in 2011), where cars will drive through one another without crashing. Read on!

The "Bubble"
==========
What's interesting is the answer to the question: "what of the other cars then"?
The answer is that they're in a bubble of sorts. Any car that is not "real", will drive according to a table of sorts. The AI seems to want to give you the right competition.
Basically this is sound. Let's say you select the right AI difficulty, and the AI has lap times in its tables (for each car and driver) that correspond to what a human driver at that skill level can perform at. Then you would be hard pressed to see that the AI is not driving for real; the better cars/drivers than you would distance themselves from you at a normal pace, and you would puil away from slower drivers/cars at a normal rate.
What happens though is that the game's tables aren't entirely correct. There are many reasons for this, but a few are tire wear, the fact that you are a human and we all drive differently, it's hard to know exactly at what level to set the AI, etc etc. So let's say you end up being too fast relative the tables. Then the AI will reckon something like this: "The human driving a Mercedes is further away from Vettel than he should be". The AI will fix this by putting in seemingly impossible sectors/laps, until the distance is what the AI considers "fair" as determined by the AI level setting, and then if/when it gets close to you, drive at a "real" rate.

Conclusions
==========
There are several good reasons to use a "bubble" model. It keeps things simple for the CPU. It means that the game can use more CPU where it really matters - that's close to where you are. The down sides are normally that objects within the bubble can behave in unpredictable ways, especially if you - the player - do something that the simplified bubble-AI wasn't meant to cope with. In an F1 game this could be driving better/worse than your selected AI level, being faster in certain sectors, using a vastly unorthodox pit strategy, being very inconsistent (F1 somewhat works on the premise that you're consistent), etc.
If CM hadn't used a bubble model, the game would have been far more taxing on the CPU, preventing it from running on many systems - especially consoles. You who are old enough will remember a game that tried doing only "real" cars in F1, Geoff Crammond's GP4. Remember when the game slowed down to a percentage of it's real running speed, such as 90%? That was it.

The combination of the "real" and "bubble" cars is what explains:
1. why you will see the AI do magically fast sectors until they catch up with you
2. Why you cannot - will not be allowed - to ride with an AI car for an entire lap (in race, qual or elsewhere); the cars aren't there for most of the lap, they're in a bubble
3. why ghosting occurs not too far from you; only the nearest cars have real collision models on. The remaining 15 or so cars will be driving i a bubble and have a very limited collision detection model and such. Not bad, but limited.
4. Why AI seems unbalanced in the wet: you can't be as consistent, nor as good normally, in the wet as a real F1 driver. So your times will be far less predictable and your driving will be prone to more AI corrections than on a dry track.

Final thoughts
===========
I'm not bashing the game, I'm merely trying to explain how I see it's working. Don't read this and think "stupid CM, can't code", because CM couldn't have done it any differently.

The trick to deal with this are shared between you and CM:
YOU must select an AI level that suits your style. This is difficult, because you may be better at some tracks and worse at others. I wish you could set the level per track! But setting the AI level and driving consistently aswell as using normal pit strategies helps!
CM must trim trim trim the AI and the physics engine in the game so that we who drive the game can lap as expected, in every sector, for several laps. And trim the bubble AI to that. There should also be some sort of limit on the bubble's AI that detects an unnatural situation for what it is and stops the AI from catching up in those cases; let the player run off if that's what's happening.

Constructive replies only.

Source
 
On a related note: it's hilarious how I can't keep up with the car in front of me if I'm on P2 but the very same car can't keep up with me when I restart the race. If it's in front of me this car is ~2 seconds a lap quicker but if it's behind me it can close to gap in 2 maybe 3 corners but can't stay close anywhere else.
 
Thanks Tom, your explanation accounts for alot of the strange lapping behaviour and unless someone comes up with an equally good counter-argument, this seems to be the most logical summary of how things are working then I have ever read.

It does also leave me feeling it is a bit of a hopeless scenario in that there is no good way to easily fix this in the short term without Codies actually changing its AI engine quite alot.
 
It does also leave me feeling it is a bit of a hopeless scenario in that there is no good way to easily fix this in the short term without Codies actually changing its AI engine quite alot.

Yeah but the point of this specific AI was to best cater to the now useless console HW, so it would seem to me that they've done their best given the limitations of consoles.
The consoles are a big joke to me, they may have encouraged more people to play games, but many games are technically garbage.
 
Not exactly sure what your point is though....?

Before consoles appeared, how fast was the technology moving forward? You had to upgrade my PC every 1-2 years to keep up with the improved graphics and CPU requirements of new games. That was until 2005 or so until consoles started taking on popularity really fast.

Let me make this simple. My first PC was in 2000. I had to upgrade it in 2002. Then I had to upgrade it again in 2007. At this moment (end of 2012) I still use the same PC with the same specs from 2007, and I don't foresee a need to upgrade anytime soon in the near future if the tech and req of newer games will stay the same (who knows what new tech will come)

So yes, console is a major MAJOR factor in PC game evolution, in terms of AI, graphics, and anything else.
 
Thanks Tom, your explanation accounts for alot of the strange lapping behaviour and unless someone comes up with an equally good counter-argument, this seems to be the most logical summary of how things are working then I have ever read.

It does also leave me feeling it is a bit of a hopeless scenario in that there is no good way to easily fix this in the short term without Codies actually changing its AI engine quite alot.

Just to clarify this: I didn't write this up, see the source. I merely found that piece on the CM boards. :)
 
Before consoles appeared, how fast was the technology moving forward? You had to upgrade my PC every 1-2 years to keep up with the improved graphics and CPU requirements of new games. That was until 2005 or so until consoles started taking on popularity really fast.

Let me make this simple. My first PC was in 2000. I had to upgrade it in 2002. Then I had to upgrade it again in 2007. At this moment (end of 2012) I still use the same PC with the same specs from 2007, and I don't foresee a need to upgrade anytime soon in the near future if the tech and req of newer games will stay the same (who knows what new tech will come)

So yes, console is a major MAJOR factor in PC game evolution, in terms of AI, graphics, and anything else.

Current console generation is just two years longer than usual. I think anyway that consoles were popular much earlier than 2005 (PS2 released in 2000, xbox 2001).

But the main problem is a hardware/software one, and it is shared by both consoles and pc (since they are more alike than ever). The frequency path (pumping up performance with more megahertzs) is pretty much depleted. The next strategy was using multiple cores, but several years after them being in every device, we still see games that choke one core leaving the rest idle. This is because developers don't know how to/cannot paralelize the processing load.

So, the next generation of consoles is being delayed because a good chunk of the processing power of the current generation is not being used. It doesn't make much sense to build a console with double the number of cores if you still don't know how to use the number you have right now.


However, I don't believe CM's poor AI is the way it is for lack of computing power. They are just incredibly lazy. They recycled a graphical engine from a game that was probably not the best for an F1 game. They made a quite poor approach for the AI 2010. And they basically did not touch it for two years. Yes, if you try to simulate the other 21 cars with the 4 wheels, touching kerbs, etc, your computer will die. But there are many intermediate steps between that and just spitting lap times completely disconnected to the theoretical speed and track shape.
 

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top