Collides with object doesn't always work

0 favourites
  • 7 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Link to .capx file (required!):

    docs.google.com/file/d/0B2Be06EMBG3sVkR1TXk1d3VWZm8/edit

    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

  • After 4 minutes works fine in Chrome 24 (r119 64-bit). It would probably bounce forever if I did not close chrome.

  • The report does specify Firefox, and it does disappear after a short period!

  • 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.

  • 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.)

    docs.google.com/file/d/0B2Be06EMBG3sTGNGTE5Qa3FoOVU/edit

    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.

  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes, the thicker walls helps. 100px seems a bit excessive, I'll play with them to see what works. Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)