Turn based games like chess or card games

Options
I am a user of PUN.
I am trying to make a turn based game like chess or card games.

I already checked the code of Rock Paper Scissors Demo.
PunTurnManager worked as expected in Rock Paper Scissors.

In this demo all of turns will proceed simultaneously.
But in a general turn based game each player operates separately.

I think that it is necessary to add the following processing.
I will set who's turn in PunTurnManager.

ex
public PhotonPlayer GetWhoseTurn();
public bool IsMyTurn();
etc...

Then if it is not my turn, I will end the turn.

But, I think this is a NOT beautiful logic.
Is there a good strategy for this case?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Ganessa,

    Thank you for choosing Photon!

    Please take a look at "Memory Demo" source code. It is not PUN but it can help you.
  • Ganessa
    Options
    Thank you for your reply.

    But I already read that.
    It's not for PUN.
    I would like to know about how to make turn based game for PUN.

    PunTurnManager made for turn based game for PUN.
    I hope that PunTurnManager is able to make turn based game like chess or card games.

    # Of course I will read that again.
  • Ganessa
    Options
    I checked it again.
    It was completely different from PUN, so I could not catch the point.

    What should I learn from Memory Demo?
    Should I stop using PUN for a turn based game?
    Should I use Webhooks?

    I am using Unity to make smartphone applications.
    I would like to use PUN as much as possible.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    What should I learn from Memory Demo?

    How to pass turns. How to save and load grid data and exchange turn events.
    Should I stop using PUN for a turn based game?

    No you can use PUN. Please follow the DO's and DO NOT's from RockPaperScissors doc.
    Should I use Webhooks?

    Yes if you need to persist room state to be able to:
    - leave game save it then load game and resume playing after hours/days.
    - invite a friend to a game, start it, play a turn leave it. the friend joins later so he/she needs to load the game.
  • feathers
    Options
    Thanks for the explanation @JohnTube , this is still one thing that is not clear to me either.

    The docs sort of say that Photon Realtime is the best solution for async turnbased games. However there is currently no Unity Asset for Photon Realtime. Are the Realtime features currently bundled into PUN, or do we need to download Photon Realtime in some other way for Unity?

    Is there a plan to launch Photon Realtime in the asset store, or will features be merged into PUN?

    Many thanks

  • Ganessa
    Ganessa
    edited April 2017
    Options
    Thank you, @JohnTube .
    I appreciate your sincere and prompt reply.

    I see.
    I will try to read Memory Demo codes again.
    I will ask again if I can not solve it.

    I am also interested in @feathers 's question.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @feathers,

    Thank you for choosing Photon!

    However there is currently no Unity Asset for Photon Realtime.
    Yes correct.
    Are the Realtime features currently bundled into PUN,
    PUN should have all Realtime features plus some more. But for async/turn-based games some PUN features should be skipped/ignored/not used.
    or do we need to download Photon Realtime in some other way for Unity?
    You can download it here.
    Is there a plan to launch Photon Realtime in the asset store, or will features be merged into PUN?
    I can't predict the future :wink:
  • feathers
    Options
    Thanks @JohnTube , thats slightly clearer!

    I looked closer to find the realtime features in PUN based on what you explained, and I can't seem to find the `LoadBalancingClient.cs` in PUN from the asset store, but LoadBalancingClient does seem to be present in the SDK download (thanks for that).

    I wonder if LoadBalancingClient has simply been refactored or possibly just removed from PUN altogether, as the release_history.txt file in PUN asset talks about LoadBalancingClient heavily.

    Still a bit uncertain how to move forward, but will keep trying both paths!

    Many thanks
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    PUN has LoadBalancing features but not the same implementation so you won't find same high level source code.
  • feathers
    Options
    thanks @JohnTube sounds like the RealTime sdk is the best place to start. many thanks