Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Headless Game Server

Discussion in 'Multiplayer' started by AmazingRuss, Jul 29, 2008.

  1. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    I've seen some mention of the ability to run a game server in headless mode on Mac. Does anybody know how to do this?
     
  2. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Use rakknet natively outside of Unity is one way. Other than that, I have not made an independent server (headless) with Unity yet. Although with Unity's great GUI system, you could make a scene that has a GUI for the server and set it to start up with the Mac starts.
     
  3. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    Does the Unity network api map to the raknet api?
    I am wondering if it is possible without a lot of work to create a raknet server that implements the communication protocol between Unity GameServers and Clients.
     
  4. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Its the same protocol and the same calls.
    They will chatter.
     
  5. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    Nice!

    Thanks
     
  6. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Welcome :)
     
  7. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    I gave this a try...but when I do a Connect() from my client:

    Code (csharp):
    1.  
    2. void Start ()
    3. {
    4. string sHost = "127.0.0.1";
    5. int sPort = 12345;
    6.  
    7. print( Network.Connect(sHost, sPort) );
    8.  
    9. }
    The master server does not know what to do with the message type:

    MasterServer: Unknown ID 75 from 127.0.0.1:49373

    Which is expected...anything over 70 in that enum is user(Unity in this case) defined. However, I don't know what the format of the data in that message, or any of the other messages that will be generated by state synchronization or RPC calls are.

    Raknet doesn't know what to do with these, but I could write something to parse/serialize them if I knew the format. Is this available anywhere?
     
  8. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Your port call from the client to the server doesn't seem to be matching. I have asked for the version of RakNet used by Unity, no response yet, hopefully someone will answer my question today so I can write you up a good example. From sub version to sub version from v3.0 up to current v3.x (currently 3.5) data information changed and wasn't backward compatible. Like I said though, no one has responded to my thread with a simple version info yet. Sorry for the delay on the help. My code is based on a different version obviously than Unity's self implementation (which hasn't exposed all protocols yet either nor all functionality that RakNet has)
     
  9. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    Maybe we should email support...they don't always look in here.
     
  10. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    I've sent in an email to support from my gmail account.
    I'll let you know when I hear something back.
     
  11. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    I also wanted to point out that as of 1.5

    So if you have pro maybe thats a option.

    Bill
     
  12. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    Aha! Thank you!
     
  13. vladk

    vladk

    Joined:
    Jul 10, 2008
    Posts:
    167
    Could you please give me a link where I can read about that batch mode in unity?
     
  14. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
    I actually could not find it documented any where, but I knew I remembered seeing such a thing so I searched the release notes and found in the 1.5 release notes, on this page. http://unity3d.com/unity/whats-new/unity-1.5

    It should probably be noted that there is no documentation on it and hopefully it will become documented.

    Maybe a UT rep could step in with some more info on it?

    Bill
     
  15. Sync1B

    Sync1B

    Joined:
    Sep 13, 2005
    Posts:
    561
  16. vladk

    vladk

    Joined:
    Jul 10, 2008
    Posts:
    167
  17. AmazingRuss

    AmazingRuss

    Joined:
    May 25, 2008
    Posts:
    933
    I think that kinda works...I can execute from the command line, no gui comes up, and I get no errors, but the process terminates immediately.

    Do I need to set up some kind of loop to keep it running?