Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Making Multiplayer Game Without UNET

Discussion in 'UNet' started by imunirbesye, Jan 13, 2019.

  1. imunirbesye

    imunirbesye

    Joined:
    Oct 27, 2018
    Posts:
    57
    I want to make a multiplayer game. In my game I am planning 4 or 5 players per game. Iwant to do it without UNET, Firebase or Photon. How can I do that? Can you recommend sth. for me? What is the right database to use for me? MySQL? Or any source for UNET ?
     
  2. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    You can just use C# sockets to connect to the other players - but you will need some way of telling each of the players where the other ones are, which usually involves some sort of matchmaking server. That could be done with a website. The database you choose doesn't really matter, and most 4/5 player games don't need one at all.
     
    aadikhan859 and Rovelstars like this.
  3. kaplica

    kaplica

    Joined:
    Feb 20, 2014
    Posts:
    87
  4. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    If you're going for a C# server then a very viable option is .Net standard 2.0. This lets you create a shared library for protocol / DTOs, and also enables you to use .Net Core serverside which works well on Linux (and as far as I know it performs better than Mono).
    You can of course also run Unity as a headless server. In that case you would probably want to export condensed versions of your scenes with everything that isn't relevant to game logic removed/disabled.
     
  5. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I took the route of writing my own network solution on top of the socket class, and run the server as a linux headless Unity build. As far as database, MySQL is probably the go to standard, and you should consider it unless you have a reason not to use it.

    For me as far as database I created a special Unity server scene that acts as a front end for the database, so none of my other servers have to deal with it. This will allow me to not use a database server at all and just load from flat files, switch to different database solutions, etc, without it affecting anything else beyond the database front end server. This makes for a lot less retesting when things change regarding how I access the database.

    YMMV
     
    wlwl2 and aadikhan859 like this.