Roblox Pursuit AI: autonomous & self-driving cop car chases

Great work but this
image
looks really suggestive. Try changing it to something else?

1 Like

It is also an SUV, but I appreciate the humor. Wether intended or not. :joy:

2 Likes

At first, thanks a lot for testing out the beta place! It is currently very experimental and meant as showcase, but I love to patch out the bugs for others to enjoy!

I will consider applying backpack disabling for prisoner, thanks for letting me know!

Ah, I recently tried to scale them better, but looks like it is even worse on mobile. Hopefully, if the builder I partnered with and I are going to continue with this, we will definitely rework the quickly-made GUIs.

Apologies, it was late and wasn’t really serious anymore :joy:

I’ll change it now haha

2 Likes

Haha, no problem. It gave me a good laugh.

1 Like

Cool! Keep it up!

Pros:
Really Good AI
Knows where he is going

Cons:
Once the cars fall they don’t flip
Once you join, they burst at you crazy

My rating in all is 9/10!

1 Like

You correct on network ownership being an issue, but it is definitely not impossible to solve.

I’ve solved this issue awhile ago now. But I can really only think of two solutions.
First and probably best solution is to set the network ownership of the police car to the nearest player.
Or if you are going to keep it a single player game, you can make your AI script and police cars client sided.

2 Likes

Maybe bad from me to call it “impossible”. I also thought AI pursuits on Roblox were impossible, until it succeeded.

I’ve had luck when setting the network ownership on the server, so it doesn’t hop ownership if they come near a player. So, nothing is impossible, a good lesson for me :grinning_face_with_smiling_eyes:

2 Likes

Well well… if I could buuld for ya

Holy crap! That AI did some grinding on Liberty County. Now you just need to add PIT maneuvers so it can make the AI a little more interesting. Really cool.

1 Like

Hahaha indeed :joy:

Well, I was playing & experimenting in the game @DutchGalaxy and I are creating and they used a very interesting tactic! This was not planned nor preprogrammed :eyes:

6 Likes

I’m actually working on my own autonomous vehicle system, and you’re my top inspiration for this project. Though… mine is a bit more “general purpose” (i.e. non-pursuit) and essentially a framework with functionality to follow a given path with rudimentary collision avoidance logic. I plan on eventually releasing it once improved, and I hope you check it out when I do.

P.S. Do I have your permission to add pursuit functionality to the open version, because that might be plagiarism.

P.P.S. Your clip is awesome! I’ve bookmarked this post for any updates!

Really cool that you are using this project for inspiration! I am curious to see what you’ll create! :eyes:

Yes, when I will open-source it, I’ll probably release it under the MIT License, allowing anyone to use, redistribute and modify the code :upside_down_face:

Haha, it was very unexpected and it was an improvisation of the officers :see_no_evil:
Nice to see that the cops can sometimes make really clever decisions (and sometimes get stuck between two hills :roll_eyes:)

1 Like

So far, it’s just a proof-of-concept build. But, during my testing on randomly generated terrain, it’s able to path across the entire map of 2048x2048 studs provided it doesn’t get stuck on any riverbeds. I plan to improve the AI a lot more before release.

EDIT:

I actually published a test place for my own AI cars! I wonder if it’s as good as yours… (probably not.)
https://www.roblox.com/games/7103387447/Autonomous-Vehicle-Showcase?refPageId=6bc3f4a6-dc19-4a06-adab-f297bce24bfe

1 Like

Honestly, it’s not very bad at all! Does it generate pathing automatically or manually? I saw that it is driving with a curve to the destination, but maybe you put invisible nodes there?

Not at all! It’s using Roblox internal pathfinding, and I fire an event with a single argument: an array containing nodes for a path, which the car drives to. I handle pathing separately independently from driving logic, so I could use literally any array of Vector3s, not just pathfinding paths.

P.S. I’ll send you my AI system in a private message if you want. It uses the same math as you did.

1 Like

Last days I’ve really been busy on making chases more challenging when police officers are near, and a rare occasion happened during testing, they performed a perfect PIT maneuver, I just love it :heart_eyes:

5 Likes

This has some serious Beam.NG vibes.

2 Likes

That’s impressive! In the real world, usually people is a bicycle control model along with an RRT* pathfinder. This allows handling all sorts of dynamics such as drifting, acceleration, rotational acceleration, and of course vehicle curves. You could also use an Ackerman steering model for increased precision.

I’m working on a pathfinder that allows that kind of precision, would you be interested in joining the community and giving your input? Discord

2 Likes

Thanks a lot for your kind words! I haven’t heard of RRT* before, but watching a YouTube video about it helped me understanding its principle, and it sounds really interesting!

I’ve joined your Discord server and I’m excited to implement your pathfinder in order to improve the vehicle navigation, however all chat channels seems to be locked (I can’t chat in any :see_no_evil:)

With RRT*, would I still be able to keep the pursuit tactics or should I raycast towards the suspect each Heartbeat to determine whether to use the RRT* pathfinder or use the natural behavior?

This is just impressive.

Please stop making this so good. I feel inferior.

1 Like