Smart player-mimicking AI?

Hey Devforum! I’m thinking about starting a new project, where a monster secretly infects a player and mimics them for the rest of the game, bringing paranoia since players don’t know if anyone is real or not. How would you go about making a player-like AI believable?

3 Likes

I’ve had this idea before, and I also think its really cool.
Personally, one of the things I’ve tried was making the mimic look at the nearest player from time to time as if they were checking in on them or something, and also having the mimic stop and then chat a message out but for that you would probably have to make a lot of different dialogue options so that players wont be able to memorize it all

2 Likes

give ai a bunch of data

let the ai generate a personality similar to the person it wants to mimic

generate chat messages to use that are in that style, and use them at appropiate times

3 Likes

Creating an an AI in roblox is virtually impossible(or VERY impractical if you want to reconstruct hundreds of thousands of lines of code.)

First of all, no External Code Execution

Roblox does not allow access to external servers or Python/ML libs from roblox experiences.

  • Machine learning usually requires frameworks like TensorFlow or PyTorch, which are not available in Roblox’s custom Lua environment.
  • Roblox restricts external HTTP requests to whitelisted domains, and even then, only for basic REST APIs, not real-time training or model execution.

Second of all, no Model Training or GPU Access

  • ML models need massive data processing, training cycles, and often GPU acceleration. Roblox servers are not built or permitted to handle that.
  • There’s no memory or disk access for storing or training large ML datasets in a live Roblox experience.
  • Even if you did locally store it on a memory store, the data wouldn’t be readable by an AI.
  • It would create inconsistencies between what’s running on different clients or servers.
1 Like

Very true, good points too!

But for a simpler approach using chatbots (eg chatgpt API) & an algorithm to follow can generate some sort of similarity to the player it wants to mimick

Record the player actions in a form that captures their past actions as input and their current action/decision as output. You can chose to record attributes like the keys they press, in-game events they trigger, avatar animations, their chat patterns, etc. You can also record other useful information, for example distance and angle from each player or monster, tools, humanoid state, etc. Then train a neural network to predict the decisions based on the past player actions and use that to predict what the player will do next with some interval.

Basically to do this you need to model the problem in a clear manner. What are your inputs? what are you trying to predict? what’s your batch size? (how many frames in the past you take into consideration before an action) how you preprocess the data? how you collect and handle the data? etc.

In order to train the neural network you will first have to collect vast player data to train it on, but to define the data you collect, you first need to model the problem.

Most of the math required to run the network are really easy to reconstruct and re-implement yourself, there’re community libraries for this. The hard part is to train the model in an efficient/optimized manner and that can be done outside of Roblox.

Basically you create the data in Roblox, export it, give it to a python script to train a neural network, copy the weights and the neural network architecture into Roblox, then use a library or write some very simple math functions to run it.

Also worth noting that datasets don’t need to actively be stored in Roblox, only the network trained weights. Basically the weights have figured out how to approximate the original dataset given any input, that’s what neural networks do, they are universal function approximators.

1 Like

Processing a player’s data and then training a machine to learn in a short period won’t be the most accurate thing. Another big issue with that is it’s a HUGE waste of network transfers as it is very limited by roblox.