Search Unity

Client-Server in c#

Discussion in 'General Discussion' started by CrocsxG, Jun 19, 2019.

  1. CrocsxG

    CrocsxG

    Joined:
    Jan 2, 2018
    Posts:
    6
    Hello,

    I have made in the past multiple offline game, and would like to make my first online game. I have very basic knowledge of server structure.

    The game is a multiplayer RTS game, with ONE server (If possible in c#), where player can build base, attack other player and move around a world. it is in real time, but slow paced, so not many actions, and every time a user make movement it take let's say an hour to move. The game is planned for Android/iOS and (maybe) but not at all for the moment, web.



    The game itself is easy, but the server I don't know where to start and I have been struggling in the last 3 days to find a informations and answer to my question. Most of the example I found are P2P/client-hosted server, this do not apply to my case, I want a single server that runs outside of Unity and that I can run on a computer as stand-alone. My question problems are.



    1. for a mobile game, I have seen in some post that UDP TCP/Socket are not available in 3g? is this true ? If so, what should I Use ? I was thinking of websocket since MAYBE i make a web version, but I don't know if it's a good idea, and apparently it is not built in in Unity.


    2) Related to my 2) is there any c# library that work in Unity and would fit my game needs? a user would probably load a map, and interact around 20 times with the server during the gameplay. I believe a simple server that get and send message only is largely enough, but I don't know what to use. Start from scratch? then what should I use, TCP ? Socket? WebSocket ?



    3) Should I use photon ? I've seen is free to test until 20CCU, and since for probably the next 6month I will be alone on it it's OK, then at release let's say I have 100 player, is not that expensive. Is it a viable solution? I found it a bit overkill for my needs, but it looks documented and easy to start. Will I still learn stuff if I "cheat" like this?



    Thank you for your time
     
    Last edited: Jun 19, 2019
  2. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,021
    Based on what you are describing, you might want to use REST style communication over HTTPS. I usually prefer to build custom UDP style solutions, but that is because UDP is light weight, fast, and flexible. For the situation you described, REST over HTTPS would likely make more sense than using UDP.
     
  3. northroom

    northroom

    Joined:
    Dec 20, 2014
    Posts:
    4