Authoritative Server for Turn Based Game

Options
slims
edited January 2014 in Photon Server
Hello, I'm new to Photon and Unity and have a question about implementing an authoritative server.

I have created a game in Unity that is similar to Chess mixed with a RPG Tactics game like Fire Emblem. As such, players have a number of units they move around a grid, which they do in turn. The game itself is in a working state, however, I am trying to now make it multiplayer.

I have written the game in the Model-View-Controller architecture. What I would like to do is something like move the model to the server side, so that client-side requests can be sent to the model to check if the request is valid and to update the game state in the model if so.

I've been googling to try to find an example of such an implementation, but with no luck. I've ran into some questions similar to this but people were asking about real time games and updating physics server-side, which is not at all what I need to do.

I merely would like to run the game logic on the server side and check the validity of client side requests, like if a movement of a given piece is valid, or if an attack is in range, etc.

Can anyone point me to a tutorial or a code example for this, or just explain it outright in brief terms?

EDIT: I just saw Photon Turn Based on the main site, and it is in beta. Would this provide the solution I am looking for?

Comments

  • chvetsov
    Options
    Hi, slims.

    Well, we do not have special tutorial, but i will try to explain what you can do.

    1. First step for you is undestanding of Lite sample. Basicly it is server where you may create rooms and exchange messages between players inside rooms. In your case room will contain only two players. Lite does not do any checking on server.

    2. You should deceide how to host your game.
    If you are going to use Photon cloud then photon Turn Based is good choose. you will be able to implement some custom logic somewhere outside Photon Cloud and send requests from cloud to your service.

    if you are going to host Photon it self, then all you need is modify RaiseEventHandler in LiteGame. You will get event from client. Call your model method to do checks and then either approove this event or not

    but do not forget first step is understanding how Lite works
  • Thanks for the info; I'll examine the Lite sample code now.

    Any idea when the Turn Based framework will be out of beta?
  • chvetsov
    Options
    it is difficult to say when everything will be ready
    Here you may register your self for Early Access
    https://www.exitgames.com/en/Turnbased
  • EDIT: Figured some stuff out - Also, in the link I don't see anything that allows me to sign up for the beta.
  • chvetsov
    Options
    you should leave your e-mail on this site
  • Markus
    Options
    The Early Access for Turnbased has not been started, yet. We will add the Turnbased Dashboard at the URL Ilya posted soon. Afterwards, you will be able to create your Turnbased apps there and request early access.
  • Thanks for the info.

    One more question about the authoritative server stuff.

    I saw another post where one of the Exit Games Teammembers suggested using the LoadBalancing example instead of Lite as the base code for an authoritative server. Is this correct? Does it matter what which I choose to extend?

    Really appreciate the help -- you guys are a super helpful team.
  • chvetsov
    Options
    Hi, slims

    LoadBalancing is next stage. After understanding how Lite works you may move to LoadBalancing.

    LoadBalancing is basicly Lite + plus LoadBalancing. In this project you will face with bigger amount of unknow stuff. that is why it is better to start with Lite and then move forward