I have experience this problem recently and after some research I reached the conclussion that the problem is the car tyres.
Without deactivating RainFX, if the car has street/road tyres and one or more compunds in tyres.ini and the street/road tyres are set as the default ones, the AI car will enter in the pits in the first lap and will stay there. You can see this AI behaviour checking CSP log and you will see this phrase repeated to the infinity and beyond
:
"Car # is swapping rain tyres on fly (session has just started)"
Set other compound in tyres.ini as default and problem solved
After three hours of work, I found the solution today. Maybe this will help someone else...
I tested your suggestion, but then realized that many cars were still entering the pit on lap 1 -
even when "RainFX" was disabled!
But at least you've put me on the right track: Before your post, I hadn't even thought of checking the log files! In the file "...\documents\Assetto Corsa\logs\log.txt" I discovered after many attempts that certain vehicles started the race with only a single liter of fuel (The "Fuel Monitor" App said the same thing).
According to their "Pit Strategy", they (AI) therefore drove into the pits on the 1st lap - but not a single drop was refueled there.
Note: Fuel consumption was actually DEACTIVATED in CM!
____________________________________________
Here is a vehicle that started with ENOUGH fuel:
File "
log.txt":
...
Race strategy for car 1 [alfa_romeo_tipo_b], race laps:2
Max laps with max fuel:248.098313
CAR: 0 setting fuel for 3 laps, with mult=1.200000
Using RaceEnginner,Car::setRequestedFuel: 2.031453
fuelxlap=0.564292 fuel 2.031453
...
For two laps on the short test track, 2.031453 liters are completely sufficient.
Then I checked the fuel consumption of this working vehicle in the file "alfa_romeo_tipo_b\data\
fuel_cons.ini":
[FUEL_EVAL]
KM_PER_LITER=2.0
The test track is only 1 km long. The requested 2.031453 liters are sufficient for two laps (Total race distance about 2.2 km).
____________________________________________
Now a vehicle that immediately drove to the PIT and STOPPED there. This was logged in the "
log.txt":
...
Race strategy for car 0 [f1_1937_alfa_romeo], race laps:2
Max laps with max fuel:-0.000222
Divide race in -9027 stints
Fill for stint of 0 laps (base 0)
CAR: 0 setting fuel for 1 laps, with mult=1.200000
Using RaceEnginner,Car::setRequestedFuel: 0.000000
fuelxlap=-1128584.750000 fuel 0.000000
...
WTF ??? "fuel 0.000000"? Why is there no fuel in the tank?
It turned out that this was the
root of my problem:
"f1_1937_alfa_romeo\data\
fuel_cons.ini":
[FUEL_EVAL]
KM_PER_LITER=
-0.000001
Here someone wanted the car to use no gas at all. But here's the mistake: this person used a
MINUS sign!
According to the logic of the game, the tank would become fuller, not emptier. AC was not able to calculate a consumption from this (nor how much refueling should be done).
I don't know if the error was part of the original mod, or if I once downloaded an AI "improvement" on RaceDepartment...? I deleted the minus sign. Problem solved...