Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Boss Room - How can I run dedicated server?

Discussion in 'Multiplayer' started by blakstar123, Mar 4, 2024.

  1. blakstar123

    blakstar123

    Joined:
    Nov 7, 2023
    Posts:
    9
    Hi,

    I'm trying to run dedicated server for Boss Room.
    Succeed to build target for dedicated server(linux) without any code change, got some output files :



    UnityPlayer.so test.x86_64 test_Data
    UnityPlayer_s.debug test_BurstDebugInformation_DoNotShip test_s.debug


    However, I cannot find how to run server nor connect clients... Is there any documentation for this?

    If boss room is not proper example for dedicated server, suggesting any other examples would be very helpful.
     
  2. b4guw1x

    b4guw1x

    Joined:
    Apr 16, 2020
    Posts:
    42
    As far as i know, BossRoom is supporting dedicated server on matchmaking system. So you should start the server with some arguments like the port and ip info on console (but i'm not sure)

    However if you have some problems with implementing online server-matchmaker etc. i would recommend you https://www.udemy.com/course/unity-multiplayer-netcode this course. There is detailed explanation of creating-running servers.
     
  3. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    Hi @blakstar123 , to run a game as a dedicated server you need to host it somewhere (your own computer or a service like Unity Game Server hosting) and then add code so it automatically starts as a server and listens to connections.

    This is valid for any game, not to bossroom specifically.
     
  4. blakstar123

    blakstar123

    Joined:
    Nov 7, 2023
    Posts:
    9
    Thanks for reply.

    Oh I see, I thought BossRoom already supports dedicated server build for automatic server starts and listens... I need to implement those with conditional compile, right? Is there any documentation or guide for automatic starts for dedicated server?

    I'm considering to host on my own PC, and would like to connect with my android phone on same local network.
     
  5. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    That's a way to do so, but you could also use metaconfiguration.

    All you need to do is use
    Code (CSharp):
    1. NetworkManager.StartServer()
    , see the docs here. Then you can connect with your client using the IP address of the PC you're using as a Host.
     
  6. blakstar123

    blakstar123

    Joined:
    Nov 7, 2023
    Posts:
    9
    Thanks, it seems like work on my desktop!
    I added
    NetworkManager.StartServer()
    on Start method of ConnectionManager .
    Just let me know if there is more appropriate location of StartServer().


    One more question : Is it possible to build and run dedicated server for Android device? I'm researching enhancement of server-client relationship using some Android features. To do so, I need to run headless server on Android device(This server does not need to listen to other device)
     
  7. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    You could try making an android client build and run it as a server, but unity dedicated server target can't build for android.
     
  8. ebsbk

    ebsbk

    Joined:
    Dec 12, 2023
    Posts:
    1