Ashley need your help!!Behaviors cause high collision checks

Get help using Construct 2

Post » Fri Sep 12, 2014 3:25 pm

Title sums it up.

I'm made a platform game with bouncing enemies. With a few simple events I got my bouncing enemy, but my collision checks are sky high. On average 1200 for every enemy. In my game I sometimes hit 20.000 collision checks or more. Is this a flaw in the platform behaviour or do i do something wrong.

I added a small file that contains the events i used for the bouncing ball and the basics.

Game: Player walks in an arena with bouncing enemies. Once the enemies hit the wall they turn around...this repeats itself. The player can only shoot up so he needs to get underneath the enemies to shoot it, and destroy it. If the ball hits the player, the player dies.

PS: I tried the bullet behaviour, the problem is that once the enemies hit the wall they get a different jumping height which makes it impossible to avoid them, so it will kill the player. The Enemies needs to bounce in the exact same way during the whole game.

Game is as good is done so I appreciate every help i can get to fix this and release it for Android and IOS!
You do not have the required permissions to view the files attached to this post.
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Fri Sep 12, 2014 3:41 pm

I'd have a good look at using the sine behaviour instead

https://www.scirra.com/manual/103/sine
B
62
S
22
G
10
Posts: 647
Reputation: 10,478

Post » Fri Sep 12, 2014 5:02 pm

Mr E Bear wrote:I'd have a good look at using the sine behaviour instead

https://www.scirra.com/manual/103/sine


Thanks for your reply.
I have no clue how i should do that. Already took a look at it, but without succes :oops:
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Fri Sep 12, 2014 6:17 pm

Try this out
You do not have the required permissions to view the files attached to this post.
B
62
S
22
G
10
Posts: 647
Reputation: 10,478

Post » Fri Sep 12, 2014 10:38 pm

Mr E Bear wrote:Try this out


Thanks for the effort, but I think Sine will not work for me. The enemies need to bounce and with shine they are more like flying up and down. So I hope that Ashley maybe has a way to fix the collision checks for the platform behaviour. Otherwise it will mean that months of work will go in the fridge..... :cry:
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Fri Sep 12, 2014 11:28 pm

What exactly is worrying you about the number of collision checks? Are you not hitting 60 FPS and the profiler is indicating that most of the CPU time is spent there?

If you look at the per-tick estimate, it's only making about 20 collision checks per tick. That is very few. A single collision check is very, very fast, practically negligible performance impact. It's a simple rectangle bounds check. You can have thousands of collision checks and have almost no performance impact. Poly checks are the slower ones, and the debugger shows you're getting about one poly check per tick per object, which again is almost nothing.

The platform behavior does make a lot of collision checks in general though. Take a look at the 'Bouncing balls' template that comes with Construct 2. It shows an almost identical effect to the one in your example, except it's based on the Bullet behavior, which users far fewer collision checks.
Scirra Founder
B
399
S
236
G
89
Posts: 24,530
Reputation: 195,402

Post » Thu Nov 06, 2014 8:23 pm

SOLVED! CocoonJS caused the crashes and the lags. I now use IntelXDK with Crosswalk. No problems on my Nexus 5, but on my galaxy tab 2 10.1 still some minor lags when collision checks are about 20.000. However found out that my tab has a Texas instruments processor(I know :oops:) what probably explains the minor lags.
B
7
S
2
G
1
Posts: 77
Reputation: 727


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests