RemoteEvents/Functions are the best way to send data, yes.
This will never be as fast as ROBLOX’s code, but you could probably cheat and get OK results. Sounds like a fun project.
That’s the trick: don’t send massive amounts of data What do you really need to represent player movement? A bitmask for inputs, current position + velocity? That’s not too much. Check out the bit32 library for packing more data into uint32s than you could in a JSON. Also see string.pack.
All of this would require you to test performance – is the lower net traffic from packing the data into a binary string worth the cost of the packing? Is JSONEncode so optimized that it doesn’t matter if you’re sending binary data or not?
Anyways, this is a hard problem to solve, which is why the ROBLOX is great in the first place (it solves it “pretty well” for most cases). Solving it efficiently and well with Lua (even Luau) is harder. Especially when you don’t have access to unreliable comms (UDP).
If you don’t need physics, it’s easier.
Some resources:
- Introduction to Networked Physics
- Talk about overwatch’s netcode
- Talk about rocket league’s physics and netcode
- Article about source engine’s
tl;dr: Unless ROBLOX gives us UDP remote events, this is gonna be almost impossible