I try to improve AI pit-stop behaviour in the Rain

Discussion in 'Modding' started by 1frey, Nov 20, 2021.

  1. 1frey

    1frey Registered

    Joined:
    Aug 9, 2017
    Messages:
    30
    Likes Received:
    3
    We all know racing against the AI in wet condition is not fun. The AI cars destoy their races by pitting too many times.
    This makes Rain in offline racing completely useless.

    Car:
    URD EGT Darche
    Setup: 5 AIs, 1 x tire wear, 1 x fuel usage, 100% rain from the start of the race.
    Initial behaviour: All AIs always pit in first and second lap (1. stop for Inters, second stop for Full-Wets).
    upload_2021-11-20_20-29-4.png


    Attempt #1:

    Changes:
    Removing the Inter tyres from the TBC file
    Resulting behaviour: AI does not pit twice in first and second lap anymore. Only one stop in the first lap, which is still not nice :-(

    Attempt #2:

    Changes:
    Decrease WearRate value in TBC file for Rain tyre to make it last longer
    Resulting behaviour: AI only pit in once in the first lap and only one more pit stop which is fine.

    upload_2021-11-20_20-37-28.png

    So the AI hebaviour during wet condition is sill broken since they always pit in the first lap. They start with the correct tyre (Wet) but then unfortunately go in for a new set of wet tyres which makes no sense.

    Can this be fixed somehow or is this hardcoded in the rF2 AI code and can only be fixed by S397? @Marcel Offermans @Christopher Elliott

    I keep on investigating all AI related settings in the hope I can fix it somehow.
    Who wants to join me doing some research and log it in this thread ? :)

    Greetings
     
    Last edited: Nov 20, 2021
  2. 1frey

    1frey Registered

    Joined:
    Aug 9, 2017
    Messages:
    30
    Likes Received:
    3
    Finding #1:

    Changes: Rain starts at 1/2 of the race. Start of the race is dry (scripted weather slots: clear, clear, 100% rain, 100% rain, 100% rain).
    Resulting behaviour:
    Works perfect. Just one stop for Wet tyres when the track is wet.

    So it's only broken when it's wet from the start.
     
  3. davehenrie

    davehenrie Registered

    Joined:
    Jul 6, 2016
    Messages:
    7,611
    Likes Received:
    4,497
    If you save the real road track conditions from the last session before the race start, it should also save the wet condition. Then you can load the real road settings before the race. I think this only works if you end your warmup or Qualifying session with the same weather as the start of the race. So if you want wet conditions at the start, ensure the previous session ENDS with wet weather.
     
    1frey likes this.
  4. 1frey

    1frey Registered

    Joined:
    Aug 9, 2017
    Messages:
    30
    Likes Received:
    3
    Idea: Plugin-based approach.

    @Lazza Is it possible to suppress the pit stop or the pit stop request of the AIs via the plugin interface? Do you have an idea if something in this direction would be possible? (I mentioned you as the ultimative plugin interface expert ;))
     
  5. 1frey

    1frey Registered

    Joined:
    Aug 9, 2017
    Messages:
    30
    Likes Received:
    3
    Thanks @davehenrie I can confirm it on my second try.

    So I added a warmup session to the race day and also set the start of the race to 100% rain chance (it rains the whole race from the start).
    In the warmup it was raining, so I let the session progress for a while. AI had put on Wet tyres. I saved the real road.

    When I jumped to the race session the real road was probbably not transfered to the race since the AI pitted in the first lap again but for Slick tyres this time:

    upload_2021-11-20_21-54-1.png

    But when I started a new race event (exit to main menu) and select the previously saved real road for the rain event, I made it work as @davehenrie mentioned. I could also visually see that the track was fully wetted from the start.

    Result:
    upload_2021-11-20_21-57-7.png
     

    Attached Files:

    Last edited: Nov 21, 2021
    davehenrie likes this.
  6. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,610
    Likes Received:
    6,759
    Nope, no control at all over AI. Sorry.
     
  7. 3377

    3377 Registered

    Joined:
    Oct 16, 2010
    Messages:
    108
    Likes Received:
    57
    @1frey personally when I did got this problem of AI pitting to much under rainy conditions was due to the track itself : or the drivable part were not set as a "WET" material. Or the puddle map was not present. These two parameters corrected the AI never pit after one lap
     
    atomed likes this.

Share This Page