I didn't know anything of this "ai_hints.ini" stuff before and now, thanks to you, I think this is brilliant and could be the perfect solution for the same problem I've in some other mod tracks where the AI drives too fast in some spots, especially before some tricky corners.
Can you please explain how to write a proper ai_hints.ini file or can you point me to any resources that explain it?
Again, thank you very much!
Well I will do my best to explain...
1) Open the ai_hints file (that you downloaded) in ks_nordschleife/nordschleife and on top you will see this :
; flugplatz
[HINT_0]
START=0.096
END=0.111
VALUE=0.40
In step 4 at the bottom of this explanation you will need the blue highlighted underlined section!
This "flugplatz" data isn't there in the original ai_hints file, I created it based on the data already present in the file AND based on the camera file of that track. If you want to create new ai_hint data for any track, you will need to understand how to relate to the camera positions on that track.
2) Open the camera file of nordschleife. You will see all data of all camera positions, like this one:
you will need the
underlined, highlighted green area in this data section. This is the start camera of the track, as the IN_POINT = 0. All camera's are positioned between 0 and 1 and have their specific start angle (IN_POINT) and ending angle (OUT_POINT).
[CAMERA_51]
NAME=51
POSITION=-498.051 ,141.1 ,2382.49
FORWARD=-0.47224 ,-0.0251615 ,-0.881219
UP=-0.0118839 ,0.999683 ,-0.0221802
MIN_FOV=10
MAX_FOV=10
IN_POINT=0
OUT_POINT=0.00750582
SHADOW_SPLIT0=20
SHADOW_SPLIT1=70
SHADOW_SPLIT2=300
NEAR_PLANE=1
FAR_PLANE=2000
MIN_EXPOSURE=0
MAX_EXPOSURE=10000
DOF_FACTOR=10
DOF_RANGE=10000
DOF_FOCUS=0
DOF_MANUAL=0
SPLINE=
SPLINE_ROTATION=0
FOV_GAMMA=0.75
SPLINE_ANIMATION_LENGTH=15
IS_FIXED=0
3) Find the right camera for the right area you want to edit the AI behaviour on track:
Based on the camera data, you will need to find the right area to edit in the ai_hints file.
First, record a lap on the track (just one lap from start, use quick race because the grid is your start camera position) by saving the replay.
Then, find the start camera in the camera file of the track, like demonstrated above.
Start your replay and count the camera's from start until the point you want to edit. Then go to the camera file and count the same amount of camera's starting from the IN_POINT=0 camera.
For Nordschleife this is :
[CAMERA_5]
NAME=6
POSITION=-2256.21 ,102.905 ,1453.21
FORWARD=0.637247 ,-0.0809126 ,0.766447
UP=0.0517291 ,0.996722 ,0.0622176
MIN_FOV=6
MAX_FOV=6
IN_POINT=0.0913458
OUT_POINT=0.121369
SHADOW_SPLIT0=12
SHADOW_SPLIT1=80
SHADOW_SPLIT2=450
NEAR_PLANE=1
FAR_PLANE=1000
MIN_EXPOSURE=0
MAX_EXPOSURE=10000
DOF_FACTOR=10
DOF_RANGE=10000
DOF_FOCUS=0
DOF_MANUAL=0
SPLINE=
SPLINE_ROTATION=0
FOV_GAMMA=0.75
SPLINE_ANIMATION_LENGTH=15
IS_FIXED=0
4) Now you know the referrence point of the camera, you can start editing the area in the ai_hints file because, here's the clue, the camera referrence points (IN/OUT_POINT) are roughly the same as the ai behaviour points (START/END). See the blue highlighted section in paragraph 1 on top ;-)
First, in the ai_hints file, name the area (just for convenience reasons) like following :
;flugplatz
then you create the new data by copying already existing data and pasting it in the CORRECT order and name the [HINT] file chronologically according to the others, rename them too. As the "flugplatz" HINT file comes before all others, it is named [HINT_0] and all others have been adjusted accordingly.
Then, by watching your replay, you can start playing around with the referrence points where exactly the ai needs to behave slower/faster.
for flugplatz this is
START=0.096
END=0.111
(see how the START/END value of the ai_hint file lies between the IN/OUT_POINT value of the camera file? )
The VALUE= is the amount of speed, power,downforce? I am not really sure?, an ai car uses to alternate its behaviour. You will need to play with this too, I had to drop this significantly for flugplatz and set it at
VALUE=0.40.
5)Test your data input to see if the ai behaves better and responds accurately. Based on this information, you should be able to create ai_hints files in any track.
Hope you learned a bit and I didn't make it too complicated.
Any further questions, shoot away