Authoritative Turn-Based Game - Waiting for animations

Hello all,

I’ll quickly outline a scenario. In a turn-based MOBA game, a player moves to a new position and ends their turn. This sends the new position to the server to be validated and broadcast out to everyone. At this point everyone’s client receives the update and animations are happening to make the character move to that position. But while this is ongoing in the client, the match keeps ticking. I’ll add that players have a set decision/action time so the authoritative server also ticks that down when it’s someone’s turn.

The question is: How would one go about configuring the match loop to account for those animations before moving the turn to the next player, ticking down their decision time and letting everyone know that a new player has their turn?

Many thanks,

Can anyone offer an opinion on this please?

You could have the client whose character is animating not send an “end turn” message until their character is done animating.

@lugehorsam thank you for your message. That’s what I am doing for player controlled characters. But the issue is with the NPCs. The server moves them, sends the new coordinates to the clients, and the clients update the move via a “walk” animation along the path. But while the clients update, the server has moved on to the next character (NPC) to process.

Hope this makes sense.

Hey @Antviss another option would be queueing the server responses on the client. So the server would send a new coordinate to the client for NPC A, then for NPC B, and both messages would be queued. The message for NPC A would get dequeued, you’d animate NPC A, then you’d dequeue for NPC B and animate them, assuming you don’t want the animations to happen in parallel.