How should I use every tick (performance)

0 favourites
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • Most of the performance questions in this thread are meaningless. Read the blog post Optimisation: don't waste your time

    Thanks Ashley

  • [quote:15dwjiku]

    All of the event sheet (except triggers) conditions are checked every tick, you should not worry about every tick, just make sure you don't do useless actions or conditions (if you want something to happen, does it have to happen every tick, or only on particular cases? When you are checking for a condition, is it really nessecary, or can you filter down even more if that is intensive), there is no magic, no wizardry, just see what you event sheet does, and when it does it, if there are redundancy or things that should not be done in some particular cases, because it serves no purpose to do it, then don t let the system do it.

    Thanks, I´ll try to lower to zero unnecessary calls.

  • Also remember that sometimes, optimising something is not necessary, you have to see what is really taking down your game so you can optimise that in particular, this is why you should care more about organisation at first rather than optimisation, a disorganised code is too hard to optimise correctly, and also too hard to expand it, keep things organised, and everything will be easier, not only to optimise, but also to go further into developing your game.

  • Also remember that sometimes, optimising something is not necessary, you have to see what is really taking down your game so you can optimise that in particular, this is why you should care more about organisation at first rather than optimisation, a disorganised code is too hard to optimise correctly, and also too hard to expand it, keep things organised, and everything will be easier, not only to optimise, but also to go further into developing your game.

    I´ve been trying to separate in groups, so when something is not active, I disable the group and save processing.

    Do you know any "rules", or tips, hints to better organize the code?

  • Includes are good to keep things organised by catégories (ennemi AIs in one event sheet, decorative elements in another, inputs in another one, etc..)

    Groups can really help subdivising things (for exemple: one group per ennemi AI), and that can be deactivated in some cases to reduce the impact on the CPU

    functions are a pretty neat thing, it help not having to repeat constantly the same things over and over, or subdivising complex math calculations, which also helps if you need to modify something (having to modify it only once rather than a lot of times). local variables and constants are also pretty good to have this "change once apply everywhere in the code" effect.

    My primary objective is to try to always code in a similar way, so if there is a problem, I have an idea of where the problem can be located.

    The debbuger is a good tool to have an idea of what is happening, also, sometimes I read the entire event sheet, from top to bottom, to see if there is something that doesn't feels right.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Includes are good to keep things organised by catégories (ennemi AIs in one event sheet, decorative elements in another, inputs in another one, etc..)

    Groups can really help subdivising things (for exemple: one group per ennemi AI), and that can be deactivated in some cases to reduce the impact on the CPU

    functions are a pretty neat thing, it help not having to repeat constantly the same things over and over, or subdivising complex math calculations, which also helps if you need to modify something (having to modify it only once rather than a lot of times). local variables and constants are also pretty good to have this "change once apply everywhere in the code" effect.

    My primary objective is to try to always code in a similar way, so if there is a problem, I have an idea of where the problem can be located.

    The debbuger is a good tool to have an idea of what is happening, also, sometimes I read the entire event sheet, from top to bottom, to see if there is something that doesn't feels right.

    Hey, thanks for the tips, bro.

    In fact, as a noob, I still don´t use functions but I´ll take a look at c2´s manual and tutorials right away. Maybe I can have a cleaner code using them.

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