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 Low FPS when running the game in 2 Unity instances

Discussion in 'Multiplayer' started by manutoo, Feb 28, 2021.

  1. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    535
    Hello,

    to test the online multiplayer mode of my game, I duplicated my project (while sharing the "Assets" & "Library\Artifacts" folders through Symlinks), and then I launch 2 Unity Editor instances and launch the game on both of them.

    With only 1 Editor instance running the game, I get around 120 fps. If I launch another instance, the instance that doesn't have the focus sees its fps dropping to 10~20fps.

    If I use 1 editor & 1 build, both run around 70~80 fps, and are not affected by having or not the focus.

    Anyone would know how to fix that behavior ? It makes it very hard to test when 1 editor instance runs much slower than the real thing... :confused:

    Notes :
    - the scene view is hidden ; only the game view is active
    - I use Unity 2019.4.20f1 ; it was the same with 2019.4.13f1
    - there's no profiler nor profiling on (I think)
     
  2. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    I have encountered that as well when running multiple editors a few pieces of advice I can give:

    - Lock your game to a low but acceptable framerate with Application.targetFrameRate = 60; That will give you an overall higher FPS in both editors because there's less fighting for CPU resources.

    - There is a setting in Edit/Preferences/General called "Interaction Mode" setting it to "No throttling" can help with performance when running multiple editors.

    - Make sure the ''Run In Background' checkbox is checked in Project Settings/Player.
     
  3. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    535
    @luke-unity ,
    only doing "Application.targetFrameRate = 60" was enough to get both editors running at 60 fps ! (''Run In Background' was already checked)

    Thanks a lot for your help ! :)
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    DeathPro, autohawk and luke-unity like this.