How do I manage fps/collisions?

0 favourites
  • 5 posts
From the Asset Store
Particles support animations, collisions, effects and etc.
  • Hello

    i have been thinking about this since i started this project.

    Can you please take a look at this? Fps looks fine but there are too many collisions.

    http://i59.tinypic.com/2vmiz4z.png

    12161 collisions in total and 248/tick. Isn't that too much or is this just normal?

    poly checks 504 in total 10/tick

    and numbers will roughly be doubled when im done with this project.

    Do i need to worry about this and look for solutions or is that ok? <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

  • That shouldn't be a problem. I got games with even more working fine.

    Read this release note to understand how it works:

    https://www.scirra.com/blog/ashley/6/co ... on-in-r155

    Else you should describe why you need these collisions? Show screenshots of your code or share capx files.

    Always good is to give collision checks an "every 0.5 seconds" instead of "every tick" but that depends on the game if possible. Sometimes you really need per tick. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello

    i have been thinking about this since i started this project.

    Can you please take a look at this? Fps looks fine but there are too many collisions.

    http://i59.tinypic.com/2vmiz4z.png

    12161 collisions in total and 248/tick. Isn't that too much or is this just normal?

    poly checks 504 in total 10/tick

    and numbers will roughly be doubled when im done with this project.

    Do i need to worry about this and look for solutions or is that ok? <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

    Difficult to say what is normal, it depends on what content your game holds.

    1 object needing collision detection against another object, will do 60 checks per sec and ~1/tick

    So depending on how many objects and events you have that requires collision checks this number will increase.

    An example:

    1. Your player have path finding and on the screen you have 1 solid object and no events that need to check for collisions. Then you will have a collision check / sec of 0 and ~0/tick

    2. Same as above but this time you have one event that checks for overlaps with the solid object, which would give you a collision check / sec of 60 and ~1/tick

    3. Same as above but now you have 4 solid objects and 3 events that checks for collisions, which gives you 720 collision checks per sec and ~12/tick

    So whether you have to many or not is hard to say, it depend on you having events that are not needed or to many objects on the screen that wouldn't need to be there. however as you can see from the last example, which doesn't really have a lot of collision objects or events the count is already at 720 checks per second. So 12000 checks is not a lot and in above example it can be achieved by increasing the number of solid objects to 20 and the event count to 5 as that would give you 12000 checks as well.

    So if you have some enemies, a player some bullets etc that need collision detection the count will go up rather fast.

  • That shouldn't be a problem. I got games with even more working fine.

    Read this release note to understand how it works:

    https://www.scirra.com/blog/ashley/6/co ... on-in-r155

    Else you should describe why you need these collisions? Show screenshots of your code or share capx files.

    Always good is to give collision checks an "every 0.5 seconds" instead of "every tick" but that depends on the game if possible. Sometimes you really need per tick. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile">

    Thanks a lot, yes i have seen that link, kind of a relief <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • > Hello

    >

    > i have been thinking about this since i started this project.

    > Can you please take a look at this? Fps looks fine but there are too many collisions.

    >

    > http://i59.tinypic.com/2vmiz4z.png

    >

    >

    > 12161 collisions in total and 248/tick. Isn't that too much or is this just normal?

    > poly checks 504 in total 10/tick

    >

    > and numbers will roughly be doubled when im done with this project.

    > Do i need to worry about this and look for solutions or is that ok? <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

    >

    Difficult to say what is normal, it depends on what content your game holds.

    1 object needing collision detection against another object, will do 60 checks per sec and ~1/tick

    So depending on how many objects and events you have that requires collision checks this number will increase.

    An example:

    1. Your player have path finding and on the screen you have 1 solid object and no events that need to check for collisions. Then you will have a collision check / sec of 0 and ~0/tick

    2. Same as above but this time you have one event that checks for overlaps with the solid object, which would give you a collision check / sec of 60 and ~1/tick

    3. Same as above but now you have 4 solid objects and 3 events that checks for collisions, which gives you 720 collision checks per sec and ~12/tick

    So whether you have to many or not is hard to say, it depend on you having events that are not needed or to many objects on the screen that wouldn't need to be there. however as you can see from the last example, which doesn't really have a lot of collision objects or events the count is already at 720 checks per second. So 12000 checks is not a lot and in above example it can be achieved by increasing the number of solid objects to 20 and the event count to 5 as that would give you 12000 checks as well.

    So if you have some enemies, a player some bullets etc that need collision detection the count will go up rather fast.

    Thanks a lot for answer, game is a jumper platformer, there are 7-9 kinds of obstacles in all levels and only 1 event sheet for all levels <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

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