How does the AI know the dimensions of their car from center

Discussion in 'Car Modding' started by dosequis56, Jul 27, 2022.

  1. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,022
    Likes Received:
    2,880
    Maybe due to the e-Engines high Torque even at low RpM...
     
  2. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Where is the lookahead in AIW param? I found I can help it with step distance and speed step in talent file. but a global tweak would be great.
     
  3. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    What seems to make a huge difference is changes in the RCD file. StepDistance from 3.5 to 2.5 makes the AI get much further away from the walls and seem to respect the AIW path better. StepSpeed1 is 8.0. To my knowledge these values are in meters and meters per second, where each step is separated by StepDistance. From this, I would assume this actually 'reduces' the distance AI cars are looking down the track, but perhaps I have the definition of these values wrong. Perhaps StepDistance is a multiplier, which would make my spoeedstep1 value 20 MPH effectively; telling the AI to look ahead 1 waypoint at 20. This might explain why they can't see the walls on slow corners.
     
  4. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,390
    Likes Received:
    6,603
    Sorry, those are exactly what I meant :p

    As you've surmised, making them not look so far ahead (by either reducing the step distance, or increasing the step speed) can avoid them turning early into walls. To avoid affecting higher speed stuff you may have more luck only increasing the lower stepspeed values (so they need to be going faster in order to look another step ahead), but I imagine there could be a point where the stepdistance needs to be lowered for good results. Maybe a slight reduction in stepdistance and then compensate with higher values in the later stepspeed values will work ok. Don't want to overdo these sorts of changes to avoid some potentially strange behaviour as well.
     
    dosequis56 likes this.
  5. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    So please comment on this math for speed steps:
    StepDistance = 2.5
    StepSpeed1 = 8.0
    StepSpeed2 = 12.0
    StepSpeed3 = 20.0
    StepSpeed4 = 33.0
    StepSpeed5 = 45.0
    StepSpeed6 = 60.4
    StepSpeed7 = 70.9
    StepSpeed8 = 80.0

    StepSpeed1 says at 28.8 KPH, look ahead 2.5 meters.
    StepSpeed8 says at 288 KPH, look ahead 20 meters

    Then I suspect they may use waypointspan from AIW to determine how many waypoints to look ahead; but so far I haven't been able to create any changes in behavior from changing this value.
     
  6. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I just changed waypoint distance from 4.8 to 40.8 and I see no difference in AI behavior. Calculations all seem fine too so not sure what this value does.
     
  7. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    another thing I see. When I decrease the step distance, the AI cars DO better in entering the corners on the AIW path defined, but they have a tendency to drive in too hard and slide off the corners and whack the wall when the rear end steps out. So basically, they try to keep the AIW path but they can't quite do it thru the turns.
     
  8. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Thanks for the help. I was able to modify the collision mesh for Hybrid-22 cars to make it more square to cover the wheels of the F1 cars without gaps. This seems to fix a number of AI issues with interlocking wheels and strange crashes.
     
    atomed and DJCruicky like this.
  9. Dan-Ove Brantholm

    Dan-Ove Brantholm Registered

    Joined:
    Dec 27, 2017
    Messages:
    51
    Likes Received:
    13
    Have fighting this issue some time by myself and found this interesting thread... Last night I put some time in this matter (again...). I'm driving in the FSR leauge, and that car (FSR2023) also suffer a lot of this issue "thinking" it is 500 mm narrower than it actually is. So I took the graphic files from the FISI 2012 and took all the physics files from the FSR2023, and now the AI drive as good as they do with the FISI 2012... So for 100% sure as you guys already said in here, this must be a error in the graphic part of the car. I don't have the tool or knowledge to fiddle with collision part etc.
     
    Last edited: Aug 12, 2023
  10. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,390
    Likes Received:
    6,603
    If you remove the collbody completely from the .gen, the game will generate one. It won't be as good probably for car-car collisions, but the dimensions should be better than a bad collbody.
     
  11. Dan-Ove Brantholm

    Dan-Ove Brantholm Registered

    Joined:
    Dec 27, 2017
    Messages:
    51
    Likes Received:
    13
    Thanks a lot! That worked quite well. They seem to take the same lines like the 2012 FISI/FSR2023 Hybrid now. Hope I get some time this week try to race them too. I guess 50% of my registred rfactor2 time is fiddling with the AI... Maybe leagues make the cars collision mesh like this to ensure so you wont get a "false" collision depending on internet lag and interpolated car positions....?!
     
  12. Dan-Ove Brantholm

    Dan-Ove Brantholm Registered

    Joined:
    Dec 27, 2017
    Messages:
    51
    Likes Received:
    13
    Tested some more, and they still climb the curbs a little too much comparing with the FISI 2012/FSR2023 Hybrid.
     
  13. SharD

    SharD Registered

    Joined:
    Apr 17, 2019
    Messages:
    379
    Likes Received:
    438
    Try this in your .rcd file;

    //[[gMb1.002f (c)2013 ]] [[ ]]
    -F83Prost

    {
    default
    {
    StepDistance = 5.3
    StepSpeed1 = 15.0
    StepSpeed2 = 30.0
    StepSpeed3 = 50.0
    StepSpeed4 = 70.0
    StepSpeed5 = 90.0
    StepSpeed6 = 110.0
    StepSpeed7 = 135.0
    StepSpeed8 = 170.0
    DrivingLine = FAST,FASTEST,FAST_ALT1, FAST_ALT2
    CorneringCaution = 10.0
    FearOfWalls = 45.0
    OverSteerThrottleReaction = 57.0 //-85.0
    UnderSteerEffectOnThrottleMulti = 132.0
    UnderSteerEffectOnLineMulti = 102.0
    DraftStickinessMulti = 100.0

    }
    Alain Prost
    {
    Nationality = English
    DateofBirth = 08-28-1989
    Starts = 1
    Poles = 0
    Wins = 0
    DriversChampionships = 0
    Aggression = 98.6
    Reputation = 96.2
    Courtesy = 100.0
    Composure = 98.2
    Speed = 96.6
    QualifySpeed = 96.5
    WetSpeed = 95.2
    StartSkill = 99.0
    Crash = 4.3
    Recovery = 96.0
    CompletedLaps = 96.5
    MinRacingSkill = 100
    }
    }
     
    DJCruicky likes this.
  14. Nicola59

    Nicola59 Registered

    Joined:
    Dec 5, 2014
    Messages:
    157
    Likes Received:
    178
    Looking at the shown values, I would say:

    Stepspeed 8=170
    Means 612 km/h…..crazy value, like also the previous StepSpeed values…..the first stepspeed1 should be 10-12, max 14, to keep the last value on “human” speeds, considering that Stepspeed 8= 88-100….is like to say 320-360 km/h. These speeds may be good for a modern F1 or at least a Le Mans car. I suggest to stay with values adapted to the car driven by AI of your mod.
    For a Sport car, the max stepspeed could be 80.
    The stepspeed distance giving more control to AI is between 3.5 and 5.
    Higher values are making AI faster but less careful on corners, hitting kurbs and cutting corners.
    FearOfWalls =…….better a value around 90-95. AI drivers will respect better the track limits in Indy tracks or city F1 tracks.
    Finally, in RCD I should put CorneringCaution on higher values, such as 50-75 , considering that Aggression in the above talent file is too high in my opinion ( with 98.6 the behavior of AI driver may result unpredictable and unrealistic ).

    These are only my suggestions….
     
  15. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,390
    Likes Received:
    6,603
    The AI doesn't have to end up looking 8 steps ahead. Those values above are actually lower than the Skip Barber ones.
     
  16. Nicola59

    Nicola59 Registered

    Joined:
    Dec 5, 2014
    Messages:
    157
    Likes Received:
    178
    Hi, Lazza
    Thank You for your clarification
    Yes..You are right.....but the file was made in 2012, and I don't know if recently S397 Team posed attention on its stepdistance values

    //[[gMb1.002f (c)2012 ]] [[ ]]
    Skip_Barber
    {
    default
    {
    StepDistance = 5.0
    StepSpeed1 = 25.0
    StepSpeed2 = 32.0
    StepSpeed3 = 40.0
    StepSpeed4 = 55.0
    StepSpeed5 = 75.0
    StepSpeed6 = 95.0
    StepSpeed7 = 115.0
    StepSpeed8 = 175.0
    DrivingLine = OW3_FAST, rTrainer_Fast // Fast driving line to use as racing line, first in list has priority (max of 3 can be specified). Falls back to FASTEST if no specified paths exist
    CorneringCaution = 60
    UnderSteerEffectOnThrottleMulti = 125
    UnderSteerEffectOnLineMulti = 55

    Anyway, this not means the Skip Barber RCD is a good example.
    As You know, originally Skip Barber files were put in Mod Dev for a purpose: helping car modders.
    But, considering how many changes had been made on physics files in these years ( tyres, HDV, engine...etc ), we can say that Skip Barber files are really obsolete for this purpose.

    To have recent , and more useful data, You need the RF2 Spreadsheet.

    If You open the RF2 Spreadsheet, compiling the general data for the car, the step distances may be modulated, and edited in a "realistic" and proportionated way for the car on which your are working..
    I can understand, Lazza, what You mean saying " The AI doesn't have to end up looking 8 steps ahead. "....but in my opinion there should be a reason for which stepdistance values are 8...and not 2 or 3.
    Of course, the more these values are proportionated, the more AI driver will use all them... and its behaviour will be correct.

    But, as I previously told...this is only my opinion. What I tried here is to help our friends on Forum searching for some suggestions.

    Thank You for your observation.
     
  17. SharD

    SharD Registered

    Joined:
    Apr 17, 2019
    Messages:
    379
    Likes Received:
    438
    These values have stopped my AI cars from taking too much curb. I find that they are actually driving in a stable and reasonably realistic manner now. Their driving is never going to be 100% perfect anyway, as there are more values that influence AI behaviour.

    I am also using AIPerfUsage and;

    BaseDropoff=0.200 // RFM Drafting override: Higher number -> more drafting effect (default=0.185)
    LeadingExponent=0.80 // RFM Drafting override: Higher number -> lower effect on leader (default=2.0)
    FollowingExponent=2.70 // RFM Drafting override: Higher number -> lower effect on followers (default=2.0)

    ... to make sure the AI still overtakes, without them crashing into the back of other cars, like they used to before I altered these values.
     

Share This Page