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

Host becomes too slow when client connects

Discussion in 'Multiplayer' started by Protasov, Aug 26, 2015.

  1. Protasov

    Protasov

    Joined:
    Aug 10, 2015
    Posts:
    6
    Hi guys!

    I use HLAPI in Unity 5.x to connect two instances of application on localhost. On the host the Oculus Rift is used with VR Support enabled. Client's instance is running with -vrmode None flag, so the same scene is rendered on the screen as usual. But when the client connects to the server performance of the host decreases from 75 fps to 45-50 fps. And the more clients connects the less fps becomes on host. If I run the instances separately (without any network communication) everything is fine. According to profiler it seemed to be that server computes physics and rendering instead of clients. Am I right? And if I will use LLAPI could I increase the performance?
     
  2. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    are the avatars for the clients being rendered on the host?
     
  3. Protasov

    Protasov

    Joined:
    Aug 10, 2015
    Posts:
    6
    Yes, I can see them on the host
     
  4. seanr

    seanr

    Unity Technologies

    Joined:
    Sep 22, 2014
    Posts:
    669
    well.. could it be that the overhead of rendering the avatars for the other clients is slowing down the framerate on the host?
     
  5. Protasov

    Protasov

    Joined:
    Aug 10, 2015
    Posts:
    6
    No, I don't think so - the avatar is just a box. The behavior is the same even on the empty scene without any objects but plane with rendered gui on it. I've updated the profiler results and the main reason of slowdown is waiting for GPU. The rendering for client takes just a small part. Here are screens of profiler for host-only instance and host with client connected instance:
    Profiler_HostOnly.png

    Profiler_Host&Client.png

    Maybe, it's just a problem of Oculus synchronization. I mean, if the result of rendering couldn't be presented in any particular frame with needed rate it will wait a while to satisfy the rate limitation. Or I'm not right?