Performance Tips

0 favourites
  • 10 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • Direct to the point:

    In terms of performance, what would be better, keep an object with opacity 0 and then makes it visible, or keep it out of the layout with a small size while not in use, and during the action moves it to the position correct and make the redimension?

  • Make the object invisible (not opacity 0, invisible), make it appear when needed.

    However you could also just spawn the object when needed too.. this seems pretty much like micro optimisation unless you have an exemple

  • Well, making it invisible or leaving it out of the layout I have the same performance? From what I read, even if not visible, the pixels are still processed and rendered.

    And compared to these two cases, if I put the object in the layout, destroy it at the beginning and then do spawn the time it is needed, it would be less efficient or there would be no difference of the above cases?

    I do not have an example because all I'm doing is studying about performance gains and good conduct when developing a game. Already read all the tutorials I found here about it, but now is the time to ask questions and try to do certain things in practice.

  • Invisible or out of the layout is actually the same. It's not being processed in the renderer. Hence same performance.

    Spawning the object when needing, on the opposite, will have a hit on performances even if Ashley made a hell of a job optimizing garbage collection.

    You probably should read the older blog articles, a lot is explained in there on C2's architecture, garbage collection, optimization, memory...

    As for performance tips, this manual article contains what needs to be taken into account.

  • So basically, if I do several layers and leaving only one visible, the other will not interfere with the performance of the game? I suppose that applies to a sprite, is valid for one entire layer.

    I had already read most of the links you passed, as said above (except the first, which I will read now). But I now want to ask everything possible so no doubt remain. XD

  • -dont waste your memory tutorial

    -performance tips tutorial

    -avoid layer if you use canvas2d

    -enable / desable (physics,behaviors,collisions only when it is necessaire)

    -use sprite font instead of sprite text (and set it when it is necessaire for example dont check score every tick update .... but update it for example when your player is on collisions with coins ot some goals

    -avoid every tick on even sheet (like is on layer,every tick , compare variable ) and if you want use it use trigger once

    -when you use set x or set y every tick , remember to use *60*dt

    -dont use a lot of event

    -use family and groups

    the last tips i discover maybe you will not be okay with my idea but if work for me is to optimize sprite and avoid transparencyof all game object ... for exampe for game title .... i use 2 sprite instead of 1 sprite with reducing transparency and some things like that .... and my cpu usage go from 19% to 14% and fsp is always 60 - 59 (58 at intensive steps) before it was between 51 to 59 ...

    yes memory usage have impact on cpu and fsp

    i waste all my time since these last 6 months to test and search about performance tips ... and all these were simply in ashley / aphrodite performance tips tutorial ....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How the layers may interfere with performance?

    I do not see the layers as a big problem if I keep the actions related to the objects it holds, disabled while it is invisible.

    But still, I would like to understand what layers might interfere with the performance?

    And concerning:

    "enable / desable (physics, behaviors, collisions necessaire Only When It Is)"

    I did not understand the storytelling of this sentence. Should I avoid getting turning on and off?

  • You are worrying about the wrong things.

    The things that matter are documented.

  • Yes yes, I understand that, actually, I just wanted some more specific explanation of the implications of the use of objects or layers kept as invisible in performance.

    I know necessarily the number of layers or layouts not interfere with anything, but if I have many objects by layer or objects which occupy the whole screen and are kept as invisible, this leaves me with doubts in what may entail.

    My doubt sounds dumb, but I'm just trying to lock it down, I have used to construct enough time guiding me with what I learned most of these tutorials, so I'm just clarifying this part.

    So, this will not change anything in the performance? Unless, of course, I have some event running on top of one of these objects, or a behavior.

    Ashley, Thank you for always showing interested in helping ^^

  • As always, my answer is the same...

    If you can measure a performance difference: yes, it matters

    If you can't measure a performance difference: no, it doesn't matter

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