Updating NPC CFrames server-side, tween local NPC between these CFrames client-side

This post is about a performance related topic.

In my research, I had heard about certain games with NPCs that use a method where they create positional data on the server, send it to the client, and then tween an NPC model to the received position.

A form of the common idea “Effects on the client, barebones on the server.”

Basically, this is done to relieve the server of duties it doesn’t need to perform. Effects should always be handled on the client, because of their better processing power meant to handle the job.

With this in mind, I had set out to change my current Ant NPC system, which I had made previously. The system creates up to 800 bricks/ants, casts two rays per ant, and moves the ant to a new CFrame determined by the rays.

This can be viewed here: https://twitter.com/JoeBpng/status/1267546800170233856

Now, the server here is already handling a lot of raycasts and CFrame calculations / adjustments. It would make sense to not tween on the server, right?

Question: Is not tweening on the server beneficial enough to make an adapted server + client system as mentioned above?

I have already tried to make something like this all day today. I only came up with a lot more questions.

  • How do I send both each specific ant and its future destination to each client? How will I identify the type of bug it is? Maybe it isn’t an ant! That is a lot of data to send via remotes when you are dealing with 800 ants/bugs.

  • How can I make sure the client side tweening updates in sync with the server? I don’t want my client side tweens to be unnecessarily stuttery because they are making it to their destination too early, or too late.

You wouldn’t send 800 bugs worth of data in the first place. I actually tried to create a “chunk system” to get the nearest bugs. This plus the questions I encountered didn’t make this day very work productive. Learning, sure.

Back to the initial question. Is this really worth tackling? All this work to better performance of something that isn’t even excessively intensive?