Hey all,
I’m building a mini-game with enemies that spawn on the server in batches of 20 each time.
The enemies move on-screen randomly (well, inside a defined square) asynchronously.
What is the most efficient way to move them around? As in the easiest on the server.
I’m gonna reply to myself because I found a solution.
USE BODY POSITION (+body gyro), I cannot stress this enough.
The way the physics are processed is way more efficient than anything I can do code-wise. No tweening, no cframing, no pathfinding. This has got the receive to be the lowest and I mean like 0-5 constantly moving the 20 NPCs around at the same time. Also, it moves smoothly on screen. For the possible client/server delay I just use a distance checker when they are hit.
Hopefully, if someone sees this in the future it will help them as well.