UI animations in multiplayer games

Hi, this is only a theoretical question only to understand the multiplayer gameflow a little bit more.

Let’s say I’m trying to create some sort of a turn-based game (like a board game or card game). It can happen that after a turn a player can obtain a power up which should be displayed as a UI animation for all players, after which the game should continue.

My question is, how would you implement it, in order to know when the game should continue i.e. start a new turn?

Here’s a simple scenario:

  • A player makes a move
  • The player controller sends the information to the game mode
  • Game mode checks whether the player got a power up and notifies all players (UI animation should be played)
  • Now should the game mode include a delay or wait for all the responses from the player controllers, that the animation is finished or something completely different?
  • Game mode starts the next turn
1 Like

Hello, I don’t fully understand what you mean, but I’ll try to understand.

First, I created a new project and added the widget to the player view.
Then I added a frame, a few images, and buttons to the widget.
We are not interested in the first one, but the second one opens the second widget.
After clicking, the third one goes to the second player.
After pressing play, the machine supposedly draws a reinforcement (you can add a real draw and improve the user interface).
The buff is displayed for player 1 and player 2.
I hope I have solved the problem, if not, please explain in more detail.
My project:
link: GitHub - grawik-grawik6543/Test-Map name:Add to new project content.
I have a request, will you subscribe to my YouTube channel? Regards
YT:https://www.youtube.com/@grawik_ingraw

1 Like

Thank you for the answer :slight_smile:
How did you manage to open the buff widget for both players? For me it only works for one at a time…

Ok, I will explain it in more detail. It’s always easier on an example, so here we go:

  • We have a mobile multiplayer card game with two players connected (two player controllers are communicating with a game mode)
  • Player one selects an attack card that should deal 5 damage to the opponent
  • The selected card information goes to the game mode, which checks the played card and takes actions corresponding to it
  • In our case it would trigger the “Attack” function on both player controllers, so that each player would see an attack animation on their screen
  • My question is now as follows. How can we ensure, that the game will continue only AFTER the animation is completed, because relying on the “animation finished” events seems a bit risky to me and putting delays inside the game mode does not seem like a clean solution (maybe I’m wrong here)… So basically I only want a way to tell whether the attack animations for both players are done playing and the game mode can inform the next player that he can start his turn.

I understand fine, I will try to do it, but I have a question: do you have a design template that you can send me so that I can do it directly? If not, how are you going to play with two people? (e.g. Bluetooth or on one phone) Thank you in advance.

I created a simple project. There are 3 classes - GameMode, PlayerController and GameWidget. If the active player presses the button, the animation is shown to both players and then the game mode waits 3 seconds. In that time the animation for both players will end and the turn indicator (the green square on top) will be set for the next player

1 Like

you could use delegates to notify when the animation is done, if only 2 players you could just wait for the response.

however i think the correct game design here is to separate the logic from the effects so to speak. the game mode handles the logic instantly and sends effects to the players which can queue and play out at their own pace.

the only thing you’re waiting for is player input which is standard for these types of games.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.