The server fires to allclients to play the same animation for a given npc.
I dont see why you dont just let the server handle the NPCs anims, because casting an event to every client can cause performance issues
Interesting. Using the server is a lot easier, but I wonder what the upper bound on NPCs would be before there would be problems. I can always limit server numbers if I knew the approximate upper bound.
Yeah, obviously you have to move on the server if you want to replicate their movements. I do it too.
You think firing to all clients would be too costly?
I think you underestimate what the engine can handle. For one thing, if all 200 NPCs were playing the same animation (not 200 unique animations), the animation data will most likely only be stored in memory once and the keyframe data is probably only replicated once.
The only thing that would be causing strain would be on the physics engine with the Motor6D joints moving. Considering Roblox supports 100 player servers, this should not cause severe lag at all. I am guessing you have played a game before that has had over 200 moving parts at once and you probably did not lag.
Just focus on your game itself and donât fall into the trap of over-optimization. You should only start optimizing in specific edge cases or when you actually start to notice lag in your game.
Yes, it would be, i just dont see the point, because youâre putting more strain on the clients to run it themselves, but the server can easily just run the animations and all the clients would be able to see it anyways
Thank you. This has been extremely helpful.
In fact, if anything you should worry about the client more then the server, as the server can handle much more (and each client runs at different speeds so it can cause replication problems where the NPC is slower on one screen but faster on another)