Object Synchronization Sugestion for Board Game with Card Decks

Options

Hello, for the current project i want to make Multiplayer Monopoly-like game with 4 player max and each player have its own deck of card.

for the features,

  1. Player can move around with turn based system, and each turn player roll a dices to move around just like Monopoly Game
  2. the player can buy an area, and the area will be marked as "owned area by "Player A", and the area would be synch to all player in the room
  3. Player can draw a card from the Card Pile Deck, to its own deck

so what is the suggestion for object synchronization for each features?

in the past project RPC didnt quite do well for Features 3 (the card pile), because when someone get disconected and someone in the room draws the card, the card pile deck wont synch anymore to the person who disconected, because the player who disconected didnt get the RPC when they got disconected, and i tried with RPCBuffer and it didnt go quite well either because the previous buffer before get disconected is executed again,

For example

before disconect

i draw 6 card (this is RPCBuffered function)

and i got 6 card in the deck

then i got disconected

when i got reconected

the buffer from drawing 6 card is executed again

and now i got 12 card in the deck (6 before DC + 6 after DC)

Best Answer

  • Tobias
    Tobias admin
    Answer ✓
    Options

    I think I would use Custom Room Properties for most of this. The benefit is that your game state is kept in those and any joining player will always just get the latest state plus updates.

    A downside is that the logic is distributed and every player has all the state, so it could be hacked really easily. Everyone would know the cards (at least in the device's memory).

    Don't worry too much about hacking though. You need to be aware of it but unless you build a highly competitive game or something that will have a huge audience, it's OK to not worry about hacking too much.

    To avoid that, you'd have to use either server side logic (Photon Realtime and Photon Server Plugins) or maybe use Fusion, in which only the host has full authority and could actually hand out card after card to the players as needed.

Answers

  • Tobias
    Tobias admin
    Answer ✓
    Options

    I think I would use Custom Room Properties for most of this. The benefit is that your game state is kept in those and any joining player will always just get the latest state plus updates.

    A downside is that the logic is distributed and every player has all the state, so it could be hacked really easily. Everyone would know the cards (at least in the device's memory).

    Don't worry too much about hacking though. You need to be aware of it but unless you build a highly competitive game or something that will have a huge audience, it's OK to not worry about hacking too much.

    To avoid that, you'd have to use either server side logic (Photon Realtime and Photon Server Plugins) or maybe use Fusion, in which only the host has full authority and could actually hand out card after card to the players as needed.