AI and hitting stationary cars

Hi folks,

Been searching the internet here looking for more discussion on an issue I have that might only be mod and track related in parts so I thought I'd start a thread to hear some expertise.

Issue I have is cars staying on the middle of the track when they retire or have an engine failure rather than pulling off to the side. This then leads to the other issue of cars not seeming to be able to avoid cars that are stationary on the track; they'll slow down for the car but most will clip it on the way through.

Primarily I am noticing this while using 1997 FIA GT cars and Hockenheim 1999. I've tried a few things suggested on this forum and elsewhere; changing some of the AI values in the PLR file (I think the AI Min Radius value is meant to help but I'm not sure how, would like to hear more about this one) and editing/adding FeelerFlags in each car's HDC file (bumping them up to 15 instead of 0 or 1 or whatever) and it seems to have helped somewhat but it's definitely still an issue.

Anybody have advice on how to edit car and track files in order to curtail this issue?
 
Perhaps this will help (from an old nogrip thread):

"2. AIW File

One of the most neglected aspects by the modders groups. If your track has a defective AIW file, you can either fix it (if you really like the track) or leave it alone only for online races. If you decide to go into it, then you'll play around with these values (if your AIW file doesn't have those lines, insert it manually!)

slowwhenpushed=0 // Insert it! Most tracks don't have this line and it cures the stupid AI slowdown when you're pressing them.
AIDraftStickiness=(3.0000) // Insert it! Ai cars stay on the draft for more long and it helps one to overtake the another.
AIRange=(1.0000) // The software core will calculate the AI performance based in two parameters: the *.RCD ability (see below about RCD file) plus the AI Range. 90% of their speed is based on RCD file, the remaining 10% is from the AI Range. If AIRange=1, the difference between the driver will me maxed to 100% of RCD values. It helps to avoid the bunch up races and gives more value to each driver ability. If you set this number too low (0.1, for example), the drivers will drive almost all the same.
AISpec=(0.0000,0.0000,0.0000,0.0400) //Insert it! This value theorically wouldn't work in GTR2 (it came with 1.255 version of Rfactor) but from my experience, it seems to work. It's for fine tuning and works in percentage (0-1), basically for AI slowing down. If you're experience unrealistic AI acceleration, increase the first value, if they're are too fast in straights, increase the second, if they're cornering too fast (seldon to see), increase the third and finally increase the last one if they're breaking unrealistically close to the apex. In this case, I've raised the last value to 4% and it helps to avoid rear-end AIs.

3. *.HDC File

There's a number of tweaks which can be made in the physics vehicle file. They are:

AIMinPassesPerTick=0 // The default values are too low (e.g. =2) so you must increase to 6, 7 or even 10. If you want the AI cars being simulated in real time, set it to zero, but anything above 6 will produce a more realistic AI physics simulation. However, this will demand more CPU, so if you don't bare a good i5 or i7 is better to be careful and avoid 10 or zero values.

FeelerFlags=15 // This will create the most possible accurate collision detection system, but you'll need to use the collision feelers. This part would be optional, since you'll need 3DSimed to get the real car dimensions for each competitor. But, if you willing too, it's a worth effort.

First, delete the "//" (comment marker) from the collision feelers lines and remove the line "FellerFlags=X" from the top of it, since it's already informed at the beginning of HDC file.

Now, you need to know the coordinate system is strange (at least for me):

+x = left
+y = up
+z = rear

Second, you'll notice there's a bug in most of cars I've seen so far which is the wrong signal for FeelerTopFrontLeft, FeelerTopFrontRight, FeelerTopRearLeft and FeelerTopRearRight. The lines below are already fixed, so pay attention on it. Left is always positive and right is always minus!

//FeelerFlags=15 // or remove this second instance or simply leave the "//" infront
FeelerOffset=(0.0, 0.0, 0.0) // leave it alone, it won't be used.
FeelersAtCGHeight=0 // Set it to zero. You'll provide all real corners coordinates for the car.
FeelerFrontLeft=(1.003,0.384,-2.554) //front-left corner collision feeler
FeelerFrontRight=(-1.003,0.384,-2.554) // front-right corner collision feeler
FeelerRearLeft=(1.003,0.384,2.586) //rear-left corner collision feeler
FeelerRearRight=(-1.003,0.384,2.586) // rear-right corner collision feeler
FeelerFront=(0.064,0.384,-2.639) // front side collision feeler
FeelerRear=(0.064,0.384,2.587) // rear side collision feeler
FeelerRight=(-1.039,0.384,-0.247) // right side collision feeler
FeelerLeft=(1.039,0.384,-0.247) // left side collision feeler
FeelerTopFrontLeft=(0.478,1.540,-0.298) // top front-left collision feeler
FeelerTopFrontRight=(-0.478,1.540,-0.298) // top front-right collision feeler
FeelerTopRearLeft=(0.652,1.511,2.323) // top rear-left collision feeler
FeelerTopRearRight=(-0.652,1.511,2.323) // top rear-right collision feeler
FeelerBottom=(0.064,0.249,-0.247) // bottom feeler

To know the real car dimensions, you'll have to open it in 3Dsimed. Take note of dimensions, subtract 10 cm from each one (helps to prevent the AI to AI crash without significant visual glitches), change the values above (double checking the signals + and -) and remember to leave the rear-wing out of the box - it's not nice to see the car turning over based in the rear-wing position, it's preferable to leave the wing going through the tarmac than the strange "rigid rear-wing" effect when turning over.

If you have patience enough, the amount of AI to AI crashes and the physics reaction will improve a lot by following this procedure. If you don't use feelers, the game will create a automatic box around the car which could be pretty rough for calculations.

RearBrakeSetting=36 // some modders make a little confusion here and put improper values to this variable, causing oversteering in AI cars and causing havoc on some tracks. Example: Daytona Road Course, where the first corner is after a really hard braking zone where the wheels are still steering. Using the value = 36 (or so) you'll have a AI brake distribution (64:36) which can be very bad for human drivers, but it's good for AI. I often see values as 60 or 55 here, and it means a brake distribution (40:60) or (45:55) which is way wrong and induces demolition derby due a lot of spinning. Remember when you adjust this value the default setup car will be 64:36 (in this case) so, you should change it before drive your car (or on the fly).

BrakePressureRange=(0.00, 0.01, 101)
BrakePressureSetting=100

I caught this values from AI Reborn and it seems to help a lot on preventing AI to AI crashes. Theoretically it shouldn't be like this since the default value is 80 + 20 = 100 % of pressuring but for some reason it doesn't. So, I advice to use those lines in HDC files.

ABS4Wheel=1
ABSGrip=(1.05, 0.25)

Those lines give more brake effectiveness for AI. Default are 1.00, 0.20 but I found with those values there's less AI rear ending during the races.

AITorqueStab=(0.95, 0.95, 0.95) // This is a very known tweak (thanks Dutch Devil) which works only when there's a contact between 2 AIs or human car versus AI. Most of you probably noticed that AI cars is rock-stable and closely to impossible to make them spin out. By reducing this values down to 0.95 make they obey the physical laws, so when they crashes onto you (or vice-versa), they have not magical stabilization anymore. Working along the AITorqueStab we have more variables as AIEvenSuspension, AISpringRate, AIDamperSlow, AIDamperFast and AIDownforceZArm. I'll not take too much time on those, they're pretty well covered by DutchDevil tutorial (pinned thread of this forum).

AIDownforceBias=1.0

This is a percentage between the AI setup downforce (0.0) and scripted downforce calculated by the game (1.0). If you're not using AI specific Setups, you should use 1.0. In certain sort of tracks as Le Mans with very long straights, to have a good AI Setup might be the way to go (more details further). But if you're lazy to make a setup for each car, you'll rather set this value = 1.0 and let the computer calculates the correct downforce. But it will not give proper gear ratios to AI."

---------------------------------

AI Min Radius is tricky, from what I can tell it controls the distance at which tehy are aware of other vehicles; set too low and the AI is like NASCARE - constantly "trading paint", but set too high and they are too busy staying out of each others' way to race effectively.


And again I recommend reading Von Dutch' AI Tutorial and Barry's GTR2 Reborn, both have extensive information on adjusting the AI.
 
FeelerFlags=15 // This will create the most possible accurate collision detection system, but you'll need to use the collision feelers. This part would be optional, since you'll need 3DSimed to get the real car dimensions for each competitor. But, if you willing too, it's a worth effort.

First, delete the "//" (comment marker) from the collision feelers lines and remove the line "FellerFlags=X" from the top of it, since it's already informed at the beginning of HDC file.

Now, you need to know the coordinate system is strange (at least for me):

+x = left
+y = up
+z = rear

Second, you'll notice there's a bug in most of cars I've seen so far which is the wrong signal for FeelerTopFrontLeft, FeelerTopFrontRight, FeelerTopRearLeft and FeelerTopRearRight. The lines below are already fixed, so pay attention on it. Left is always positive and right is always minus!

//FeelerFlags=15 // or remove this second instance or simply leave the "//" infront
FeelerOffset=(0.0, 0.0, 0.0) // leave it alone, it won't be used.
FeelersAtCGHeight=0 // Set it to zero. You'll provide all real corners coordinates for the car.
FeelerFrontLeft=(1.003,0.384,-2.554) //front-left corner collision feeler
FeelerFrontRight=(-1.003,0.384,-2.554) // front-right corner collision feeler
FeelerRearLeft=(1.003,0.384,2.586) //rear-left corner collision feeler
FeelerRearRight=(-1.003,0.384,2.586) // rear-right corner collision feeler
FeelerFront=(0.064,0.384,-2.639) // front side collision feeler
FeelerRear=(0.064,0.384,2.587) // rear side collision feeler
FeelerRight=(-1.039,0.384,-0.247) // right side collision feeler
FeelerLeft=(1.039,0.384,-0.247) // left side collision feeler
FeelerTopFrontLeft=(0.478,1.540,-0.298) // top front-left collision feeler
FeelerTopFrontRight=(-0.478,1.540,-0.298) // top front-right collision feeler
FeelerTopRearLeft=(0.652,1.511,2.323) // top rear-left collision feeler
FeelerTopRearRight=(-0.652,1.511,2.323) // top rear-right collision feeler
FeelerBottom=(0.064,0.249,-0.247) // bottom feeler
This is the solution :thumbsup:
 
jgf, that is excellent thank you very much! It's a shame NoGrip is no more, making this info harder to find, but at least it's here for people to see.

For now I'm gonna leave the collision feelers (except for feelerflags) and see how we go with the other settings since it's a lot of .hdc files to go through - using Notepad++ makes mass editing a lot easier but if the other settings don't suffice I'll have a look at drawing up my own collision feelers.

I'll let you folks know how it goes - thanks again!
 
Last edited:
Hey folks - want to thank you guys again for the help on this issue, while it the issue hasn't been completely negated it has lessened enormously making the mod I'm using a more enjoyable experience. I haven't done the collision feelers for each individual car as I simply don't have the time sadly, but I'm definitely happier with what I have.

The other issue I have is fuel however - and this I what I think causes AI to stop on the racing line as I think they pull off with engine failures and the like - I have found that no matter what I do with the FuelUsage line in the AIW file (including that method of multiplying the lap length by 16 and using the resulting figure), there's always a number of cars running out of fuel (this causes explicit mayhem as you can imagine). After testing with vanilla cars, the HQ cars with modded tracks and vanilla tracks the only thing I can see that causes this issue is the vehicle files itself.

Do you guys know where to start in regards to eliminating this issue?
 
Hi again folks, apologies for the bump but I would like to ask again if anyone has any advice on the above. I think the answer I'm looking for is in the .eng files of each car. There are two lines, FuelConsumption and FuelEstimate which might do the trick but I've no idea how it is calculated (the consumption line seems to be a formula which doesn't help matters) and haven't had the time to test variable values. What do you guys think?
 
Fuel use is controlled by several parameters.

If the issue is with any car at only one track you will have to work with that track's AIW file.

If the issue is with all cars at all tracks, there is an AI Fuel Mult in the .plr file; higher number - higher fuel consumption across the board.

If the issue is with one type of car in one mod, work with the .eng file for that car. The fuel consumption setting is for that engine (thus any car using that engine). The fuel estimate works in conjunction with the track's fuel usage to determine how much fuel the AI get for a race (computes the engine's fuel consumption with the track's fuel usage and the race length).

From an old nog rip post:
"1.) If the race distance requires more fuel than the AI tank capacity, the AI will always get a "full" fuel fill at the start and for all remaining pit stops meeting this same condition.

2.) When the remaing race distance (last pit stop) does not require a full fuel fill, the AI will get just enough fuel to finish the race.

3.) If the original race distance requires less fuel than the full AI tank capacity, the AI will get a partial fill with just enough fuel to complete the race distance, and no pit stops for fuel will be required.

This seems to be the AI fuel strategy independent of the player's car fuel strategy and independent of the AI set-up."

So if any of the values in the track or .eng files are off the AI do not compute their fuel usage correctly.

Also, and this is just conjecture, if too many cars are assigned to one pit stall (in their .car files) and one car needs to pit for fuel but the stall is occupied that car will stay out and try to pit on the next lap ...if he doesn't run out of fuel.

BTW, the "GTR2 MultiEdit Tool" can help with car editing:

" Multi Edit Tool
It basically works this way: You mark base GTR2 folder, it scans for all CAR and HDC files, you then select several CAR or HDC files and in Change Key Value window you set which value you want to change and in which way and press Execute button and the application will modify that value in all selected files. It can also be used for finding out how particular value differs in several CAR or HDC files.
 
Last edited:
Thank you for the info jgf, I'll try tinkering with the .eng files during the week, I've a couple of questions though;
  1. Can you tell me anything about the different variables for the Fuel Consumption line? The line has letters (for instance one file reads '5.82e-5') in them so I'm not at all sure how I'd go about amending them. If they're running out of fuel would that mean I decrease this value or Fuel Estimate?
  2. Thanks for telling me about Multi Edit Tool, however I can't seem to find a working link - the one on DrivingItalia.net just takes me to random website. Would you be able to provide me with a link or a copy of it?
 
BTW, before you break out the slide rule (lol), if the issue is only with one type of car check the fuel tank. Seems too obvious but with mods misprints can happen, I had a mod converted from rfactor where a Mercedes was good for two laps at a five mile track, an evening of cursing before I noticed the tank had a capacity of 6L (a bit of online research divulged it should be 96L).

HDC file > FuelSetting=90
amount is in litres.
 
Back
Top