Multiplayer Turnbased game question

Options
Hi all, Im quite new to Photon and I have a few questions.... I have a game made, launched and working called "Pidro" it's a 2 VS 2 cardgame and it's built it Unity, own server/backend(Elixir/Phoenix) with Photon PUN (Cloud application) as sockets/networking.

Current status:
The game is working good and fast with some sync errors happening now and then, not often but it happens.
We are saving current gamestate in mySql DB but as there is so much data all the time we are handling the data in memory as primary as long as DB has the same data, only if its a difference it overwrite current game data in DB,
This works very well but still its a waterfall of data all the time and as we having a turnbased game it would be enough to send new data to the other players and to DB only when something happens, ex. Player plays a card. New cards are dealt, score changes, and so on.

(The JSON data is shown below)


Questions:
As we have some sync issues sometimes but rare I have a feeling that it is a network issue sometimes and data is corrupt or lost, as I mention its works perfectly fine 99% of the times but I want to optimize better for scaling and get rid of possible sync issues.

1. Would Truesync help in this case instead of PUN?
2. Is it possible to make less data sent and just when needed?
3. Other suggestions for optimizing?


JSON data from DB:
{"Users":[{"UserId":0,"PlayedCards":["0","0","0","0","0","0","0","0","0"],"LogTID":"TID_Bidding","LogExtra":"","IsReady":0,"HandCards":["h11","h4","d1","d10","d7","s13","s10","s6","c5"],"Bet":0},{"UserId":1,"PlayedCards":["0","0","0","0","0","0","0","0","0"],"LogTID":"TID_Ready","LogExtra":"","IsReady":0,"HandCards":["h9","h10","d8","s3","s2","s9","c10","c7","c6"],"Bet":-1},{"UserId":2,"PlayedCards":["0","0","0","0","0","0","0","0","0"],"LogTID":"TID_Bet","LogExtra":" 7","IsReady":0,"HandCards":["h6","c8","h8","s8","h1","h2","c11","h5","s12"],"Bet":7},{"UserId":3,"PlayedCards":["0","0","0","0","0","0","0","0","0"],"LogTID":"TID_Passed","LogExtra":"","IsReady":0,"HandCards":["d6","d13","c4","c2","c1","s1","d4","c3","h13"],"Bet":0}],"Suit":2,"State":3,"SeedInit":863793261,"Seed":954095805,"Score":{"TeamB":"1,3","TeamA":"0,2","Rounds":["13,1","13,1"],"Final":"26,2","Current":"0,0"},"PrevTurn":2,"Penalty":0,"Dealer":1,"CurrentRound":0,"CurrentGameRound":2,"Bidder":2,"Bid":7}

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Endeavour,

    Thank you for choosing Photon!

    I could not understand from your post or the JSON snippet how are you using Photon or PUN exactly in your game?
    Do you use RaiseEvent? Do you use webhooks? Do you use webRPCs?
    How did you integrate Photon with your backend?
    Do you send JSON from PUN? How so?
  • Endeavour
    Endeavour
    edited January 2018
    Options
    Do you use RaiseEvent?
    No

    Do you use webhooks?
    No

    Do you use webRPCs?
    We use RPC (PUN RPC)

    How did you integrate Photon with your backend?
    Photon used for gameplay only. Our backend just store data

    Do you send JSON from PUN? How so?
    No, we don't. We send/receive json to/from our backend only.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Unless I'm mistaken, your questions are not related to Photon.