I am making a flying script that moves the player from the current position to the mouse. With FilteringEnabled on, I am using a system involving RemoteFunctions that sends the local mouse.hit.p data to the server every frame so that the server can move the character towards that point.
The problem is, I am worried that by sending the local data from the client to the server every frame, I will go over the data limit and cause a lot of lag. So, my questions are: Is there another method to sending large amounts of data from the client to the server? Is there a way that the server can directly retrieve this local data? Or, is the method that I am using the best way to do it?
Even when filtering is enabled, there are some changes to game objects which will still be propagated to the server even when they are performed by a LocalScript. For example, the default Sound script which ROBLOX uses in their characters modifies Sound
instances locally, but they still play on the server, and this is intended behaviour.
Changing properties of BodyMover
instances - last I checked - also replicates changes to the server, and in a way that is more efficient than using a RemoteEvent
to update the properties manually. So, if you are controlling your player with body movers, just modify their properties locally to control the player and it will work fine.
Is there another method to sending large amounts of data from the client to the server?
In the general case, no. You cannot transmit data without just sending it over the network. Sending data is sending data. Either it has to go over a network to the server (which is just a computer somewhere else in the world), or it stays on your machine. You can sometimes compress data so that it takes up less space, but that is mostly ROBLOX's responsibility because they program the engine and have low-level control over networking.
In some special cases (as mentioned above) ROBLOX will replicate local changes automatically, even with filtering enabled. Use this to your advantage. The properties and instances which this works for aren't well documented, so you might have to experiment a bit, but BodyMovers and Sounds are good to go.
Let me know if you find or know of any others. We should compile a list somewhere... I think DesiredAngle
of Motor6D replicates under FE, too.