Self-Driving Neural Network Cop Cars

Btw this has been properly released (finally!) in Vehicle Simulator after some performance improvements on roblox’s end. To trigger a cop go left down the road from the spawn and hit the cop car with your car!

https://www.roblox.com/games/171391948/Huge-Sale-Vehicle-Simulator-Beta?refPageId=3bc8c6cd-fc25-4367-9c16-6ae4e0a9ffb8

5 Likes

What made it so performance heavy? I have played the game, and touched the cop-car, but when I get chased, it gets soo laggy, and my ping is unusually high.

Roblox used to do ALL of the physics on one core, + it used to run Lua much slower.

As of 2 days ago we re published and roblox’s new changes helped quite a bit.

How big are those improvements? Is there a noticeable difference before those changes, and after?

(My pc it total garbage tbh :joy: I only have like 2 cores on this low 'n slow tower, so maybe its not going to be that much of a difference on my pc.)

Enough for my laptop to be able to run them without chugging. Last time we enabled the cops the avg player visit time went down. This time it’s gone up a bit which loosely translates to “the cops don’t lag as hard on most people’s PCs anymore.”

3 Likes

Roblox recently made physics performance changes?

It was like a month before RDC.

1 Like

Since the police AI uses a neural network, what data does the neural network learn? Surely if you wanted to learn where the player is located, you could just use plr.Character.HumanoidRootPart.Position.

Neural networks are based on AI making random choices, slowly learning which random choices are not ideal, and which cause improvement.

You don’t use it to “learn” the position of a humanoid, you use to to make your AI become more human like by applying goal states. If you apply no constraints to its learning it can become a “perfect” AI.

There are many resources on Neural Networks online.

I know. But I just wanted to know what data his neural network learned.

It knows certain variables like what the ideal path to the target is using A* GPS, how far it is from said path, it’s own velocity, when turns are coming up, etc…

It learns to take all of these variables and output 3 values: Throttle, Handbrake, and Steer.

1 Like

An amazing example of neural networks. This project of yours was one of the things that inspired me to try neural networking myself. Would appreciate it if you try the neural network library I released a week ago. It has all the functionality and features that you used as well as recurrent networks; networks that whose actions influence future actions, making time-based AI (like this) act more intelligently.
Would love your thoughts on it.

4 Likes

Thanks, I’m glad to hear that! I’ll give it a go sometime soon™. I’m working on something else right now but have a passion for machine learning so I’m sure I’ll give it another go soon :eyes:

4 Likes

That’s amazing. I want to know how you started it, as there’s no way you did this in Roblox studio. Would you recommend me making one for fun/out of curiousity.

Wow, that’s so amazing! I have a few questions (I know nothing about AIs and stuff like this):

Did you everything in Roblox Studio?
Is this possible with only using Roblox’s Lua

Yup, everything was done in Studio. You can do quite a bit of ML in studio actually! It’s not nearly fast enough for complex things like vision, but for easier tasks like this it works just fine.

2 Likes

Amazing, I can’t wait to see the future of neural networks!

1 Like

This is really cool. I’m a programmer that loves JavaScript and Python, I’ve had my fair share of AI’s.

So the topic of Q-Learning has recently caught my eye. And I wish to ask you, did you utilize Q-Learning in this? If not, how do you think the results might’ve differed if you did use Q-Learning instead of whatever you used?

1 Like

Terribly sorry for bumping a 2 years old topic but I have a question for the OP :frowning:

I am trying to create a neural network from scratch, I knew how to code the architectures, loss function, feedfoward algorithm, all the simple stuff, but then, I stumbled across Back Propagation.

I couldn’t understand a single thing about gradient descent. So could you try to explain it clearer for me?

I have watched some videos about gradient descent but most of them just spits out calculus formula and Python code that uses external libraries like Torch of TensorFlow, which I don’t understand.

Something like, iterate through hidden layers, calculate the gradient blah blah blah.
Also do you know how to implement optimization algorithms such as Momentum and Adam?

Once again I apologize for bumping this 2 years old thread!

Hi there. I am not sure if you aware of this, but there’s already a library containing a lot of machine learning models produced by me. You can find it here.

The code is public so you can have a look at my codes and take your time to understand it.

2 Likes