I’m so glad this got bumped. I’ve been wanting to dip my feet into neural networks for AI, and seeing that something like this is possible on Roblox is CRAZY.
I probably will get off my butt and actually try it now. I know I’m a year late, but thanks for sharing.
I run it in Studio and the chase camera stutters there.
I don’t really have anything I can release (this is something I was paid to make for someone else), but I’d be happy to help anyone that has questions. Please stop DMing me and ask them here instead so everyone can benefit!
I wonder if I could try to make a NN that tries to play an RPG/other game at approximately the same skill level as a player… try to get it to match delta Score with the player. Would allow me to have allied NPCs that couldn’t carry the player but also never become useless…
With lots of training data and a good architecture for the thing you want to do you definitely could. I’m not sure how you’d manage to train with a player’s rating since you need a lot of training data. Most game AIs are actually played against themselves to get better which ends up in constant progression but you’re looking to also limit based on skill.
I think what you’d end up doing is recording matches including the actions the player took and their skill level. Then you’d feed the neural net with this data and try and get it to learn from players. I know that this has been done before with other things but I’m not sure what architecture you’d use for that to be honest.
I’d use delta score as an input - so the “ally” AI would train to try to match pace with another AI/player. Then I could just feed it a lower delta score and it, in theory, will play “worse”.
I’d also probably separate scores from different sources (since some allies are planned to be specialized in different styles, like support) so that I could apply the player’s highest sub score to the “primary” score, and so on.
Now I just need to figure out how to make a NN in Lua.
That makes sense and I’m not sure why I didn’t think of that to be honest. I guess you would train the network given a target score, score the network as it plays, and punish/reward the network based on how well its doing (given the architecture works that way).
I like your ideas. I’ve been brainstorming my own concepts with cars that learn to drive like you drive. I’ve got some basic stuff set up - I get in a car and give myself a GPS route in-game and follow it. The entire time my inputs and location and velocity relative to the GPS routes are recorded every 0.1 seconds. Then I train a new network to see the inputs (position relative to GPS route, last set of outputs, velocity, etc) to match the recorded outputs (the steering, throttle, and handbraking I decided to do in said scenario).
After some time the AI learns to take those inputs and outputs results that look somewhat like mine, AKA mimicking what I would do in a driving situation. It works okay right now and still needs some work. I’ve been thinking of making police chases use cars that are just as good as the player, if not a little better (only train on the players “good” data, aka delete training data that results in the player crashing).
I don’t think having a ML AI against a player is good though - you’d have to be careful to prevent the enemies from getting so stupidly perfect that the AI wins every time or is unnecessarily aggravating to play against, at least in certain games. In Smash, for example, a ML AI trained on top players would be monstrously out of tune and one trained on average players would be too weak for top players to get a challenge from.
By the way, massive fan. Felt awesome to notice you had replied to me lol
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!
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.
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.”