Better chase AI?

Discussion in 'Ideas and Suggestions' started by mrwallace888, Aug 9, 2023.

  1. mrwallace888

    mrwallace888
    Expand Collapse

    Joined:
    Jun 17, 2015
    Messages:
    534
    Whenever I spawn a car and tell the AI to chase me, sometimes it behaves a little wonky. If I turn at an intersection there's like a 90% chance they brake late and just crash into something at high speed, because they didn't slow down enough to make the turn. I've tried to have a police chase countless times, but it's hard when as soon as I spawn a car and start a chase, within a minute I'm like "where did my chaser go" and when I switch back their car is wrapped around a pole or tree because they tried to turn at a 3-way at 60 MPH and failed miserably.

    I feel like there should be a bit more awareness with them. Get them to actually slow down enough to turn, but without messing with straight-line speed. I've noticed with long straights like on Johnson Valley, they don't give their car 100% and a lot of times they'll randomly brake and slow way down, then speed back up again. Even though the highway is straight.

    Plus, if they're chasing you on an empty map like the grid, they'll be behind you but if you dodge, they'll just keep going, bringing the wheel to full lock and driving off into the distance whilst massively understeering. Instead of slowing down when they're in front of you and attempting to actually turn around or something. Or try to brake in front of you to stop you.
     
    • Agree Agree x 15
  2. lolmaxcz

    lolmaxcz
    Expand Collapse

    Joined:
    Dec 13, 2020
    Messages:
    1
    i agree, polices chases with chase ai is impossible
     
    • Agree Agree x 2
  3. mrwallace888

    mrwallace888
    Expand Collapse

    Joined:
    Jun 17, 2015
    Messages:
    534
    I suppose the main thing is that the AI only sees roads, they don't see objects or walls, so they might think they'll go off the road a small bit when cornering when in actuality there's a wall along the side and a pole they don't see.
     
  4. Q龙宝贝

    Q龙宝贝
    Expand Collapse

    Joined:
    Oct 6, 2023
    Messages:
    1
    When AI approaches you, it defaults to hitting you at a speed 10 miles faster than yours. If you're taking a corner at the speed limit, it might deviate from its path. Changing it to 5 would improve this. Also, it seems AI has two aggressiveness settings: one adjustable in the AI app and another in the 'ai.lua' file. Police AI, upon reaching a three-star wanted level, sets the aggressiveness in the AI app to 1, causing them to charge at you relentlessly. The aggressiveness in the 'ai.lua' file is different. By modifying the code, I set the aggressiveness in 'police.lua' to 0.2 and in 'ai.lua' to 1. This makes AI drive very fast but slow down at corners. However, AI doesn't cut corners unless they're over 90 degrees. Also, if AI drives a vehicle with poor handling, it tends to go off the road. Debugging shows that AI sometimes calculates cornering speeds too quickly. When I try to adjust this, not knowing the algorithm, it either makes AI corner too slowly or even for a slight bend, it calculates a very slow cornering speed. Moreover, the calculated cornering speed doesn't differ much between vehicles with good or poor handling, causing the latter to easily go off-road. Please forgive me for using AI to translate this message.
     
    • Agree Agree x 3
  5. mrwallace888

    mrwallace888
    Expand Collapse

    Joined:
    Jun 17, 2015
    Messages:
    534
    It's fine, I can understand you almost perfectly.

    Well one thing I noticed too, AI seems to behave a little differently in general. If you're on a map without navigation like the Grid, things seem the same as before, but I noticed that on Ghost's Desert (it has no navigation data so AI just bee-lines towards you or away from you, which is fine because it's a big open area), AI drives really really slowly instead of at full throttle like before when in the sand. Like the AI's trying to calculate traction or something. I used to be able to have full-on chases in the desert, but now I can't because they only drive like 5 miles an hour.
     
  6. am pro fan

    am pro fan
    Expand Collapse

    Joined:
    Jul 22, 2021
    Messages:
    8
    can you provide info on how to modify the police.lua and ai.lua files? i have located them but unsure where the values are and which values to change
     
  7. kenman148

    kenman148
    Expand Collapse

    Joined:
    Nov 28, 2024
    Messages:
    1
    hello Mrwallace888 did u ever come up with a fix for that Ghost Desert problem? having AI chase me on there was one my favorite things to do and it still doesnt work. :(
     
  8. mrwallace888

    mrwallace888
    Expand Collapse

    Joined:
    Jun 17, 2015
    Messages:
    534
    Nope.
     
  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