Lag from Client to the Server

In my game, you use stations to create food. To interact with these stations, you press space.
The server deals the interactions with the station, so a small delay is made from the space press and the actual action being done.

This seemed like the most efficient way, but, how can I make it so that the small number of players who are saying the game is laggy, can be fixed.

Now, some of you might say its to do it directly on the client and tell the server the results, but with all the stations in my game, it will become messy and will get clients out of sync quickly.

Is there any other easier option that can fix it partly, or do I pretty much have to deal with the few players who experience this delay?

You could use your current structure, but have the animation/client action/whatever instantaneously begin instead of waiting on the server for a response back?

Instead of telling the server the results, you tell the server when you begin the action, and the sync-delay should be minimal. If you really are worried about de-sync, you could send the event packet with a start-time and end-time of the action, so that the server (and subsequent receiving clients) can compensate for any latency.

2 Likes