[Photon] should i execute Network Logic only on masterclient

Hey i want to implement a 2 Player Memory Game in unity. Right now the Code that is running only on the masterclient is when the cards get shuffled and then send to the other Client. All the other Code(opening cards;checking If same cards …) is Happening on both clients. i dont have any sync issues at the Moment. My question: is it better to run the network logic (checking If same cards;closing cards and so on…) only on the masterclient and if yes: why?

Both approaches are ok. For a turnbased game, it’s relatively easy to create a “deterministic” simulation. All turns are known and all clients will get to the same conclusion due to the input. Then, you don’t need to run logic on one side and send the results to the other, of course.
The benefit here is that either client can detect if the other is acting odd (cheating). In a two player game, it’s hard to determine who really cheated (the cheater could also report the other as cheater) but it’s at least good to know when there is some desync.

In this case, I would likely not make one player authoritative of the state.

1 Like