Excessive use of FireAllClients?

As of now, whenever something visually intense happens in the game, I would use the FireAllClients function and pass data to the client, which the client will create a series of heavy part tweening as I believed that such tasks would be too heavy on the server. However, one of the events in the game would require a power where multiple tweens would happen every 0.15 seconds, so I would FireAllClients every 0.15 seconds as to update the position of the event every time. Would using FireAllClients in this manner be too heavy for the server, or should I make the tweens on the server side rather than sending to all the clients for them to then render the tweens?

2 Likes

If the power does the same action with the same tweens, can’t you just combine them all into 1 call to FireAllClients instead of firing every 0.15 seconds?

1 Like

What are you trying to tween? UI components? Parts?

1 Like

It’s probably better to send the Position event and then have the client locally tween it than to tween it on the server. Your Tween event loop is going to be running at around 6-7 Hz, which is under the 20 Hz network replicator loop. This means you won’t be sending excessive events that don’t actually get tweened. However, if you are interpolating on the client side, then why do you need such a high resolution part position? Is it possible to instead only do 3-4 updates per second?

1 Like

OP says he needs to tween parts.

Because the position of the player changes, in which the tween follows the players position and rotation.

The tween is basically a series of shockwaves coming from a fist.

Could you just fire one “punched” event, passing in the origin player? The client should have access to that player’s character position and can calculate all of the shockwaves from there.

2 Likes

Oh, I’ve always thought that other players characters could not pass through as a parameter?

The player character should just be a regular instance that you can pass. You could also pass the Player object and let the client get the character from there.

Yes I think thats where I went wrong with another game, It wouldnt let me access the character if the player is passed, player is seen as nil