The Big Problem With A.I. In Changing Weather Conditions & Possible Solution

Small rain race.jpg
Many modern simulators now impressive weather and environment simulation systems, everything from sunny days with hot tracks to storm clouds and wet tracks with real time drainage, fog, drying lines, changing track temperatures and even seasonal foliage!

There are even sims now that have real-time weather so you can experience the actual weather in that location on the day you decide to race there, it really is quite amazing!

You can choose to race in the dry, race in the wet, or even have a race where the weather changes several times throughout your session, so you may experience all types of weather during the course of a race, this is great for long endurance races.

Having these changing conditions adds a whole new element to the experience, allowing you to plan your strategy, think about tires, wear, pitstops and adapting you're driving style to each different situation.
Feeling the difference between a very cold track and a hot track, gauging how long a change in weather might last and if it's worth staying out on slicks if it starts to rain, but may not last long.
There are even sims where you have to change your driving line as the rubbered in parts of the track go from grippy to slippery as the weather changes from dry to wet!

To be honest It really is quite astonishing to see how far the software has come over the years, and even older titles that do not yet have these capabilities are developing them for the future, for instance iracing announced last year that rain will be coming to the popular simulator at some point.

I love to jump into a server which has a varying weather forecast and seeing who turns into Ayrton Senna in the rain and who can't stand it (Like Ann Peebles).
It brings such an atmosphere to the race, just watching the transitions (especially with accelerated day to night transitions) can be spectacular by itself!
I remember doing a few one hour races with a full accelerated 24hr cycle and changing conditions in VR with my friend Pete, we were both just blown away by the experience!

The amount of time and work the developers must put into these amazing features must be absolutely mind boggling!
Just the artwork alone for the changing textures, seasonal foliage, rain, cloud and sky animations must be a monster task!


With some sims having real light sources and sun rays that beat down on certain parts of the track warming it up, where other parts are in the shade, are cooler and take longer to dry out after a shower. Even large tracks like the Nordschleife where it might be raining on one part of it but not the other, the level of variation is simply amazing!..........

But what if all these amazing features and hard work by the devs are rendered completely redundant and useless for anything other than hotlapping because of one major problem???

What if you can't race online due to an unsuitable internet connection or being just too far away from the servers you'd like to race on? What if you work unsociable hours and by the time you do get online there's hardly anyone around to race with, or you simply just prefer to race offline?

Have you ever bought a sim based on the fact that it has all these great weather capabilities? You're really excited for an amazing race with changing conditions and pitstops, so you've set yourself up a two hour endurance race. You've chosen your track and car combo, you've put in many practice laps getting to know the circuit, spent time tuning your car, planning your pit strategy and you are absolutely raring to go!

You put in the first hour of hard racing, you're doing pretty well and holding position, there's been some amazing moments already and you're feeling totally immersed in the competition!
As it gets to the end of the hour it starts to rain so you all pit for wet tires, you pull out of the pits and the track is now soaking wet but you are prepared and ready to concentrate!

Then all of a sudden, the car infront that you've been having a fantastic battle with all the way through is a bit slow through the first corner and you pass it with ease, you're feeling pretty pleased with yourself but now you're thinking about the challenge now in your rear mirror, but it never comes! Infact, you pass the next car, then another, and another, has there been some sort of problem?

Three laps later and you've overtaken the whole field like they were on a pace lap, the cars have disappeared and you're on your own, you've even slowed right down and they're still not catching. You're dumbfounded, all the challenge has gone from this great race you were having, the feeling of utter immersion has gone and you feel totally deflated! What's just happened???

Well, simple... You've just experienced poorly calibrated A.I.

This is a major problem affecting many otherwise great sims! It may not even be that as soon as it starts to rain the A.I. suddenly act like they've lost 20HP, it could be that they become unrealistically fast in the rain and no matter how well you drive you just can't get anywhere near them and off they go into the distance.

The difference in the A.I.s ability in different conditions can be so large that you are forced to ditch all of these amazing weather features and stick to just racing in one condition, unless you have the time to trawl through servers looking for an online race with changing conditions against other players.
Maybe you're a very busy person and you don't have time for that and just wanted to set up a race and go in your two free precious hours, but now you realise all that money you spent on the sim and it's amazing features has gone to waste, all because of bad A.I. Such a shame!

So, what can you do to solve this?

Well, if your A.I. skill slider goes from say 50% to 120% and you are as fast as the A.I. in the dry at 100%, when you want a race in the wet but you know the A.I. are too slow or fast in the wet, you can then adjust the slider up or down by up to 20% either way to compensate, problem solved, but it's not ideal.
What if you are really fast and your slider is already at 120% in the dry but the A.I. are slow in the wet, there's no further you can turn it up to compensate for that. Not only that you can't change the slider value mid race for a session with changing conditions, so racing with varying conditions is completely out of the window anyway!

The problem is further compounded by different players abilities in the wet. You may be an absolute God in the wet, or you hardly race in the wet at all, so on the odd occasion you do fancy a race that changes from dry to wet it's not possible as you just can't keep up with the A.I. in the wet, even if the A.I. in that sim are pretty well calibrated.

Custom A.I. files

There are certain sims that offer custom A.I. files (like Automobilista 2). These are files within the games program folder that allow you to change certain values of individual A.I. driver's attributes, such as their ability in the rain, usually called something like "Wet Skill". These files can be opened and edited with Notepad.
In AMS2 this ranges from 0.0 to 1.0 and is good for fine tuning, for cars that are only slightly faster or slower in the wet this value is very good for fine tuning, however in cars with large differences between the conditions it is not enough.
There is information on how to do this here.

Rfactor 2 has something similar but its a lot more complex and involves MAS files, information on the process can be found here.

As already mentioned, this may not be useful if the range of changeable values is too small. Also, if you are not prepared to go digging around in program files this may not suit you, or you may simply not have the time as usually values would have to be changed for each individual A.I. driver.

It must be an absolute nightmare for developers to program how fast the A.I. are in different conditions in the first place, let alone taking into account the problem of a players individual skill level mentioned above, they of course have no idea what your individual skill in the wet is!
One might suppose all they can go on is the cars level of capability in either condition, but with many sims using A.I. that don't use the same physics as the players car this again must make things rather difficult.

Even with great calibration, because of varying abilities between players in such conditions, one player may still find the A.I. are a bit out of whack with them when it rains where as another might find them fine, so how do the developers please everyone?

How about this.... Let the player decide!
In the video below there is an idea for a possible solution to this problem, the video is fully time stamped so you don't have to watch the whole thing, you can go straight to the idea by clicking on the timestamp titled:

"Idea for possible solution to the big problem!"

This section is only a couple of minutes long and should not take up much of your time (but hey, if you've managed to make it this far through the article, I guess times not too much of an issue!).
There are other points in the video however that you may find useful, such as why I personally find that Assetto Corsa Competizione (you may of course disagree) has the best A.I. calibration between conditions, out of all of the examples used
Also, there are two examples of how big the difference between dry and wet can be in the same sim, using exactly the same skill level.

I would love to hear your thoughts on the idea as Sim racers. Maybe you know something about A.I. programming and could expand on whether it's a feasible idea or not. Maybe you even have a better idea?
Also, which sim (or car class within a sim) do you find suits you best when it comes to racing against the A.I. in the wet and changing conditions?

Any discussion is good as at the end of the day, a problem solved is beneficial to all of us!

About author
Tarmac Terrorist
If I can drive it, I'm Rocking it!!! Besides writing sim racing articles I am running my own YouTube channel called Tarmac Terrorist

Comments

GTR2 had "wet weather" where the AI had extra grip compared with the player, but also had its share of AI problems in the dry. I distinctly remember running 1-hour races at Spa where the AI would steadfastly refuse to pit and just cruise around with worn tyres multiple seconds per lap off pace until you passed all of them.

Plus ça change, plus c'est la même chose.
I haven't experienced that in gtr2 and it is for sure the sim I spent more time on, especially because I run championships with full race length. In the rain, they were in line with the real times and I could deal with them on the same level than on the dry. I did not run one hour races in gtr2, only sprint races and full lengths ones. I've never experienced any AI pitting issues, you may habe found a bug with this one hour length. The only big issue with the AI was its loss in performance because of the aero damages due to multiple contacts between the race cars. After some time the AI was not competitive enough. I'm sure the AI published here on racedepartment improved that crucial annoying aspect.
The other issue with the AI is that at the first sign of rain it entered immediatly in the pits to change tires. You could just wait 2 or 3 laps, havkng taken a lot of advance, just to check if the rain was continuing. I had several time a big surprise, the rain stopping and the AI habing to pit again. That's why random changing weather is good but it may be limited to a long period of time, in order to avoid this AI flaw (and how to occult an AI limit with a game design decision, as in FEAR). It is not fully realistic as you know you have to pit at the first time of rain, but your experience remains flawless.
 
Have to say I can't disagree more, but you're entitled to your own opinion!

IMO the sorts of AI things we're mostly talking about are not demanding w.r.t. computing power - they're sets of heuristics, for example to switch to a 'wet line' or handle changing weather pit strategy. That takes developer ingenuity and imagination to design robust decision rules, but not computing power.
I am not contradicting you either. The fact of having an overpowered AI is not my taste either, it remains a video game and the pleasure of daytime in fun conditions remains my main criterion. If all I feel is frustration and spending hours tweaking the AI to make it playable (to feel like I'm winning), then yes I'll sign up. It reminds me of games where strangely we were constantly stuck by the opponents or everything was hazed in terms of settings but it was exciting (for example Split Second)

To come back to my initial comments, in fact the complexity of the AI is not only about the players' behaviour but also about the fact that the AI must know how to manage :
- the power of the car,
- manage tyre wear,
- manage tyre strategy,
- manage fuel,
- manage damage
- manage the sensations with the track whose temperature can change according to the day, the place, etc
- manage the sensations with the track if it starts to rain,
- manage the lights, windscreen wipers,
- managing pit stops and driver changes in long races,
- managing the flags,
- managing speed,
- ...

I don't remember on which website or video I saw this but all these parameters are very complicated to calculate live and it requires machines that don't exist today except with the power of the cloud
 
@G_B we'll just agree to disagree. :)

IMO it's a developer's job to make a product that works out of the box for the user. AI racing shouldn't require tweaking other than Difficulty % and Aggression level. AMS1 is a great example of just how well this can be done if developers put the effort in to tweak parameters just right. No rain, I know, but still, it shows it can be done.

Most of the subtleties the AI need to manage (e.g. dry line or wet line, pit strategy, lights, wipers, flags and racing rules) can be done through simple, non computationally expensive heuristic decision rules i.e. "see this, do that". The challenging one is having an AI drive a car given track grip levels, tyre wear, and so on - but this is a solved problem in today's and yesterday's sims, be it with simplified physics (e.g. isiMotor2) or player physics (e.g. Assetto Corsa). I believe most sims either use some kind of neural network model or a PID controller, but this sort of thing is (for now) out of my depth. :D
 
Last edited:
The only big issue with the AI was its loss in performance because of the aero damages due to multiple contacts between the race cars. After some time the AI was not competitive enough. I'm sure the AI published here on racedepartment improved that crucial annoying aspect.
I think so. That issue is easily fixed with a high AeroMin value in the car damage file - I bet GTR233's HQ patch for GTR2 does this.

The other issue with the AI is that at the first sign of rain it entered immediatly in the pits to change tires. You could just wait 2 or 3 laps, havkng taken a lot of advance, just to check if the rain was continuing. I had several time a big surprise, the rain stopping and the AI habing to pit again. That's why random changing weather is good but it may be limited to a long period of time, in order to avoid this AI flaw (and how to occult an AI limit with a game design decision, as in FEAR). It is not fully realistic as you know you have to pit at the first time of rain, but your experience remains flawless.
Isn't one way to fix this to have a number of carefully assembled weather text files that don't have too many weather changes to avoid confusing the AI? I've never done this, but maybe would be a useful mod to create at some point :)
 
I think so. That issue is easily fixed with a high AeroMin value in the car damage file - I bet GTR233's HQ patch for GTR2 does this.


Isn't one way to fix this to have a number of carefully assembled weather text files that don't have too many weather changes to avoid confusing the AI? I've never done this, but maybe would be a useful mod to create at some point :)
Now that the random weather exe file doesn't work on modern systems. I've always thought that maybe simbin had cut this functionnality, changing weather during the race, on purpose to avoid this issue and the lack of strategy diversity of AI.
I found a few years ago a weather generator, you had to launch it before the game, to generate the file you mentioned. I assume ypu could easily change whatever you wanted. What I don't like with this kind of generator is that you know before the race exactly what will happen and what strategy you can elaborate. The same with pcars2 were you know exactly the moment and the length of the weather change. And what was good with the exe file is that it took in account some statistics about the weather included for each track (more chances to get rain in a UK track). If I remember well the weather generator did not do that.

About the aero damage : indeed, but the car damages were reduced in general, althpugh other types of damages did not need to be lowered.
 
I found a few years ago a weather generator, you had to launch it before the game, to generate the file you mentioned. I assume ypu could easily change whatever you wanted. What I don't like with this kind of generator is that you know before the race exactly what will happen and what strategy you can elaborate.
I think the way to overcome this would be to have a large number of weather presets (say 10-20) in text files, then use a command prompt app like GTR233 uses to setup the HQ Patch to rotate randomly between them. Or maybe a Crew Chief addon ;). So you'd know the weather presets were well-optimized, but you wouldn't know which one was working. :)
 
And, if you do some research, you'll realise that this impressive AI is not complex at all. It is a simple AI used in a really clever level design which made it impressive. Yes it is still great nowadays but level design in FPS has been for many years.
This channel:

Has a lot of great videos going into the AI techniques used by a lot of games.. very interesting watch.
 
summarizing everything:

"....happiness...comes from having a REAL IMMERSIVE RACING...not a REAL DRIVING"

users (we) do NOT want "perfect" driving simulators for hotlap... (youtubers want those)

we want a RACING simulator (with reasonably real strategies, real rules, real year seasons, weather, correct tire wear... and that the AI ADOPTS THE BEST STRATEGY IN THE RACE, that takes advantage of the dry groove, and cools its tires in the puddles.. etc)
everything that we could do in the race... that the AI can do as a strategy... (also use inverse strategies)
all this...(make the race more real) is MORE IMPORTANT...than if it is a real driving simulation....(didn't you understand?...I'll explain it below)

A) because of problems with the ai, tires, puddles of water etc... we all usually do a NON-STOP SPRINT race.... to avoid related problems....
B)because of having a "PERFECT" driving simulation....there is no room in the CPU for a full race...or for a smart AI...that's why there is AC, boring hotlap simulator...
C)because of having ALL THE POSSIBLE CARS OF ANY CATEGORY...the games look EMPTY...there are no complete seasons...no real rules of a real season of any category...
D) because of bad AI there are difficulty bars (called "aggressiveness", "speed"...or whatever you want to call it), the creators didn't do all the work...and they let YOU ADJUST THE AI in EVERY RUN. ..because the circuits are also bad .. (or some sectors)

if it has ONE category, and ONE year, with all the cars...only the real tracks of that year, and that the AI takes full advantage of the strategies, and CONSTANTLY ADAPTS TO YOUR LEVEL....plus some real rules ..and a "moderately real" driving simulation...we'll be happy.... (as with f1c (love it), gp4 (never tried it because i think f1c is better...and gtr2 (like it)

"....happiness...comes from having a REAL IMMERSIVE RACING...not a REAL DRIVING"
 
"....happiness...comes from having a REAL IMMERSIVE RACING...not a REAL DRIVING"
I mean, they're both great, let's not go too far with all this :roflmao:

But in addition to driving sims like AC, sounds like there's a bunch of us who'd love a really solid racing sim too, including the possibility of pit stops and wet racing :)
 
of course....I didn't say "you either have this...or you have that...not both".... BOTH are important and should be in the package...I just said "priority", it should be a great racing simulator first...and a great driving simulator second.

we all really feel in the game...(full immersion)...when we think about our strategy, when we think about how the weather can change...and more importantly...we think about how the ai will decide, and how it will try to beat us (by strategy or by driving)... that's what we think about when we are in a long race....
...during the tour we may enjoy the driving simulation...(of course)

..but what makes us think the most is how the AI will decide, and adapt our strategy to them (or them to us)
if from the beginning the ai is BAD (VERY BAD, Or predictably bad, without strategies, as in rfactor)...the whole race is lost....NOBODY wants to run a 24 hour race knowing that the AI in the rain did not change to rain tires...and 2 hours after starting...you have an invincible advantage...(or vice versa, that they are not affected by the rain and you are)... that and also that they are not intelligent when passing, conserving tires, cooling them in puddles, making us "overcut" or an "undercut".

Because of these problems, we often choose a sprint race...and that's why there are many "perfect driving simulators" (they really are)...but very bad racing simulators.
 
the only one that is saved is ACC (not to be confused with AC)....I haven't tried it...but knowing that it was made for only ONE CATEGORY...and having ALL the rules of that category...
I quickly realize that he has a good balance of AI and strategies and physics.

instead AC...as it is "open" for any car...it has no defined rules, nor exact racing simulation.(much less strategies)

that's why F1C (only f1, only f1 rules, only f1 ai, and only f1 strategies and only f1 physics)...make him unbeatable.
(and that I only use keyboard...and that's why I haven't tried gp4...sorry;))

as proof of this is that f1c has variable weather in real time (20 years ago!), in case it stops raining, a "dry line" will form and it also affects the ai, besides being (I've seen it with my own eyes) affected by slipstream...(if you go off the ideal path on a straight...they can't catch you)
you can even do a mini-race with "scaled" fuel and tires (greater consumption of both)...and do a short race...but have the same strategies as a long race (2 stops, in a 20-lap race for all cars (yours and the ai's) for example)
the last example that I have seen is that several times... I have seen that between teammates there are TEAM ORDERS... (at first I thought it was a coincidence... but after seeing it several times... I think it is something actual in-game)...
I saw a driver give way to his partner because he was fighting for the championship... with one lap to go he let him pass easily (I saw him several times). I think this is not even in gp4
 
the only one that is saved is ACC (not to be confused with AC)....I haven't tried it...but knowing that it was made for only ONE CATEGORY...and having ALL the rules of that category...
I quickly realize that he has a good balance of AI and strategies and physics.
Not ALL the rules in ACC, sadly. The big one missing is no safety car functionality. Which is, on the face of it, no big deal... might even be positive, since no one likes driving around behind a SC. But... it does matter a bit for enduros, where the respite of a safety car could help you recharge and be less tired.

(and that I only use keyboard...and that's why I haven't tried gp4...sorry;))
FYI GP4 has outstanding keyboard controls, so much so there was once debates about whether it was faster to drive using a keyboard. Knowing how isiMotor titles like F1C can feel on a keyboard, I would bet GP4 feels better, actually.

as proof of this is that f1c has variable weather in real time (20 years ago!), in case it stops raining, a "dry line" will form and it also affects the ai, besides being (I've seen it with my own eyes) affected by slipstream...(if you go off the ideal path on a straight...they can't catch you)
you can even do a mini-race with "scaled" fuel and tires (greater consumption of both)...and do a short race...but have the same strategies as a long race (2 stops, in a 20-lap race for all cars (yours and the ai's) for example)
Impressive that it had dynamic weather so long ago, but also so did GTR2, don't forget. And to my knowledge GTR2's implementation is higher quality, since it's running a newer isiMotor version and has extra functionality added by SimBin like an early LiveTrack-like system. And neither GTR2 or F1C hold a candle to PCars2, AMS2, or ACC in terms of the weather and wet track simulation details, of course.

One thing sims, to my knowledge, haven't done – have AI drive off-line on the wet part of the track to cool their wet tyres once rain stops and a drying line emerges. This would be cool to see.

Speaking of AI and slipstream, in all isiMotor 1 and 2 titles (e.g. F1C, GTR2, rF1) the AI don't know how to drive by an opponent in a straight line after drafting behind them and pulling out. They will drive behind a car, and wander out as if to overtake, but will only actually overtake by outbraking into a corner - otherwise, they fall back into line. A real immersion-killing bug. AMS1 has some extra code that sort of overcomes this, but not totally. And (for example) I've seen AI slipstream and overtake purely on a straight (e.g. at Monza) in GP4.
 
Hi folks!

The video I made to go with this Article shows that the GTE's A.I. drivers in AMS2 had some major speed and ability differences in different weather conditions, making racing in changing conditions with them not really an option. However I also mentioned that not all car class'es in the sim are like this, infact some are very good at it, and also that Reiza are gradually refining all the class'es A.I. to iron out these issues.

So I thought it would only be fair to make a video showing one of those class'es in AMS2 where it all works really well! Turned out to be much more than that, one of the most exciting races I've had against A.I. in any sim! I can tell you now, this one had it all!

This race was so fun and exciting I had to do it twice! So there's a part two to this video, and I can tell you now, one thing that really stands out about Reiza's A.I., they never give you the same race twice!

Hope you enjoy, Bravo Reiza, keep it up!
 

Latest News

Article information

Author
Paul McCaffrey
Article read time
7 min read
Views
16,943
Comments
55
Last update

To join the OverTake Racing Club races I want them to be: (multiple choice)

  • Free to access

    Votes: 116 87.2%
  • Better structured events

    Votes: 22 16.5%
  • Better structured racing club forum

    Votes: 23 17.3%
  • More use of default game content

    Votes: 17 12.8%
  • More use of fixed setups

    Votes: 42 31.6%
  • No 3rd party registration pages

    Votes: 48 36.1%
  • Less casual events

    Votes: 13 9.8%
  • More casual events

    Votes: 41 30.8%
  • Other, specify in thread

    Votes: 6 4.5%
Back
Top