How do I partly destroy object like space invaders

Get help using Construct 2

Post » Wed May 31, 2017 1:34 pm

Hi,

I want to make app with space invaders mechanics, where bullets are destroying object piece by piece. I want to have few custom object being destroyed like this, all of them are solid color just like obstacles in space invaders. But I don't know how can I achieve that without bottlenecking my PC. I tried to use dots to create my object but suddenly I had 100k + collision checks.

Thanks for any advice.
B
8
S
1
Posts: 27
Reputation: 1,029

Post » Wed May 31, 2017 1:40 pm

How do you check the collision? You can try to improve the collision checks, i had same problem with my game which had around 150k collision checks but after messing around with the events i improved it down to 1k only.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Wed May 31, 2017 2:49 pm

There's a big difference between "bullet on collision with brick", and "brick on collision with bullet".
Image ImageImage
B
168
S
50
G
169
Posts: 8,283
Reputation: 108,195

Post » Thu Jun 01, 2017 6:45 am

newt wrote:There's a big difference between "bullet on collision with brick", and "brick on collision with bullet".


Can you describe how you mean it? Because I don't see a difference at all.

imhotep22 wrote:How do you check the collision? You can try to improve the collision checks, i had same problem with my game which had around 150k collision checks but after messing around with the events i improved it down to 1k only.


I had simple bullet-on collision with dot-destroy dot and bullet

I tried to divide it into sectors, so first I check if bullet is in sector "A" and if yes, check for collision with dots in sector "A" it helped to reduce checks/tick from 12000 to 2000 but I still feel it is too much because performance on mobile is not smooth. Also I'm testing in on low end mobile, with snapdragon 212... still I feel like there should be a smoother way.
B
8
S
1
Posts: 27
Reputation: 1,029

Post » Thu Jun 01, 2017 10:30 am

Another way of doing this. Example is not perfect, but shows the basics.

https://www.dropbox.com/s/8zu69ylvpf0lu ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jun 01, 2017 1:10 pm

mikva wrote:
newt wrote:There's a big difference between "bullet on collision with brick", and "brick on collision with bullet".


Can you describe how you mean it? Because I don't see a difference at all.


Filtering means using the object you have the least amount of to check for collisions.
The system only checks for the first object referenced in the condition.

You might have only one bullet, and hundreds of bricks.
Image ImageImage
B
168
S
50
G
169
Posts: 8,283
Reputation: 108,195

Post » Fri Jun 02, 2017 8:52 am

99Instances2Go wrote:Another way of doing this. Example is not perfect, but shows the basics.

https://www.dropbox.com/s/8zu69ylvpf0lu ... .capx?dl=0


Thanks! I never realized I can use tilemap like that. This pretty much solved my problem!

newt wrote:Filtering means using the object you have the least amount of to check for collisions.
The system only checks for the first object referenced in the condition.

You might have only one bullet, and hundreds of bricks.


Still don't understand. I have 1 bullet and lets say 5000 bricks. What is the difference in checking if 1 bullet is touching any of those 5000 objects (5000 check) or if every single object from those 5000 is touching one bullet (also 5000 checks)

I even tested that and there is no difference in checks/minute or fps.
B
8
S
1
Posts: 27
Reputation: 1,029

Post » Fri Jun 02, 2017 2:56 pm

You may not see a difference for that example, but it works in conjunction with other filtering such as "is on screen", etc.
Image ImageImage
B
168
S
50
G
169
Posts: 8,283
Reputation: 108,195


Return to How do I....?

Who is online

Users browsing this forum: dop2000, jatin1726, nahima and 4 guests