I'm working on a project which allows players to take actions in time-limited turns. All players are connected to a central server, which is authoritative. That means the server sends info that a turn for given player has started and the time remaining to take an action. This leads to problems when client-side animations are involved. Each action has an associated animation, which takes some time to complete. The player should be able to initiate the action within given time, and the next player show start his turn when any animations complete. Obviously, the server has no notion of animations, but still needs to take them into account and start the next turn at proper time point. I'm not sure how to solve this problem. Possible solutions I came up with:
Constant animation time and built-in delay
The server will have a built-in delay after an action has been taken, before starting the next turn. Problems:
- seems an artificial construct
- animation times need to be exact
Not waiting for animations
The server can simply broadcast action effects without any delay, and go to the next turn. Problems:
- will look very strange for the players since the effects will become visible before the animation completes
- possible overlapping animations across turns
Sending actions along with animation times
The client can send the animation time for given action, which the server will use as a delay for the next turn. Problems:
- obvious cheating possibility (players can use the delay for "extra time")
So, given above, all my ideas are simply bad. Therefore the question remains: is there an existing solution for such class of problems?