I'm my Client-Server-based game I'm using the following stack:
- libGDX (Engine)
- Ashley (ECS)
- KryoNet (Networking)
- Box2D (Physics)
Server =========> Client
I've got a Box2DSyncSendingSystem on server-side and a Box2DSyncReceivingSystem on client-side. This will create a list of all body-values from every entities with a BodyComponent in its update()-method and till than send this list via a BodyUpdateMsg to the clients. The client therefore receiving it and adjust all the values to the local bodies.
Client =========> Server
On the other Hand the clients will keep sending their Input values to the server via a InputSendingSystem so the server can adjust the velocities.
The problem that concerns me is that these steps happen every time the update methods are run. So several times a second. Somehow it doesn't seem very well resolved to me.
Sure: You could only send body updates if values have changed. But even if you follow this approach, you could not do without the repeated and permanent sending of the input update messages from the client to the server.
It is also clear to me that there are topics where client-side prediction should compensate for the high latencies, but the problem with the input updates is still there.
I don't want to implement a rocket science like high-end solution (the project is not big enough for that), but rather to implement a good and classic approach, which is typical for network games.
My previous approach may also not be wrong and absolutely common.
Thanks in advance!