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

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

  1. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I am wondering if the issue with AI hitting walls is due to their lack of idea how large the car is? I find the AI constantly cut corners well beyond the limits of the collision corridor and cut corridor as if they have no idea how much space to leave for their car. F1 cars smack the wall with the rears constantly. Any help appreciated.
     
  2. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    VehicleWidth=2.0 from the HDV file?? 2.0, would that be 2 meters wide
     
  3. doddynco

    doddynco Registered

    Joined:
    Dec 13, 2017
    Messages:
    574
    Likes Received:
    1,217
    I thought vehicle width was just for the drafting calculations?

    Maybe they just use the chassis file to find the track width and the tbc to find the tyre width.

    But I don't know it could be something else.

    Getting the ai to work properly is the only part of rf2 modding i hate.
     
  4. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,044
    Likes Received:
    2,899
    At first the Question: Which Cars at which Tracks?
     
  5. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I can tell you that making the car twice as wide doesn't seem to alter how close they run the walls :)
     
  6. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    My question was generic. But for my case, 2022 F1 Hybrid at Monaco. I have them driving pretty well around the place but they smack walls under caution and I seem to have to move collision corridors many feet inside the walls before they stop hitting them under green. Just seems like they don't understand where the car is relative to corridors. NOTE: this is with line smoothing off; when that is on, they drive thru walls like they do not exist.
     
  7. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Monaco track is 2019 from SimRacingHub. The F1 cars have some mods, including talent files, multiple HDV files to get more realistic separation. Plus I give the AI a setup that has better turning radius so they can get through the Monaco hairpin.
     
  8. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    and does 'yes' mean 2 meters wide and NOT this is what AI use for car width calculation?
     
  9. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,044
    Likes Received:
    2,899
    It's in the [BODYAERO] Section and "explained" as
    RFM Drafting override: Helps determine base width of wake (default=1.9)
    So i don't think that it gets used for the physical Width.

    Does the AI behaves in the same Way on the S397 Monaco?
     
  10. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    I would have to test it. It certainly seems like a generic problem. There are many threads about AI not working in street courses because they pound the walls.

    Do you mean the 1966 Monte Carlo track? Not sure there is a modern F1 Monaco track.
     
  11. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    and yes, the 1966 Monte Carlo track shows similar behaviors. But I don't know what is done for collision corridors etc. Cars are bouncing off the walls even just racing which I have fixed in the SimRacingHub 2019 track.
     
  12. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,044
    Likes Received:
    2,899
    No, i mean the modern one, but it's called Circuit d' Azur.
     
  13. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Ok. I will see if I can find it and try.

    But I believe the root of the issue is that the collision corridor marks the 'middle' of the car, not the edge. So you have to set it half a car width off the wall. I just tried that in one corner and it has stopped the AI hitting that wall.
     
  14. DJCruicky

    DJCruicky Registered

    Joined:
    Jan 25, 2012
    Messages:
    1,597
    Likes Received:
    1,160
    The limits of the car are defined by the Collision mesh file of the car.
    Me curious myself I gave the Porsche 73 RSR car the same Collision mesh from the Boxmaster van. The Boxmaster size is a lot bigger.

    First video is me driving the car, deliberately crashing it off walls. See the orange box.


    2nd video is the AI driving the car. Looks like it does a good job of not crashing.
    It did take out all the haybales but.

    You can get the same Collision view by pressing Ctrl H in Dev mode.
     
    Last edited: Jul 28, 2022
    atomed and ThomasJohansen like this.
  15. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    Is it obvious where the collision mesh is defined in the vehicles or can you give me a pointer? Note I am only trying to make the offline racing work; not building cars or tracks.
     
  16. dosequis56

    dosequis56 Registered

    Joined:
    Dec 24, 2021
    Messages:
    133
    Likes Received:
    48
    with cntrl-H as you recommend, the collision borders of the F1 car look pretty good.
     
  17. DJCruicky

    DJCruicky Registered

    Joined:
    Jan 25, 2012
    Messages:
    1,597
    Likes Received:
    1,160
    You need a 3D program like 3DSimEd3 to view or modify car collision meshes. They could be called anything, usually have the name Col in the file name. For example rsr3_coll.gmt.
    Just for laughs and giggles, I widened the width of the mesh even bigger. Again, car did a good job at driving the track, until it got to the Chicane. Car did not drive any slower approaching the Chicane despite it's extra width, and clipped the first wall and crashed.
     
    dosequis56 likes this.
  18. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,410
    Likes Received:
    6,615
    Tweaking the AI waypoint params can help (so they don't look so far ahead at low speeds, effectively cutting the corner). Bit of a horses for courses situation.
     
  19. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    4,044
    Likes Received:
    2,899
    @dosequis56 Just out of Curiousity, i let the original F1 2022 drive a quick Race with 16 AI on the S397 Cote d' Azur Track and that looked OK in my Opinion.
    In Game AI Settings are default.
    Unfortunately there are so many Things and Settings that influence the AI Behaviour, that it is hard to judge, when someone has Problems, especially in Cases like yours, with a modified Track and Car (includes Talent Files).
    The rFactor 2 AI is not perfect as we all know, but as said, with the above Content, it looks OK here, but i have not tested excessivly.
     
    dosequis56 likes this.
  20. Manfredk2

    Manfredk2 Guest

    A bad example is Formula E
     

Share This Page