Have AI in a single player game be scripted on local scripts or server scripts?

I’m creating a game which will be single player and will have a lot of AI. For performance, would it be better to script it on the server or client? Replicating to the server shouldn’t be an issue because it’s single player. Sorry if this is the wrong category!

1 Like

Local scripts only run on the players client or device whereas server scripts run on the server and display what is happening on the server to the client. So i would say test it on both to see which one it runs better on.

1 Like

Server because if it’s on the Client it can be Exploited easily

1 Like

Im not worried about exploits at all though since they would only be disrupting their own gameplay and not anyone else.

1 Like

You’re right, but if you have things like leaderboards etc. they might cheat to get like 1st place
If there’s nothing like this you should be good by making it on the Client

And if I’m not wrong making it on either side should have the same impact - either in the Server or the Client

2 Likes

If you can do stuff on the server then do it on the server, you wouldn’t want your entire game stolen would you?

2 Likes

I’d just do it on the server so that the server has access to the AI without asking the client what the AI is doing.

1 Like