Police and AI racers

Questions

Hapillon
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 4 years 11 months

Police and AI racers

Postby Hapillon » Tue Apr 23, 2019 9:10 pm

Hello everyone,
I'm new on those forums as this is my first post there, but I wanted to ask a question concerning the police during checkpoint races. I've found that they do not trigger against AI racers when those are off screen. When they are on screen, they trigger sometimes and they don't other times, it seems pretty random. Furthermore, even if they do trigger, the chases stop if the player is too far away. I found this behaviour quite unusual so I'm coming to you for details since I couldn't find any answers on the internet. What I'd like to know is what exactly causes the police to chase the AI racers and whether or not their behaviour could be changed, as in, removing the "range" limitation or something to that effect. I know there is at least one mod here that disables the max number of active police units, so I was wondering if further modification to their behaviour was possible. I'm talking about Midtown Madness 2, by the way.

Thanks

User avatar
Franch88
MM2X Admin
MM2X Admin
Posts: 15758
Registered for: 16 years 9 months
Location: Italy
Been thanked: 1 time
Contact:
Italy

Re: Police and AI racers

Postby Franch88 » Wed Apr 24, 2019 11:12 pm

Hello and welcome here. :)
In this topic was already discussed about the rare chance that AI cop cars put in a race can chase opponents.
About that behavior of the cops, it's implemented in that way in the game. It can be seen as a normal thing because you succeed to escape from the cops. Can also happen that the AI cops stop from chasing you if going too much far from the roads (rarely it happens in the default cities if you don't use a mod like Drive On Water one, which practically extends the drivable ground surface in SF, for example), this because the moving of the cop cars is controlled by the .bai files, which are used to manage the AI traffic and pedestrians, and so, also the paths that cop and races opponent vehicles follow (by following the player car in the case of the cops, and by following road intersections set in specific files in the case of races opponents).
Probably you're talking about this, which isn't a mod and it's only at MMArchive. As far as I know, the game can be instable managing more than 3 active cop cars, and can get random crashes. This is all hardcoded stuff, it's really hard to speak about new possibilities to change it.
Fiat 500 = Italian motorization. Franch88, MM2 eXtreme forum and website Administrator.
|Franch88's MM2 Releases|

Hapillon
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 4 years 11 months

Re: Police and AI racers

Postby Hapillon » Wed Apr 24, 2019 11:47 pm

Hey there,

Thank you for your reply, now that is really interesting. Diatosta seems to have gone a lot farther in this than I did. In one of his posts, he talks about tweaking the .aimap file for the races...something about altering the distance at which the cops pursue ? Is this something that would help in terms of increasing the likelyhood for the cops pursuing the AI racers ? I'll have to admit, I don't know much about the inner workings of that game, so any help would be appreciated.

Thanks

Edit: I fully watched the videos and this is AWESOME ! I want to know what he did and how he did it. Which files govern that types of behaviour ?

Edit 2: Ah yes, something else I wanted to say. Even if you're in range, as shown by Diatosta, there is still a 50/50 chance that the police does not trigger against the AI. And this is something I have noticed too. Is there more detail available on that factor ?

User avatar
FXANBSS
MM2X Active User
MM2X Active User
Posts: 686
Registered for: 11 years
Location: Midtown Club, Discord
Been thanked: 4 times

Re: Police and AI racers

Postby FXANBSS » Thu Apr 25, 2019 7:23 pm

Cops have a 0.5 chance of following AI opponents, it is still random though.. as sometimes at first they don't chase but then they chase depending of random positions between you, the cop and the opponent. Unless it is 1.0 and I believe it always happens

Take a look

Code: Select all

[Police] 1 vpcop -416.000000 59.000000 -521.000000 -90.000000 0 15 0.5 50
(the first 4 numbers are coordinates, X Y Z and rotation)

The 0.5 is there, it's default value
and the 50 at the very right side is the chase radius.. is not for the player, but for the opponents, which means the higher this value is, they can start chase to opponents from much further, which is crazy

MWU (Most Wanted Ultimate) plays a lot with these mechanics


BONUS:

Code: Select all

[CopChaseDistance] **any number here**
This handles the maximun distance of chase for cops, over this limit and then you lose them
The problem is... you may have this higher than default but there is another distance limit, which does FREEZE them in place, about the same distance as the default of CopChaseDistance, NOTE this doesn't happen with opponents.
So you will notice the red cop triangles not disappear, but they will freeze if you too far from them

Fun fact: The cops don't have this later limit in "Midtown Madness 2 Beta 1" so they can just move freely everywhere!

User avatar
cody
MM2X Occasional User
MM2X Occasional User
Posts: 340
Registered for: 18 years 5 months
Location: United States
Contact:

Re: Police and AI racers

Postby cody » Thu Apr 25, 2019 10:32 pm

If that second limit (the one at which the cops freeze) isn't present in the first Beta, then it might be possible to change it, most likely with a HEX-editor.

@Aaro4130: Any chance you could find a way to change the distance at which the cops freeze?
My Member Number is prime. LOL!

Hapillon
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 4 years 11 months

Re: Police and AI racers

Postby Hapillon » Fri Apr 26, 2019 1:13 am

The limit at which the cops freeze is the one when they're chasing the AIs, right ? If the AI and the cops stray too far from you, the cops will freeze... Eventually, they will lose the AI racer and deactivate.

EDIT: Okay, so I did some testing (restarted a race about 20 times). Now, I'm not sure if changing the 0.5 to 1.0, really helped, but I think it did, most cops trigger reliably against AI racers. However, I found a few things. I always thought that there could be at most 3 cops against one opponent. However, in several of my cases, all cops triggered against the same opponent (5 cops). The opponent was the green car. I know it's this opponent, because I positioned the cops such that only two cars come close to them. The green and the orange mini-cooper. The orange mini-cooper splits from the green one at the bridge where they follow different paths. All cops pursued the green one.
Image

However, several problems still remain. They are shown in the following screenshot.

Image

This screenshot highlights two problems. This cop on the left does not trigger against the AI, nor does it trigger against me... It has nothing to do with the maximum number of active cops because the previous screenshot showed that you can have more than 3 cops for one opponent and even if you couldn't, I had no active cops against me. The second problem are the frozen cops (on the minimap) which brings us back to that range problem which I want to fix. What bothers me is that it seems again completely random. The problem of the cop not triggering for anything happened three or four times in all my testing. And I couldn't quite figure out why. And again, it has nothing to do with the maximum number of active cops, since in most of my tries, all 5 cops trigger.

Bonus screenshot
Image

Again, in this case, two cops decided to take a nap. There were no other active police units. The remaining three cops deactivated after they lost the racers. And I couldn't get them to reactivate either.

EDIT 2: I actually managed to push one of the deactivated cops all the way to the racers finish line (it was hard and took way too long) and the cops triggered again on its own as soon as the racer came into view. I'm glad the cop didn't mind me pushing it all the way across the race, but it's a very odd behaviour. Could anyone shed some light on this ? I would have liked to try that against a cop that never triggered at all (sirens off) but it was hard enough with the deactivated one, the ones with the sirens off always try to go back to their spawn point so I'm pretty sure it would be impossible for me to push it all the way to the finish line.

User avatar
FXANBSS
MM2X Active User
MM2X Active User
Posts: 686
Registered for: 11 years
Location: Midtown Club, Discord
Been thanked: 4 times

Re: Police and AI racers

Postby FXANBSS » Wed May 01, 2019 6:58 pm

If you're using mm2hook: if you're a cop, cops don't chase you

It's working the same way they did in MM1!


One question, which unlimited cop mod are you using?
The midtown2 exe modification by diatosta? (i've heard mm2hook also did this but i haven't tested or i believe that not)
or the 3+ cops trainer by az5k?

both of those have different inner workings:
ABBC3_SPOILER_SHOW

Hapillon
MM2X Newbie
MM2X Newbie
Posts: 4
Registered for: 4 years 11 months

Re: Police and AI racers

Postby Hapillon » Thu May 02, 2019 6:42 am

Hey there,

I did not use either of those. All I did was to modify the .aimap for the race I was testing with. And I added the cops through there. I changed the coordinates of the three default cops, and I added an extra 2 cops directly in the .aimap file.  I used the external program mm2city to get the coordinates of interest.

[Police]
5
vpcop 677.113281 5.000400 150.127319 -234.000000 0 15 1.000000 50.000000
vpcop 677.113281 5.000400 167.127319 -234.000000 0 15 1.000000 50.000000
vpcop 677.113281 5.000400 170.127319 -234.000000 0 15 1.000000 50.000000
vpcop 677.113281 5.000400 155.127319 -234.000000 0 15 1.000000 50.000000
vpcop 677.113281 5.000400 163.127319 -234.000000 0 15 1.000000 50.000000

Like this.