Collides with object doesn't always work

Bugs will be moved here once resolved.

Post » Tue Feb 19, 2013 7:51 pm

Link to .capx file (required!):
https://docs.google.com/file/d/0B2Be06EMBG3sVkR1TXk1d3VWZm8/edit?usp=sharing

Steps to reproduce:
1. Launch app
2. wait
3.

Observed result:
Ball eventually disappears

Expected result:
Ball should bounce forever

Browsers affected:
Chrome: no
Firefox: yes
Internet Explorer: no

Operating system & service pack:
Windows 7 SP1

Construct 2 version:
r119 64-bit    
B
3
Posts: 5
Reputation: 410

Post » Tue Feb 19, 2013 7:57 pm

After 4 minutes works fine in Chrome 24 (r119 64-bit). It would probably bounce forever if I did not close chrome.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Feb 19, 2013 8:25 pm

The report does specify Firefox, and it does disappear after a short period!
ImageImageImage
B
67
S
19
G
123
Posts: 3,208
Reputation: 73,903

Post » Wed Feb 20, 2013 3:23 pm

Closing as won't fix. I don't think we can do anything to resolve such brutal collision setups. You have a very large object moving quickly in a tiny enclosed area with thin walls, which also keeps changing angle. Your event to bounce the object off walls is unnecessary since it's already set to automatically bounce off solids, so that might be making it worse. This is probably highly susceptible to dt spikes, and sometimes the motion will prove impossible to resolve and will trigger the "stuck in solid, push out anywhere" collision handler. This can teleport the object outside enclosed areas. It only happens as a last-ditch effort if the movement cannot be resolved any other way.

The engine only runs 60 times a second so you can only get so far accurate simulation out of that. To resolve this, make the object smaller, slower, and the walls a lot thicker. Removing the redundant event and stopping the bullet movement rotating the object will probably help further.Ashley2013-02-20 15:24:26
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Feb 20, 2013 7:39 pm

Please move back to the 'I will consider fixing this' category.

Here's an updated version of the project with fixes to your issues (larger layout, collision detection removed). This file is a 600x500 layout, and no events (the ball just naturally bounces around the screen using the 'bounce off solid' behavior.)

https://docs.google.com/file/d/0B2Be06EMBG3sTGNGTE5Qa3FoOVU/edit?usp=sharing

It will take longer, but it still consistently (5 times in a row) disappears in Firefox (it just takes close to 5 minutes of bouncing before it happens.)

Long explanation:

The original capx uploaded was a demo of the behavior. The original app was 640 x 480 pong game (I'm moving over to Construct2 from a competing product, and one of their examples on how to learn to use the system was to create a pong game, so I was in the process of recreating it using Construct2, and noticed that occasionally the ball would disappear/teleport instead of bouncing.) To demonstrate the behavior without forcing you to play a pong game for 20 minutes I constructed the attached capx file which shrunk the layout size considerably and inserted a 4th wall instead of a paddle.

As to the collision check, this is because the competitors product doesn't have a 'bounce off solids' attribute and I'm still learning Construct2. Nice addition 'bounce off solids' - very handy attribute.
B
3
Posts: 5
Reputation: 410

Post » Wed Feb 20, 2013 11:27 pm

@mixlplex - your walls are still fairly thin. You can easily make them all 100px thick which should prevent any collision issues, without affecting the visual appearance. Does that help?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Fri Mar 01, 2013 4:06 pm

Yes, the thicker walls helps. 100px seems a bit excessive, I'll play with them to see what works. Thanks.
B
3
Posts: 5
Reputation: 410


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest