How do I performance optimisation !!!

  • hi all,

    i read all tutorial about game optimisations and that give me some results but i just want to know ...

    specially on ios ...

    when we destroy object when its out side layout (specially animated one) .... that affect the optimisations (fsp and processeur memory usage ... ) ???

    i have make game ... and sometimes when i simulate it on xcode i get 54 on fsp and 98% processor usage and game turn to be slower ....

    thanks for reply

    i use ejecta to export and my game is simple ...

  • Anything not in the 'Performance tips' article is generally not important to performance.

  • mmmm ok

    but can you explaim me why ?

    and you prefer destroy the object or not ?

  • if we destroy object ... outside layout ... may this will reduce collisions calculations ? no ?

  • if we destroy object ... outside layout ... may this will reduce collisions calculations ? no ?

    Objects outside layout are not included in collision detections so it wouldn't change anything in this regard.

  • thanks nimos100

    other question ... if we reduce collisions polygone (of player and ennemy for example) ... will this affect collisions calculations and also some performance ?

  • Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little), reducing collison polygon of object could help during intense phases.

    If your ennemies have an AI that doesn't need to be active when not on screen, you could do something for that too.

    Some collisions maybe could be check only each other ticks.

    At the end, the goal is to keep the amount of calculations as low as possible, while preserving the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little), reducing collison polygon of object could help during intense phases.

    If your ennemies have an AI that doesn't need to be active when not on screen, you could do something for that too.

    Some collisions maybe could be check only each other ticks.

    At the end, the goal is to keep the amount of calculations as low as possible, while preserving the game.

    thanks aphrodite ... you are really like aphrodite in mythology (saverrrr)

    yes this why i was thinking to destroy object when its outside layout maybe will reduce the collisions calculations ... so as i understand i will help (just little but better than nothing ...)

    and for reduce polygons collisions on object (as you sad i have object with some parts that not need to be checked for example only their X and not ther Y so ... that will help ??? yes ?

    finally i just not understand something ...

    when you say "Some collisions maybe could be check only each other ticks."

    that mean that i have to add another condition to "when object 1 is on collisions with another object B" for example every tick or every seconde ?

    thanks a lot for all

    i just finish my game and publish it on appstore ... but i see that its slower on iphone 4

    so i would like to improve performance at maximum for iphone 4

  • thanks aphrodite ... you are really like aphrodite in mythology (saverrrr)

    yes this why i was thinking to destroy object when its outside layout maybe will reduce the collisions calculations ... so as i understand i will help (just little but better than nothing ...)

    and for reduce polygons collisions on object (as you sad i have object with some parts that not need to be checked for example only their X and not ther Y so ... that will help ??? yes ?

    finally i just not understand something ...

    when you say "Some collisions maybe could be check only each other ticks."

    that mean that i have to add another condition to "when object 1 is on collisions with another object B" for example every tick or every seconde ?

    thanks a lot for all

    i just finish my game and publish it on appstore ... but i see that its slower on iphone 4

    so i would like to improve performance at maximum for iphone 4

    For the collisions, C2 already checks only the bounding box first, then if the bounding box are indeed colliding(very fast to calculate), it checks the true collisions, this can be slower depending on the complexity of the collision polygon, also C2 arranges everything in different cells (areas) if it is possible to reduce the collision checks, but other than that, I do not know much about how it is done.

    As for not checking every tick, I would say for exemple a large (relatively speaking, testing will tell if it works or not) projectile can checks if it is colliding with the player only one tick out of two for exemple, to achieve that, you can add the system condition "Compare two values: tickcount%2 equal to 0", that may help (it could also cause problems in some cases, but I consider that this kind of projectile will be destroyed right after colliding)

    I do not know much about your game so I cannot help a lot, the debugger feature of C2 may help you see what parts are cpu consumming.

    Also, it may be possible that graphics are what kneel you game down, but not sure about that

  • [quote:1ubmx79n]Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

    What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?

  • Also destroy outside.layout saves memory by removing objects no longer in pay. Make sure all you collision check objects are on layers with the same parallax values or it breaks the collision checks. I also disable collisions for objects that are not on those layers such as the UI etc....

  • Also destroy outside.layout saves memory by removing objects no longer in pay. Make sure all you collision check objects are on layers with the same parallax values or it breaks the collision checks. I also disable collisions for objects that are not on those layers such as the UI etc....

    mmm good idea

    is that mean that we have to add another condition to collisions object with another object ?

    for example : if object A (player) is on collision with B (ennemy) (and another condition if object B is on screen ? or on layout ) ?

    yes , no ?

  • [quote:2ojkbp3k]Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

    What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?

    I meant that even if they are outside the layout, they still exist, and C2 still register collisions with them from my experience. Which is normal, not every game can satisfy itself with a predefined layout size.(however, most likely the collision cells will filter that out).

  • > [quote:l2xw0816]Getting rid of objects outside layout will help (they normally are collision checked, and even if not because of collision cells, it still helps a little),

    >

    What do you mean with that they are normally checked if outside layout, its standard that they are excluded if outside layout, or do you mean something else?

    I meant that even if they are outside the layout, they still exist, and C2 still register collisions with them from my experience. Which is normal, not every game can satisfy itself with a predefined layout size.(however, most likely the collision cells will filter that out).

    yes

    and if thats like you said better add condition to collisions script

    for example like i said

    if object A (player) is on collisions with object B (ennemy)

    and if object B is on screen

    this will tel to construct engine to calculate colissions only if object B is on screen

    ??? am i logic ?

  • [quote:1cmp8bho]yes

    and if thats like you said better add condition to collisions script

    for example like i said

    if object A (player) is on collisions with object B (ennemy)

    and if object B is on screen

    this will tel to construct engine to calculate colissions only if object B is on screen

    ??? am i logic ?

    I would still say no, I don't see any evidence that it should matter in regards to collision checks. As you can test it pretty easy. Make 2 sprites and put them on the layout.

    In the code you write "On collision object 1 with object 2" that would give you 60 collisions checks, if you move one of the objects out of the layout you get 0 collision checks. So to check if its on layout doesn't matter.

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