Search Unity

Need guidance for an online multiplayer turn based game

Discussion in 'Getting Started' started by sisko89, Mar 24, 2019.

  1. sisko89

    sisko89

    Joined:
    Mar 8, 2019
    Posts:
    20
    Hello!

    My name is Andrés, I'm new to unity and the forums, nice to meet you all!

    To give some context, I've been working as a web developer for many years so I'm perfectly comfortable with coding. Recently, I decided to change career and become a game developer / designer, it's a long journey so right now I care more about learning and understanding rather than finishing my game.
    Regarding Unity, all the experience I have is following a tutorial to make an arkanoid clone and from there I jumped straight to what, if everything goes well, will be my first published game.

    The idea is something like final fantasy tactics, but 100% player vs player. With very complex and unique combat mechanics, I put a lot of thought into that.

    So I purchased a turn based framework and started working from there, it's going slow because I have to learn everything from scratch, but overall is going well and I'm learning a lot on Unity and C#. All good.

    But when I started researching on how to make it online multiplayer, I felt completely lost and overwhelmed. I read there are many options available like unet, photon and some more, but I have no idea which one is right for my game, and the more I look into it the more confused I become. What makes it even worse is that most tutorials I find on the topic seems to be outdated, with people commenting this and that got deprecated, and so on...
    This seems to be a very sensitive issue so I'd like to get it right from the start. I know I'll have to study a lot, but if anyone can point me on the right direction that would help me a lot.

    This is what I'm trying to do:
    Players login with their facebook account, they land in a lobby. Here they can manage their characters, buy and equip items, etc. And a matchmaking button that will match him with another player of the same level, once matched they start fighting with their characters, turn based, one player moves while the other waits, then the other move, until a player wins. The winner gains experience and gold and they both return to the lobby.
    Nothing crazy, right?

    I believe I can do most of the lobby with PHP and MySQL, all the user data will be stored in a MySQL database and the game will send and receive data from it through HTTP requests. Is this possible? Is it recommended for what I'm trying to do or is there a better way? (I already have a great hosting available for this)
    And hopefuly when a match is made, all the data from both users can be retrieved by HTTP requests too. But once the match starts, I have no idea how to go on, how to keep the match sincronized between players, how to send the end result to the server, etc.
    Could anyone please tell me where I should start? What do I need to learn?
    Do I need a solution like unet or photon for this? Do I need my own server?

    Any advice will be greatly appreciated. I need help exclusively with the multiplayer part, but if you have any general advice for turn based games, I'd love to hear it too.

    Edit: I'm thinking of developing the lobby at last. First the match, with hardcoded players data. Is this a good approach?
    Edit 2: I plan to release this for web platform first, later to android and iOS.

    Thank you so much and sorry for the long post!

    P.S: If anyone is interested in collaborating for this project, let me know! I'm a beginner, but 100% commited to it.
     
    Last edited: Mar 24, 2019
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    This is a turn-based game, so forget about all the real-time frameworks like Photon, UNET (even if that weren't dead, which it is), etc. You're an experienced web developer, so leverage that! Write a REST server that essentially runs your entire game. Then write your Unity app to make REST calls. The Unity game is essentially just a custom web client to your web app.

    It's certainly not the only way to do it, but it's a good way. And with your experience base, I think it's by far the easiest approach.
     
    Vryken and Joe-Censored like this.
  3. sisko89

    sisko89

    Joined:
    Mar 8, 2019
    Posts:
    20
    This is exactly what I needed to hear, thank you so much!
    Thinking of the game as a custom web client is genious, I can't believe I didn't think about that before (which showes how much I have left to learn).

    This last weeks I've been re-writing everything as REST calls and it's working perfectly, I can easily pull off the entire game like this.

    Thanks again for your wise words. You perfectly understood my needs and proposed a solution according to my skills, you should be proud of yourself.
     
    Vryken, JeffDUnity3D and JoeStrout like this.