Check Collisions per tick ?

Discussion and feedback on Construct 2

Post » Mon Mar 24, 2014 10:08 am

I was wondering what is the ideal number of collisions per tick?
When i say ideal i mean the ideal check collisions per tick to run a game smooth.
300 check collisions per tick, should i worry or not?

So yeah, that is my question.
B
36
S
15
G
1
Posts: 59
Reputation: 3,451

Post » Mon Mar 24, 2014 11:02 am

saour wrote:I was wondering what is the ideal number of collisions per tick?
When i say ideal i mean the ideal check collisions per tick to run a game smooth.
300 check collisions per tick, should i worry or not?

So yeah, that is my question.


It depends on different factors, In the debbuger you can see both type of collisions checks:
-Collision checks: It is a quick bounding box collision test, if this test is true, then it does the polygons check to see if the collision is truly happening.
-Poly checks: a costly collision check, based on the collision polygon, this one should be as low as possible IMO.

I think that the best is to not have useless collision checks, for exemple, is it useful to check every tick the collision between a giant slow canon bullet and a slow moving target (I mean in a case that they'll overlap during 10 tick in any case)? I think in some cases, you could try to filter those cases where the collision doesn't have to happen each tick (maybe by disabling collisions), but only if needed, also the collision cells can really help so filtering instances isn't always the best.

As for the quantities of collision checks, I guess it depends of the targeted platform, just try to not check useless things if that helps
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

Post » Tue Mar 25, 2014 1:37 pm

To improve performance you can include:

Disable collisions for all objects.

Create conditions for objects of families

Collisions enabled >Is onscreen

for objects requiring collision.

This increase memory assuming your objects exist off screen.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,293

Post » Wed Mar 26, 2014 7:48 am

Well thanks for the answers .

But I was not asking for a way to improve the perfomance.
Thanks for the tips anyway.
I am new in this community and in Constract and i was wondering how well construct can handle the collisions.
I mean in numbers.
300 collisions checks per tick is a huge number of collision checks or not ?
What is the number of collision checks to avoid?

Thanx again and i am sorry for the bump.
B
36
S
15
G
1
Posts: 59
Reputation: 3,451

Post » Mon Mar 31, 2014 12:37 am

I have more than 15,000 collisions checks per tick on my game and i don't know if it bad or not?
B
7
S
1
Posts: 65
Reputation: 586

Post » Mon Mar 31, 2014 12:45 am

slanw wrote:I have more than 15,000 collisions checks per tick on my game and i don't know if it bad or not?


PC game? Well if you test it and it runs fine then no worries.

Likewise, a number is meaningless, test your game on devices that you are targeting and keep testing it as you progress.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Mon Mar 31, 2014 7:01 am

Collision checks are a major factor in performance, so the amount to aim for is the total of 100% necessary collision checks...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Mon Mar 31, 2014 8:04 am

i have about 120.000 collision checks per sec and it runs at 60 fps on my pc. so i guess everything is relevant depending on which platform you want to publish.
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Mon Mar 31, 2014 1:14 pm

It depends entirely on the CPU power. Be careful not to mix up the per-tick and per-second measurements - 15,000 checks per tick is a lot, but per second it would be fine.
Scirra Founder
B
402
S
238
G
89
Posts: 24,613
Reputation: 195,993


Return to Construct 2 General

Who is online

Users browsing this forum: sydtes and 1 guest