I’m working on a game that will involve pets. LOTS of pets. A single player can probably have as many as 30-40 pets (in the extreme case, so this player would need to be a huge whale or playing for a very long time) and in the average case between 5-15, and they will all be visible on screen at one time. A single instance of the game will support somewhere between 6-10 players (haven’t finalized the number yet).
The pets will also be doing more than just following the player around. They could be doing combat, which means some kind of scripted BehaviorController AI will be selecting abilities to use, managing cooldowns, etc. And each pet will have its own BehaviorController. Am I going to run into performance problems if I try to do all pet AI on the server? I’ve thought about maybe putting the follow logic on the client but doing everything else on the server, but dividing up the logic this way seems complicated, and I’m not sure if it’s needed.
Or maybe I’m just overthinking all of this and it’s fine to do everything on the server and I shouldn’t worry about it. Thoughts?
Try doing as much as you can on the client, and only use the server as an information medium, because the client can handle much more than the server. The only thing you should do on the server is to make changes to user data values and do server-sided checks(to prevent hacking).
Sure, but in this case it seems there’s very little i can do on client. I can’t do pet ai on client because for example someone could just make their pet do a billion damage and kill everything instantly.
The only thing I think I might be able to do on client is following logic. But i wonder if there will be desync issues when client/server are competing over something
Use the actual AI and main scripts on the server, however any major details and meshes/models on the client. Having too much server-sided can cause major lag spikes. The Client can handle more animations, details, etc.