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

Frame rate help!

Discussion in 'UGUI & TextMesh Pro' started by WirealTalha, Sep 30, 2019.

  1. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Simple UI menu. In profiler everything is good. I have a few reservation. Let me know if they mean anything or am i just stressing out over nothing.

    The game is simple 2d game.


    Issue:

    Runs smoothy at 1000fps. But when i activate a panel, there is a sudden spike(only one) to 250fps. only happens when I activate a panel.(and deactivate current panel).
    then game runs back at 1000fps. It only happens when
    a) when i call a post method to retrieve something from server
    b) when I activate deactivate panels
    c) when i change scenes

    any help will be highly apprecaited. PLEASE
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    This forum is for UIElements, a different UI framework. It would be better to ask this in the uGUI (Unity UI) forum. I'll move the thread there.
     
  3. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Sure.Thanks. I dint know where to post it.
     
  4. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    I haven't done a lot of intense optimization work, but I don't see anything there that seems obviously concerning.

    Your frame rate will drop when you ask your computer to do more work. This is normal.

    A typical computer monitor only has a refresh rate of around 60 Hz, so the user won't be able to tell the difference between frame rates above that. Exceptions exist, but for most games 60 fps is fine. You're still way above that.
     
    WirealTalha likes this.
  5. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    So when does a lag occur? when its below 60 fps?
     
  6. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    When you play your game, does it look to you like it's lagging?

    "Lag" refers more to user perceptions than to any single technical process. I think the word is usually used in connection with input latency or network latency rather than frame rate per se.

    If your frame rate temporarily drops due to a spike in processor load, that will probably be perceived as skipping or stuttering rather than lag. The point at which the drop becomes noticeable will depend on the user, the type of experience, and sometimes on the display hardware.

    But even a fairly low frame rate will often look OK as long as it's consistent. Movies and TV are traditionally shown at only 24 fps (though this does come with certain issues). Sometimes games will intentionally cap their frame rate at the lower speed they can achieve during heavy spikes, resulting in lower FPS all the rest of the time but keeping things smoother.

    On mobile, Unity will (by default) cap its own framerate to 30 fps to try to conserve battery.

    However, frame rate tends to be more important in games than in movies because they are interactive. It gets even more important if your game requires precise timing.

    Conversely, you can sometimes get away with spikes that drop your frame rate if they happen during non-interactive portions of the game. The extreme example is a loading screen; no one really cares if your frame rate drops when the only thing they're seeing is a progress bar.

    There isn't really a simple answer for what frame rate is "good enough", because you're dealing with human perceptions. But broadly speaking, I think most people would consider 30 fps acceptable, and almost everyone would consider 60 fps acceptable.

    Of course, as you add more stuff to your game, your frame rate is probably going to go down. Also keep in mind that frame rate is hardware-dependent.
     
    WirealTalha likes this.
  7. WirealTalha

    WirealTalha

    Joined:
    Jul 19, 2018
    Posts:
    142
    Thankyou so much for such a detailed answer mate.