Search Unity

Showcase [Video Tutorial) How to use Game Server Hosting (Multiplay)

Discussion in 'Game Server Hosting' started by CodeMonkeyYT, Mar 16, 2023.

  1. CodeMonkeyYT

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    125
    Hey everyone!

    I've been researching Game Server Hosting (Multiplay) and I made a video tutorial. There were a bunch of things that were pretty tricky to learn so hopefully this video is very helpful to someone!
    Also covers how I made it work alongside Netcode for Game Objects


    Hope you like it, thanks!
     
  2. larah3d

    larah3d

    Unity Technologies

    Joined:
    Nov 25, 2018
    Posts:
    3
    Thanks so much for putting this together!
     
  3. Kouznetsov

    Kouznetsov

    Joined:
    Aug 25, 2014
    Posts:
    9
    Great video!

    Quick question about SQP though. Did you manage to find how to correctly make it work? It seems like calling StartServerQueryHandlerAsync is not enough to actually start it. Even if you call UpdateServerCheck frequently, the server's analytics do not actually fetch any data. Plus if your build configuration states that you are actually using SQP, the server will automatically shutdown after 2 minutes.
     
  4. airburst_studios

    airburst_studios

    Joined:
    Jan 7, 2023
    Posts:
    37
    Did you assure that the Multiplay init has happened before?


    Code (CSharp):
    1.                
    2.                 var initOptions = new InitializationOptions();
    3.                 initOptions.SetEnvironmentName("development");
    4.                 await UnityServices.InitializeAsync(initOptions);
    5.                 Debug.Log("Unity Multiplay SDK initialized.");
    6.  
    I also had my problems but they got solved as soon as I started using the `UpdateServerCheck` in the Update method. Make sure it's your server logic running with that UpdateServerCheck method. Especially with the separation of Client & Server logic I often forget to make things executed on the server side.
     
  5. airburst_studios

    airburst_studios

    Joined:
    Jan 7, 2023
    Posts:
    37
    What I miss on this video is how to deallocate a server properly. You are using
    Multiplayer Hosting API (1.0) that is just for managing test allocations. I have a lot of problems using
    Multiplayer Hosting Game API (1.0) to allocate/deallocate a productive (real) server because the API isn't accepting any of my authorization headers. I recreated so many service accounts and also tried to use the token API. Nothing works for that API.