Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    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.