Search Unity

How do I manually send data and host server files for a 2d "board" game

Discussion in 'Multiplayer' started by faresgheyath, Nov 16, 2022.

  1. faresgheyath

    faresgheyath

    Joined:
    Dec 28, 2021
    Posts:
    2
    In summary, I have a board game where you move lots of units (not turned based), and I want to make this game online. I have made online games before using python and hisock, and the way I did that was attaching a client file in the game executable and hosting a server file in digital ocean (since I already pay for digital ocean to host my website) and that worked. But now I've moved to unity and I want to do the same setup (since its easier and I don't have to pay for any more services).

    So my question is, how do I setup a system where a server file would be hosted, and I can send specific data from clients to servers and vice versa. I've looked at commercial options, and its all either: not exactly what I need, or a paid service. and even if a commercial option doesn't have either of those issues, I'm still comfortable with this manual server-client connection.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,882
    You provide some webserver that supports making requests and sends back requested data using the WebRequest API. There's more options but what makes best sense depends a lot on your use case.

    Sure you do. You want that game available online? You have to pay for server hosting. If you don't want to host a server but allow players to host sessions for others over the Internet, it will require Relay. Paid service. You can implement your own relay solution but it still requires a public server. You want players to find other players and a match? You have to pay for Matchmaking and Lobby or implement your own solutions to these.
     
  3. faresgheyath

    faresgheyath

    Joined:
    Dec 28, 2021
    Posts:
    2
    Well I think I provided my use case, is webrequest api the best for my use? If you want more clarification about the game just ask me what you want to know about it


    I don't know how much you read from my question but I literally said I pay for my hosting. I don't want to pay for other services since I already pay for digital ocean to host other projects, and I can just host my game servers there.