1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice

AI controlled racing

Discussion in 'General Discussion' started by KnoxBEAMER, Oct 29, 2022.

  1. KnoxBEAMER

    KnoxBEAMER
    Expand Collapse

    Joined:
    Oct 4, 2022
    Messages:
    4
    Hey guys. I just got my brand new computer put together and I can actually spawn in AI controlled traffic now. I have a few maps with racetracks. The AI traffic is great for regular maps. However, when I drive on the racetracks, the AI controlled cars don't race me or each other and I'm getting a large amount of traffic coming the other way, right at me.

    Is there a setting in the game already to make the cars behave correctly on racetracks or is there a mod that will modify the traffic to behave like racecars when they are on racetracks but still behave normally on regular roads surrounding the racetrack?
     
    • Agree Agree x 1
  2. LeavesFallDown_brand

    LeavesFallDown_brand
    Expand Collapse

    Joined:
    Oct 28, 2022
    Messages:
    48
    I’m not sure but hopefully someon can help. I’m commenting to follow the post thanks
     
  3. hacker420

    hacker420
    Expand Collapse

    Joined:
    Dec 29, 2017
    Messages:
    1,113
    you do realize there is a watch thread option right?
     
    • Agree Agree x 2
  4. r3eckon

    r3eckon
    Expand Collapse

    Joined:
    Jun 15, 2013
    Messages:
    600
    As far as I know there's no way to use regular traffic and have the traffic AI behave differently on different roads. If you want races against the AI your best bet is to disable traffic and spawn individual vehicles to race against.
    Take a look at ai.driveUsingPath in vehicle LUA. The function is well documented with a comment explaining what each parameter does.



    If you pass a looping waypoint path (first and last waypoints are the same) to this function with more than 1 laps the AI will enter "race" mode. Without this the AI wants to slow down for each waypoint.
    That's how I got the best AI behavior so far. AI still overuses brakes so it might end up crashing after a couple laps but it's way more competitive than traffic.
    It's also not a perfect AI, if you use the same config you're pretty much guaranteed to be able to beat it. For a challenge give yourself a performance handicap and try to beat the AI with good driving.
     
    • Like Like x 1
  5. KnoxBEAMER

    KnoxBEAMER
    Expand Collapse

    Joined:
    Oct 4, 2022
    Messages:
    4
    Awesome, thanks man. I'll try that.
     
  6. Jozef Behr

    Jozef Behr
    Expand Collapse

    Joined:
    Apr 11, 2022
    Messages:
    29
    yes may be it works...
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice