I'm designing a simple MMO game server with the help of ENet (reliable UDP library) and the Godot engine for client-side. I've read tons of articles, guides, stack exchanges questions regarding movement prediction. Here is what I have so far:
- A network thread that sends/receives packets from a ConcurrentQueue, so that no blocking is necessary.
- A game thread that will periodically check if there are any new packets in the queue (every 15ms) and a game loop that runs each 100ms.
My issue is the following: how can I get inputs from packets sent by the client (input data is sent 60 times per second to server) and correctly simulate them on the server? Since the server game loop runs on 10 ticks per second, my "delta" will be different than the ones used by godot, right?
Is this approach (sending inputs instead of position data/velocity data) feasible with different tick rates? Right now I'm sending Godot inputs every 16.6ms, reading batched packets every 15ms and updating physics every 100ms.
Edit: I think a possible solution would be to send the game frame number along with the move input, but wouldn't that be unnecessary data? (at 60 inputs per second, I would need 4 bytes to make sure it wont overflow)