Low performance

0 favourites
From the Asset Store
High Low is a casino game using luck and points accumulation.
  • I created a leaderboard for the game, and when I open it, I get a drop of 20-30 frames per second on Iphone 12 and on Nothing Phone. Who knows what exactly the problem is? I made a copy of the table in an empty project for an example.

    link:

    dropbox.com/s/l35xwsa7s94oexa/test.c3p

    Tagged:

  • Does this demo project also have performance issues on iPhone? Because I see absolutely no problems in the code, it's simple and effective.

  • Remove all "for each" conditions. They're redundant in this case.

    Also don't forget that you're running many collision checks with "is overlapping", which is very cpu intensive. Instead, create your UI hierarchies directly in the layout.

    That way, you can get rid of the entire hierarchy setup on runtime.

    And you can disable "collisions" on all sprites. All this only helps for performance issues during start of layout though.

    If you actually have performance issues when clicking the buttons, maybe try a different variant to animate your UI instead of "Tween".

  • Remove all "for each" conditions. They're redundant in this case.

    Also don't forget that you're running many collision checks with "is overlapping", which is very cpu intensive. Instead, create your UI hierarchies directly in the layout.

    That way, you can get rid of the entire hierarchy setup on runtime.

    And you can disable "collisions" on all sprites. All this only helps for performance issues during start of layout though.

    If you actually have performance issues when clicking the buttons, maybe try a different variant to animate your UI instead of "Tween".

    All these checks occur only once at startup and do not affect performance in any way. The performance is affected only by the opening of the high score table with the behavior of Tween. It doesn't matter how to attach objects, in code or in the editor - it's the same thing!

  • Does this demo project also have performance issues on iPhone? Because I see absolutely no problems in the code, it's simple and effective.

    Yes, of course! On any device, even on the Macbook M1 Pro, drop to 10 frames. Because of this, I can't finish working on the project:(

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • All these checks occur only once at startup and do not affect performance in any way. The performance is affected only by the opening of the high score table with the behavior of Tween. It doesn't matter how to attach objects, in code or in the editor - it's the same thing!

    Yes it does affect cpu utilization. No it's not the same thing. Yes only on start of layout, just as i've described.

    You said "when i open it", so i wasn't sure if you mean the layout or when triggering the tween. Either way, it should be fairly easy to check if the "tween" is the issue, so just replace it with a different method and compare it.

    I can't reproduce any performance issues on decent hardware with your given example.

  • > All these checks occur only once at startup and do not affect performance in any way. The performance is affected only by the opening of the high score table with the behavior of Tween. It doesn't matter how to attach objects, in code or in the editor - it's the same thing!

    Yes it does affect cpu utilization. No it's not the same thing. Yes only on start of layout, just as i've described.

    You said "when i open it", so i wasn't sure if you mean the layout or when triggering the tween. Either way, it should be fairly easy to check if the "tween" is the issue, so just replace it with a different method and compare it.

    I can't reproduce any performance issues on decent hardware with your given example.

    You can see through the debug mode or remote preview how the frame rate drops

  • You can see through the debug mode or remote preview how the frame rate drops

    This doesn't happen on my Windows laptop. CPU utilization goes up to 30% for a short period, but the tween runs smoothly and there is no fps drop. I'm guessing the problem is either with Tween or hierarchies on MacOS/IOS.

    I would try these things:

    • Check if WebGL2 is enabled in Debug Mode.
    • If possible, try a different browser.
    • Try using MoveTo instead of Tween.
    • Try using Pin instead of adding objects as children.
    • Test with sprites only, without the text objects.
    • Check if you have the same issue with the "Skeleton hierarchy" example in C3.
  • My guess is that the tween also changes the text objects font size, requiring an expensive redraw. Tweening a text objects height width in a hierarchy can be expensive.

  • > You can see through the debug mode or remote preview how the frame rate drops

    This doesn't happen on my Windows laptop. CPU utilization goes up to 30% for a short period, but the tween runs smoothly and there is no fps drop. I'm guessing the problem is either with Tween or hierarchies on MacOS/IOS.

    I would try these things:

    • Check if WebGL2 is enabled in Debug Mode.
    • If possible, try a different browser.
    • Try using MoveTo instead of Tween.
    • Try using Pin instead of adding objects as children.
    • Test with sprites only, without the text objects.
    • Check if you have the same issue with the "Skeleton hierarchy" example in C3.

    Frames on android are falling even harder, skeleton hierarchy works well (the CPU load is only 6%), in my example, the CPU load is >65%

    fedca suggested , it 's all about the text , deleting it all drawdowns disappeared , but what to replace it with :(

    the screenshot shows a drop in frames from 120 to 64 frames

  • My guess is that the tween also changes the text objects font size, requiring an expensive redraw. Tweening a text objects height width in a hierarchy can be expensive.

    how to avoid this?

  • Try unchecking "width" and "height" in hierarchy options for text object.

    If this doesn't help, you can replace it with a spritefont, this should definitely fix the issue.

  • You could also scale the text by turning it into a mesh and scale the points, which allows scaling the text without needing a offscreen redraw.

    But this is a little more advanced, I made an example in the commmunity discord.

    Otherwise do what dop2000 suggested.

  • You could also scale the text by turning it into a mesh and scale the points, which allows scaling the text without needing a offscreen redraw.

    But this is a little more advanced, I made an example in the commmunity discord.

    Otherwise do what dop2000 suggested.

    will you share the link to the post?

  • Try unchecking "width" and "height" in hierarchy options for text object.

    If this doesn't help, you can replace it with a spritefont, this should definitely fix the issue.

    this solved the problem, but the animation now looks not presentable! :(

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)