Jump to content

AI in police pursuits


Sgt.Kanyo

Recommended Posts

I have drastically lowered the number of police cars that spawn in Liberty City, that also helps making the pursuit more civilized. Sometimes, you're the only unit in pursuit in the area, and sometimes it's just three or four cars in total. That's pretty managable without getting hit and every intersection.

I think the spawn rate of police cars in GTA is generally far too high, might be a gameplay decision so that escaping as Niko is more difficult, but it just results in a crash derby when playing LCPD:FR.

But now that I use my custom popsycle.dat I rarely get problems with pursuits, and sometimes I even lose the suspect because there wasn't a unit close to the suspect, and I like that. Before you just couldn't fail pursuits because there were cops at every corner.

Link to comment
Share on other sites

I often loose the suspect and locate him only with AI's assistance. If they were only to follow me we would loose him together :D

 

However, I did what Crickethill suggested. Less police = less possibility to get rammed. AI helps a lot in pursuits, in my experience. 

Link to comment
Share on other sites

I just turn off AI pursuits and never call the pursuit in. It is a bit silly not having back-up units but at-least I don't get T-boned at every intersection. 

 

Yeah that's pretty much what I did as well. Also it'd be nice to turn off random pursuits altogether, since there's always a pursuit in my area every 5 - 10 minutes.

Link to comment
Share on other sites

I just turn off AI pursuits and never call the pursuit in. It is a bit silly not having back-up units but at-least I don't get T-boned at every intersection. 

 

Thats exacly what I do. AI are just too chaotic.

Link to comment
Share on other sites

I like the idea, it gets a bit messy when I got AI Cops crashing into this and that driving into peds on the sidewalk, then their car catches fire and I got exploding police cars.

''A quiet man, is a thinking man. A quiet woman, is usually mad.''

https://www.youtube.com/channel/UCneXHlrPoVEPhCVCRCS6aIw

 

 

 

Link to comment
Share on other sites

Alright first of all sorry if this has already been mentioned, but I've just had a great idea, that the ai cops taking part in the pursuits, should only follow the player, like the bikers in TLAD. This way they won't move way too aggressive on the suspects. No more unrealistic ramming at high speeds, they'll let you PIT the suspect. I'd also suggest following the player with a bit of distance, so if you brake hard into a corner, they won't ram you. One of the reasons why I disabled (well tried) the ai police pursuits, is because the cops were way too unrealistic about it. I'm thinking this should be either hard coded, or that there should be a button where you can change the ai cops behaviour. Also when you exit the vehicle, this following thing should stop, and then they can overtake your car and position themselves for a felony stop.

 

Another thing I'm pretty sure was mentioned is the felony stop. For example if you find out that the suspect is wanted, the traffic stop immediately turns into a felony stop, where you can give out orders to the suspect, and you don't have to walk back to his/her car.

 

 

As for the AI following the player I would hope thats able to be toggled, What about double pursuits? I've had many incidents where two or even three cars split up in a pursuit, if all the AI are following me, they can't apprehend the other(s). Yes, I've seen the AI arrest fleeing suspects without me being there, mostly on foot but I'm pretty sure by car as well. It's a good idea nonetheless but it should just be added to the pursuit menu.

 

More control over the AI is always great.

 

As for toggling ground units already in F8 pursuit menu, that just determines weather the AI will ram the suspects car or not. If you have them on passive they stay a good distance back and let you do the work, while staying in pursuit, as where aggressive they'll start ramming the car and trying to pit it, which is where things get messy when you have HUGE pursuits. I limit my pursuit AI to 3 or 4, even that can get hectic.

 

in addition to overall pursuits I would LOVE if the pursuit can be considered ended at either: your own will (QAM menu to call off pursuits) or have it automatically end when you CUFF the suspect, as where backup still comes endlessly until they are in the car which is pretty annoying in my opinion. This is hopefully fixed in 1.0d

Edited by Sonny236
Link to comment
Share on other sites

Alright first of all sorry if this has already been mentioned, but I've just had a great idea, that the ai cops taking part in the pursuits, should only follow the player, like the bikers in TLAD. This way they won't move way too aggressive on the suspects. No more unrealistic ramming at high speeds, they'll let you PIT the suspect. I'd also suggest following the player with a bit of distance, so if you brake hard into a corner, they won't ram you. One of the reasons why I disabled (well tried) the ai police pursuits, is because the cops were way too unrealistic about it. I'm thinking this should be either hard coded, or that there should be a button where you can change the ai cops behaviour. Also when you exit the vehicle, this following thing should stop, and then they can overtake your car and position themselves for a felony stop.

 

Another thing I'm pretty sure was mentioned is the felony stop. For example if you find out that the suspect is wanted, the traffic stop immediately turns into a felony stop, where you can give out orders to the suspect, and you don't have to walk back to his/her car.

 

Having them follow you is a bad idea, if you crash into another car or miss a turning while in a pursuit, or if you end up rolling over a lamppost into a hedge the AI is gonna follow you into said hedge, the suspect will almost always get away (I say almost because there could be a rare occasion where he too crashes and dies). This would kill my street race callout which has 2 vehicles split, it would kill any instance where an ordinary pursuit leads to the passenger escaping on foot/jacking another car, and it would also make the player more prone to witnessing pile ups.

 

Having them follow at a distance so they don't ram you when you brake hard, well see this is hard coded and can't really be done realistically. Telling the cop to follow the player/suspect means they will go to the exact location of the player/suspect. If you stop, they crash into you, reverse and suddenly they are not where you are again so they crash into you (repeat previous until explosion or violent rage of anger/quit occurs).

 

I do like the idea of a traffic stop automatically becoming a felony stop if they have a warrant for arrest etc, but for now, as with many of the answers to the felony stop suggestion, you can just cancel the traffic stop and order the suspect out of the car, gun drawn and then handle it as a felony stop. The AI LCPDFR has should then randomly assign the suspect to flee or surrender (I'm not sure if this is built to consider the warrant they have or not, but I do believe that warrant/information sticks with them even if you cancel the stop, until the game deletes them from memory, I'm sure the dev's would correct me if I'm wrong).

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

Link to comment
Share on other sites

Having them follow you is a bad idea, if you crash into another car or miss a turning while in a pursuit, or if you end up rolling over a lamppost into a hedge the AI is gonna follow you into said hedge, the suspect will almost always get away (I say almost because there could be a rare occasion where he too crashes and dies). This would kill my street race callout which has 2 vehicles split, it would kill any instance where an ordinary pursuit leads to the passenger escaping on foot/jacking another car, and it would also make the player more prone to witnessing pile ups.

 

Having them follow at a distance so they don't ram you when you brake hard, well see this is hard coded and can't really be done realistically. Telling the cop to follow the player/suspect means they will go to the exact location of the player/suspect. If you stop, they crash into you, reverse and suddenly they are not where you are again so they crash into you (repeat previous until explosion or violent rage of anger/quit occurs).

 

I do like the idea of a traffic stop automatically becoming a felony stop if they have a warrant for arrest etc, but for now, as with many of the answers to the felony stop suggestion, you can just cancel the traffic stop and order the suspect out of the car, gun drawn and then handle it as a felony stop. The AI LCPDFR has should then randomly assign the suspect to flee or surrender (I'm not sure if this is built to consider the warrant they have or not, but I do believe that warrant/information sticks with them even if you cancel the stop, until the game deletes them from memory, I'm sure the dev's would correct me if I'm wrong).

 

The AI following the player would work great, if the player played realistically. Irl cops don't drift into intersections, or crash into lampposts, so if you actually played like a cop, there would be no way that you'd crash or miss a turn. If you manage to roll over and the car is on it's roof, you'd get out of the car, in which case like I said, the pursuing units would stop following you. Having two suspects, both in different cars would be extremely rare, and if we wanted to get by that problem, what we could do is like assign half of the units following 1 guy, and the other half following the other guy, then the player could choose which 1 he/she wants to follow.

 

Having them follow in a distance is pretty easy. You get the x y z coordinates of the player, and you add say... -5 meters on the Y axis. It works perfectly in TLAD, I don't even think, this would need to be coded, since it's already in the game.

 

Hmm what do you mean by disabling the traffic stop? Like pressing the traffic stop button again after you check the guy's id on the police computer? Wouldn't the suspect then just drive off casually?

Also a felony stop, is not just a "get out of the car" thing irl. I believe it could be made pretty nicely. Like you could order the suspect to throw the keys out of the windows (using the animation, they use for throwing out garbage out of the window) or you could have the option to call for backup (like in most cases) or tell them to keep their hands up and keep backing up until you can arrest them (since you don't want to walk up to the suspect's car at a felony stop).

Link to comment
Share on other sites

The AI following the player would work great, if the player played realistically. Irl cops don't drift into intersections, or crash into lampposts, so if you actually played like a cop, there would be no way that you'd crash or miss a turn. If you manage to roll over and the car is on it's roof, you'd get out of the car, in which case like I said, the pursuing units would stop following you. Having two suspects, both in different cars would be extremely rare, and if we wanted to get by that problem, what we could do is like assign half of the units following 1 guy, and the other half following the other guy, then the player could choose which 1 he/she wants to follow.

 

Having them follow in a distance is pretty easy. You get the x y z coordinates of the player, and you add say... -5 meters on the Y axis. It works perfectly in TLAD, I don't even think, this would need to be coded, since it's already in the game.

 

Hmm what do you mean by disabling the traffic stop? Like pressing the traffic stop button again after you check the guy's id on the police computer? Wouldn't the suspect then just drive off casually?

Also a felony stop, is not just a "get out of the car" thing irl. I believe it could be made pretty nicely. Like you could order the suspect to throw the keys out of the windows (using the animation, they use for throwing out garbage out of the window) or you could have the option to call for backup (like in most cases) or tell them to keep their hands up and keep backing up until you can arrest them (since you don't want to walk up to the suspect's car at a felony stop).

I'm still heavily against them following the player. I don't know maybe the genius mind of the dev's could make it work, but to me it sounds too daft.

 

I mean, if you were playing it realistically you first off wouldn't be the lead officer every time, you would be backup in some pursuits, which would cause havoc with the AI following you. You may well drive reasonably and skillfully but the AI can't. It doesn't matter how much you try, the AI drives the way GTA IV tells it to, you can't tell them to drive any other way without complicating things or causing more issues.

 

Yes having them follow at a distance is easy (not the way you suggest though, because they would get horrendously stuck when you begin travelling along the X-axis) you would have to have a complex check to ensure they are ___meters behind you (which requires checking orientation of the player and the AI, it also becomes algorithmically complex because for each AI you have to check it's position, which scales per car added). But if you did have them follow behind, say you do lose control of the car or you stop for whatever reason, suddenly all of the AI behind you hits that invisible wall (distance check) and goes from 60mph to much much slower (depending on the player's speed etc), how would you go defining if an AI car is past the distance check when they are already hard hitting the brakes to stay behind you. It would look god awful aesthetically, would be as unrealistic as it already is and would even cause pile ups behind the player (which I guess is some improvement because then you can't see the chaos)

 

As for the felony stop I mean press shift to cancel the stop, aim your gun at them and order them out of the car using the keybind. Traffic AI in GTA Iv will keep them in place by the roadside until they can pull out into traffic, so you have a bit of of a window to issue the command. Order them out of the car then at gunpoint still "detain on foot" or whatever and voila, one felony stop.

I'm not against the felony stop idea by the way, I rather like your suggestion, I'm just providing you with an alternative until such a thing exists.

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

Link to comment
Share on other sites

The AI following the player would work great, if the player played realistically. Irl cops don't drift into intersections, or crash into lampposts, so if you actually played like a cop, there would be no way that you'd crash or miss a turn. If you manage to roll over and the car is on it's roof, you'd get out of the car, in which case like I said, the pursuing units would stop following you. Having two suspects, both in different cars would be extremely rare, and if we wanted to get by that problem, what we could do is like assign half of the units following 1 guy, and the other half following the other guy, then the player could choose which 1 he/she wants to follow.

 

Hmm what do you mean by disabling the traffic stop? Like pressing the traffic stop button again after you check the guy's id on the police computer? Wouldn't the suspect then just drive off casually?

Also a felony stop, is not just a "get out of the car" thing irl. I believe it could be made pretty nicely. Like you could order the suspect to throw the keys out of the windows (using the animation, they use for throwing out garbage out of the window) or you could have the option to call for backup (like in most cases) or tell them to keep their hands up and keep backing up until you can arrest them (since you don't want to walk up to the suspect's car at a felony stop).

Actually, I encounter 2 suspects pretty often, and sometimes up to 4 (armed robbery callout, a drug deal callout when dealers flee, etc). So I do need at least one AI car on them, since even the air unit can't handle them all. Another thing is foot pursuit. If you realistically play as a fat sergeant you won't chase them your own self, you'll let the beat cops do it. With the AI following I already imagine a long line of cops following the player running. Like that :D

l_df1daf4e.jpg

 

I believe you could press M, which stops all the traffic, and when you cancel the traffic stop, suspect stays put so you can order him out, order to put his hands on his head (search command) and safely deal with the situation. 

Link to comment
Share on other sites

@Hastings

Yes, but what I said only applied to vehicle pursuits. Like I said, if you get out of the car, the AI will be free to move where ever they want to.

 

@LukeD

What I usually do when I want to do a felony stop is quickly run back to the suspects into the marker, and then run back to my car, and order them out of the vehicle at gunpoint with F10.

 

Well it doesn't have to be 5 meters, I only mentioned that as an example. Actually what would be nice is probably 1 meter behind the player, so when you turn, they won't end up on the sidewalk like you said. Also unless you respond to a vehicle chase, then you should always be the leading unit, since you're the one who started pursuit. Also I'm not sure if I understood you correctly, but GTA must have a way to acquire the player's position. Obviously that changes all the time, while you're moving, but all you have to do is, always ask for the xyz coordinates of the player and add some number to the Y axis, making the new position behind the player. There's no invisible wall there, it's just a position that you can use for the AI. If they overshoot it, they'll just stop. Once you start moving, they'll start following the position. If your problem is the AI having to deal with other AI cops behind you, well they'd do the same job, just like you said in front of you, but at least this time, they are behind you, so they won't block you. Anyway tbh I'd rather play it a bit more unrealistic, as in always being the lead unit, just so the AI won't mess up.

 

I guess we'll have to see what the devs will come up with, if they do.

Link to comment
Share on other sites

@LukeD

What I usually do when I want to do a felony stop is quickly run back to the suspects into the marker, and then run back to my car, and order them out of the vehicle at gunpoint with F10.

 

Well it doesn't have to be 5 meters, I only mentioned that as an example. Actually what would be nice is probably 1 meter behind the player, so when you turn, they won't end up on the sidewalk like you said. Also unless you respond to a vehicle chase, then you should always be the leading unit, since you're the one who started pursuit. Also I'm not sure if I understood you correctly, but GTA must have a way to acquire the player's position. Obviously that changes all the time, while you're moving, but all you have to do is, always ask for the xyz coordinates of the player and add some number to the Y axis, making the new position behind the player. There's no invisible wall there, it's just a position that you can use for the AI. If they overshoot it, they'll just stop. Once you start moving, they'll start following the position. If your problem is the AI having to deal with other AI cops behind you, well they'd do the same job, just like you said in front of you, but at least this time, they are behind you, so they won't block you. Anyway tbh I'd rather play it a bit more unrealistic, as in always being the lead unit, just so the AI won't mess up.

 

I guess we'll have to see what the devs will come up with, if they do.

 

If you set it to drive to the XYZ position of the player that is relative to the mapping system and NOT the heading of the player. (eg. player position Y - 5 will always be 5 SOUTH of the player, Y+5 is 5 NORTH etc)

Doing the maths to figure out the position 5 meters BEHIND the player (relies on the heading of the player) is not difficult, it's just more maths which you have to evaluate each tick to ensure the AI doesn't fuck up. It's not necessary when you can just say "chase suspect" and let the GTA IV hard coded AI deal with it.

 

As for the invisible wall, that was me badly explaining something. If you check in code (if statement) for a specific condition (in this case distance to the player) it will only evaluate to true if that condition is met eg if (distance <= 5).

 

That's great and all but, what do you actually do then if they do get to the desired place (less than or equal to 5)? Well you can force the cop car to stop which would cause horrendous issues behind you and look worse than it does now. (forcing the car to stop literally means instant stop. Which would cause a huge pile up or very dodgy traffic problems).

 

Alternatively you could re-task them to drive to the player but slower. This issue there though is that it won't solve the problem because the AI cop will "slow down" but still drive directly at the player so if you stop, or you do anything other than go forwards, you'll have 1 to 20 cop cars up your ass (huge pile up, probably death). Also, if you do stop, AI COP 1 will crash into you which will cause your position to change, meaning they are no longer at your position so will crash into you again. Same applies for the rest of the cop cars. If you didn't want them to crash into you you would need to evaluate the code faster, which means more cycles of the logic, which means more processing power, which means heavier use of resource on your pc. GTA IV is resource heavy enough on it's own without LCPDFR. This would kill several machines if you did it too fast. Also, by the time you have gotten out of your car for the code to evaluate this and reset the AI to chase the suspect, you'd have been run over 6 times, killed and the game then crash because player does not exist for the AI to evaluate distance to.

 

Now to explain what I meant by the other AI cop cars handling this. Each time the program cycles through this code it has to evaluate the players position and compare it to every single AI cop car behind the player. If you have 1 cop car, fine, it will tailgate you rather happily until your pc eventually dies (a very long time basically), but if you add a second one, it is now fighting for the most pinpoint accurate position possible. you cannot fit 2 peds at a specific coordinate, let alone 2 cars. So each one will nudge the other out of the way, now multiply this by however many cop cars you have in the chase and you will end up with explosions behind you due to vehicle damage. You're also having to evaluate a lot of different positions in order to ensure every car stays where it is meant to.

 

This isn't a case of "A little bit more unrealistic", its going to cause more issues than it already does, it will look a lot worse and the game won't play the same.

However, I am just talking from my experience based on what I know and how the AI handles driving to points (see my ambulance, or my removal team etc, I have done lots of behind the scenes experimenting with the AI's travelling style too), it could be that LMS or Sam pulls a rainbow out of their ass and produces some highly efficient super epic piece of code which makes this possible, but they would be rewriting game AI to do this from what I know.

 

I guess we will just have to wait and see if they take you up on this, but personally, I don't think it's worth it.

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • Create New...