Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unique networking set-up

Discussion in 'Multiplayer' started by Kipp, Feb 19, 2010.

  1. Kipp

    Kipp

    Joined:
    Feb 19, 2010
    Posts:
    4
    I'm a .NET software engineer, and I've got a Linux box (with Mono) with a great connection at my disposal.

    I would like to create a fully runtime-mutable headless server; clients connect not knowing anything about the scene (because it's dynamic), and the server sends everything to the client.

    I assume there are some considerations to this kind of setup that I am not aware of, as well as possibly these:

    1. Unity does not run on Linux/Mono, so the server may be able to relay data between clients, but it cannot calculate physics. Is there any way to delegate this to a single client? If that client disconnects, can it be delegated to a new client? (Lag in physics calculations is not important)

    2. Creating everything at runtime (rather than from a scene file) may have performance impact.

    Does anyone have an insightful comments on the feasibility of this? What about getting started in the documentation on how this might be accomplished? What needs to run on the server?

    - Kipp
     
  2. PhilipV

    PhilipV

    Joined:
    Aug 25, 2008
    Posts:
    103
    Well, since usually you would not trust the client for doing such computations, especially in phisycs intensive games, you should code a basic physics engine in the server...
    Again, for the server side part, I strongly suggest Project Darkstar (projectdarkstar.com) wich is a server side technology extremely scalable, even though it has been recently discontinued by Sun...

    Regarding what you were asking, yes, it is completely possible to create everything at runtime, and it would not be slower than just loading a scene file, if we ignore download times... otherwise... yes, it is.
    Also, it would be possible to design an authoritative setup so that one client would handle physics and update every other client with that, but I would discourage this... But We should really know what you need phyics for, otherwise it is pretty hard to give suggestions...

    Philip
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    You might have a look at my posting on the Photon forums. I'm planning something similar (having a "network-server" which handles all networking and a separate "game-server" which handles physics, for example).

    Photon only runs on Windows, so unfortunately that's probably not an option for you - but I guess the concepts regarding networking-infrastructure should be the same. As an alternative to Photon you might look into Lidgren which I think is .NET/Mono only (no native stuff required). So that should do on a Linux box - and I think it can also be integrated into Unity (you might search the forums for Lidgren - I think there are a few postings which might be helpful).
     
  4. Kipp

    Kipp

    Joined:
    Feb 19, 2010
    Posts:
    4
    Thanks for the replies - they're incredibly helpful!

    Physics aren't important to the goals in the game... it's just for looks. Not having hacked clients would be nice, but I can achieve greater server-side scalability if I can "trust" clients to do their own physics. (I have a few ideas in mind on how to do this, too)

    Assuming I DO need to do physics on the server, is there a Linux-compatible way of doing this that requires minimal wiring to Unity clients?

    I'm also glad to hear that the client can start "empty" and get up and running after the server has sent down all of the data, without any later runtime expense. Can anyone comment on how this would best be done, from an architectural perspective? (I think I've got this, but I'd like to hear how Unity-savvy people think of it)

    Actually - taking a step back, despite reading a few things about Unity networking, I still am not clear about it. I assume, in my case, the clients will just be telling the server the user inputs... Where I get fuzzy is when the physics engine sends computation results (in what format/protocol?) to the server (how?) and then the server updates its stored states and broadcasts those results to all of the clients, who update all relevant objects (how?). Can anyone take a shot at describing this?

    Also, thanks for your reply Jashan - I will have a good look at Photon and Lidgrin.

    - Kipp
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if its just for visuals you don't need any server side physics.

    if you want to do it though you will have to write one that works on client and server and does collision too