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

FPS drops for 1 second when initializing Unity Ads

Discussion in 'Unity Ads & User Acquisition' started by Lidanh, Feb 7, 2015.

  1. Lidanh

    Lidanh

    Joined:
    Mar 27, 2013
    Posts:
    29
    Hi there,

    As the title says, the FPS drops to 10 for 1 second when initializing the Unity Ads(very noticeable). - tested on high-end Android devices.

    Do you have any suggestion on how to make the initialization process less noticeable?

    I though about initializing it on another thread, but it appears to work with Unity's Main-Thread-only objects.

    Thanks,
    Lidan
     
    Last edited: Feb 7, 2015
  2. Salazar

    Salazar

    Joined:
    Sep 2, 2013
    Posts:
    235
    Hello,

    When are you trying to initialize the ad network. You should cover that fps drop with some static screens at the begining of your game. Something like splash screen.

    Regards,
     
    unity-nikkolai likes this.
  3. Lidanh

    Lidanh

    Joined:
    Mar 27, 2013
    Posts:
    29
    Thanks for your reply.

    It's a bit problematic because I'm already starting the initialization at the Start method.
    The initialization can take several seconds (because it's starting to load a video or images).
    I assume that after it loads all the data from the web server, it writes it to disk. I don't want to wait until all that finishes at my Splash Screen.

    I really think there should be a support for separating the async part of the initialization (web communication, serialization, etc) and the part that needs the main UI thread.

    Can you please let me know if you have any idea on how to overcome this issue?

    Thanks,
    Lidan
     
    unity-nikkolai and Salazar like this.
  4. Lidanh

    Lidanh

    Joined:
    Mar 27, 2013
    Posts:
    29
    I've checked with the profiling and I see these two methods.
    I bet we can deserialize on a different thread. Please try to help with this issue. I really hate FPS drops (so are the users...)
     

    Attached Files:

  5. rikshot

    rikshot

    Unity Technologies

    Joined:
    Jul 15, 2013
    Posts:
    3
    Hey

    The culprit code has been removed in the upcoming release. The new package doesn't do any heavy processing at the C# runtime side anymore, so your problem should disappear.

    Ville
     
    Lidanh and Salazar like this.
  6. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Excellent news, I hope the next release is "soonish" and not few weeks timing?. Are you planning to do releases similar to Unity each week or other week if there is any bugs found..