Question about online turn based combat

I’m going to reference Magic The Gathering Arena for this question.
So I have two players on two separate devices.

In the game the main player takes up the bottom half of the screen and the opponent takes up the top half of the screen. Reference picture below

So my question is how do I make it so
on device 1 player 1 is viewed bottom of screen and player 2 is viewed as top
on device 2 player 2 is viewed bottom of screen and player 1 is viewed on top

There is no magic method to do this (no pun intended).

Your game will have to know which player is which and draw the board appropriately on each device.

Questions:

  • Are you a new game developer?
  • Have you developed multiplayer games before?

If you are new, I strongly suggest you not try to tackle a multi-player game first. There are serious hurdles to even the most basic multi-player games that may make the entire endeavor very frustrating as a first game.

You can use “Photon” to do it in a game at the same time.

First, you need to have your own UserID (MyUserID).
Next, you must verify the identity of all players in this game at the same time, and obtain a unique UserID at the same time, and record the required state of each UserID in the game.
Then set up a cyclic update function.
You only need to match your own UserID obtained in the first step to the UserID of all the people obtained in the second step. You only need to use IndexOf to know where you are and get all the game states at that position.
After that, you only need to simply set it in the loop update function, if UserID == MyUserID .
You can easily achieve the function you want.

But as “roaminggamer” said, developing multiplayer games will encounter quite a lot of trouble.

Originally, I also planned to add real-time online combat function to the game, but due to network delay, I was discouraged.

Therefore, at this stage, only the non-real-time battle function is retained. It is only necessary to obtain the battle data of both parties and write a auto battle algorithm.