How do I optimize my bouncing behaviour (See capx)

Get help using Construct 2

Post » Wed Jul 30, 2014 8:18 am

Hi guys,

I made this bouncing behaviour for a ball (see capx). The problem is that it checks for a lot of collisions, on average 1.200 per ball at least. In my game I sometimes have up to 15 balls on screen, so my collision checks (in debugging) are between 15.000 and 25.000. How do I lower these, because my game crashes.

I tried:
1 make collision check sub event, real event is when ball is below x
2 make collision check sub event, real event is when ground i in line of sight.

Both didn't have a big impact, I only could lower the collision checks with 100-200 per ball, so there still are at least 1.000 checks per ball.

Help is appreciated!

Thanks,
Daan
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 » Wed Jul 30, 2014 10:31 am

Adding Trigger once condition in the 5-6 sup events, will help you but not much.
have you tried to change the behavior, maybe it's from the platform behavior.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Wed Jul 30, 2014 10:38 am

A0Nasser wrote:Adding Trigger once condition in the 5-6 sup events, will help you but not much.
have you tried to change the behavior, maybe it's from the platform behavior.


Hi, thanks for the reply

I tried chancing the behaviour by getting rid of the the instance variable action and replacing it in the event by a mirrored or not. No change.
But I have no clue how i can get rid of the platform behaviour and get the same results. With a bullet it keeps spinning.
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Wed Jul 30, 2014 3:13 pm

Anyone??
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Wed Jul 30, 2014 5:45 pm

B
48
S
9
G
10
Posts: 200
Reputation: 8,263

Post » Wed Jul 30, 2014 5:51 pm

luisgmolina wrote:Try this.

the cap file fix:
https://www.dropbox.com/s/e92tfy9e5y105 ... 20Fix.capx


Thanks for your input,

I tried that one before, but the problem is that they don't bounce synchrone. As soon as the ball hits the wall it starts to bounce random. I need to be able to walk underneath it. The balls should stay the same jump height and at the same pace, so almost precise as my current ball. However i found out that it is the platform simulate key, that causes all the collision checks.
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Wed Jul 30, 2014 6:18 pm

I do not understand exactly what you want to do. placed an image illustrative.
B
48
S
9
G
10
Posts: 200
Reputation: 8,263

Post » Wed Jul 30, 2014 7:24 pm

luisgmolina wrote:I do not understand exactly what you want to do. placed an image illustrative.


The ball is an enemy that goes from left to right, and back. He must jump like i did before, so his jumping heigt and his speed should remain the same. So it should jump the 50th seccond the same way as the first seccond. It should stay move between the two walls. So actually everything should stay the same, only it should i want to lower the collision checks.
B
7
S
2
G
1
Posts: 77
Reputation: 727

Post » Thu Jul 31, 2014 7:38 pm

I would like to help you, but I understood nothing.
B
48
S
9
G
10
Posts: 200
Reputation: 8,263

Post » Thu Jul 31, 2014 7:46 pm

You should look at the sine behaviour:

https://www.scirra.com/manual/103/sine
B
60
S
21
G
10
Posts: 643
Reputation: 10,320

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, FabianB, Google [Bot], Gumbo, matriax, Yahoo [Bot] and 47 guests