0 Favourites

platform sprite, bad collision detection

  • Currently using r68 64-bit, on Windows 7, running game in Chrome. Although this problem was happening on previous releases as far as I know.

    Using nothing but the platform behaviour and solid sprites as a bare bones platform environment seems to result in tiny errors in the collision detection.

    I'm not entirely sure how to best describe it, so here's a screenshot.

    <img src="http://dl.dropbox.com/u/46479820/Construct2/bugs/registration_bug.png" border="0">

    As you can see, the player sprite is inside the floor by a pixel or so, and about a pixel away from the wall, even though it should be touching the wall.

    As the player moves around, it seems to be random as to when it falls into the solids like this. You can jump up and down on the spot, and each time you land it could be either sitting perfectly on top of the solid, or sitting inside it by a pixel or so.

    Does this happen for anyone else?

    capx

    edit: FYI, it happens in Canvas2D and in WebGL, with Point or linear scaling and in crop or scale mode.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Might try pixel rounding.

    That "snaps" the object to it nearest whole number, and gets rid of the decimals, IE x=1, not 1.5

  • I tried pixel rounding, and the problem persists. Just checked it again to be sure... no luck.

  • I think the speed of the platfor behavior is set too high and it doesn't detect solids properly, If you try divide all values in the platform properties by 10, it works normally.

    edit>pixel rounding works for me

  • I think the speed of the platfor behavior is set too high and it doesn't detect solids properly, If you try divide all values in the platform properties by 10, it works normally.

    edit>pixel rounding works for me

    This doesn't work for me. I've now got it set ridiculously low... like moon gravity low... and it still does it.

    edit: Pixel rounding definitely reduces the problem, but doesn't eliminate it entirely. Plus it causes jittery movement, so it's hardly a satisfying work around. :(

  • I didn't notice it's set on the default values, so it should work and if not, rounding should. Have you tried different browsers?

  • Same thing happens here and in the platformer examples so er..I think it's just unfinished?

  • I don't think there's much that can be done about this, by design the platform works to the nearest pixel only. Because you've zoomed in a long way and C2 supports floating point positions, sometimes you see a very thin gap which is less than a pixel thick.

    I might be able to revise the code but I had expected results like this. A common workaround is to move the collision box in a little bit.

  • This didn't happen in CC though :< I understand they're different engines but the current one does seem a little wonky.

    It also doesn't work very well with moving platforms; the player's Y position doesn't keep up vertical ones, and if you move against a horizontal one the player moves upwards and sometimes ends up on the top of the platform.

    Also the "push-out" mechanic seems to only work to some extent. If the player gets smashed by a moving platform and he's near the edge, he'll be pushed out, but if he's near the middle of the platform he'll get stuck. Not a big deal, really, but I thought I should mention it.

    Can atleast the moving platform problems be looked into?

  • Can you post bug reports with examples? I had it working fine a couple of months ago, but due to some other reports I had to tweak it a bit so I probably accidentally broke it.

    If you get crushed by a block in C2 getting stuck is by design. CC would *always* try to push you out, and that sometimes meant the player teleporting a long way through a thick wall which could ruin games, so now there's a maximum push-out distance before it gives up and leaves you stuck. I'm not sure what else should happen if the player gets crushed by a solid!

  • I don't think there's much that can be done about this, by design the platform works to the nearest pixel only. Because you've zoomed in a long way and C2 supports floating point positions, sometimes you see a very thin gap which is less than a pixel thick.

    This actually causes problems aside from the immediately obvious. For example, I'm attempting to create a player from multiple sprites using either the pin behaviour or "set position to..." where the player can change appearance by adding components to the base "bounding box".

    Unfortunately with this inaccuracy, the components also end up being out of sync with their intended position, which visually is very unappealing, and it seems sometimes the components will actually slip off the edge of a platform, only to teleport back up when the rest of the bounding box decides it was meant to be elsewhere.

    Bearing this in mind, I originally thought I was doing something in the wrong tick, and that the components were just catching up a bit late... but having created this example for the sole purpose of eliminating other causes, it seems my entire idea for a game is bust - because C2 won't be able to handle the concept at all.

    Frustrating. Especially if this wasn't a problem in CC (I haven't confirmed this myself yet).

  • What about the walls?

    Have you tried anything to make sure they are in the right position?

  • What about the walls?

    Have you tried anything to make sure they are in the right position?

    They are set to snap to a grid of 8x8, if that's what you mean.

  • Just thought I'd reiterate that this is still a problem, and it's pretty much game breaking in some situations.

    The newest update that added wall detection gave me the opportunity to test a (very) simple super meat boy style wall jump setup... and it works great...

    ...except that sometimes it doesn't. Just like before, the player sprite will sometimes be a pixel or so off... and it will fail to hit the wall... which kills the wall jump.

    I feel like this issue was kind of waved off as unimportant when I raised it, but I do see it as a serious problem. And since I never noticed it happening in Classic, I don't understand why it can't be fixed in C2.

    Ashley, can you explain why it isn't fixable? Or why it's not important to at least try to fix?

    edit: Here's a capx that illustrates the problem... if you try wall jumping away from one wall to another without using any arrows, the player sprite will sometimes just fail to hit the other wall.

    capx

    edit: Here's an equivalent example from Classic, working just fine and dandy.

    exe

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