Cop Cars Should Be Discouraged from Making U-Turns

Discussion in 'Ideas and Suggestions' started by DAYTONAAAAA, Aug 19, 2019.

  1. DAYTONAAAAA

    DAYTONAAAAA
    Expand Collapse

    Joined:
    Jun 14, 2016
    Messages:
    151
    The implementation of GamerGull's Traffic Tool has got to be one of the best implementations this game has seen yet. It's not perfect, and that's to be expected.
    With that said, I guess it wouldn't hurt to put forward suggestion.
    (I wouldn't call it a bug report, since the AI isn't really complete yet)

    So, one problem the AI Cops have now is that if they are ahead of the player and facing away from the player's position, they'll stop and do a U-Turn.
    This would be cool to see once in a while since it would practically make a roadblock, but it happens too often.

    So, in some sort of pseudocode, I suggest to implement the following feature to the Cop's AI:

    If player's speed>0,
    If the player is facing about ≤45 degrees relative to the cop car's direction, the cop should not turn around.
    If the player's distance from the cop car decreasing (meaning the player is going faster than the cop), the cop should begin to accelerate.
    Else, if the player's distance from the cop car is constant, maintain current speed.
    Else, if the player's distance from the cop car is decreasing, slow down the car (so the suspect will catch up).
    End if.​
    Else If the player is facing about ≥45 and ≤135 degrees relative to the cop car's direction, the cop should attempt turn around. Continue until angle between cop and player is ≤45 degrees. Once met, loop entire process.
    Else If the player is facing ≥135 degrees relative to the cop car's direction... Smash em straight on!
    End if.​
    Else if player's speed==0, continue Chase AI as normal. Continue until player's speed becomes>0 (if it does, loop entire process.
    End if.

    So... yeah. I've only began studying Comp Sci for about half a year now,so I'm not sure how much help this'll be. But I'll put it forward anyway.

    Looking forward to seeing how this game'll turn out!
     
    • Agree Agree x 5
  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