0 Favourites

[r236] Platform & Overlapping Jumpthru problems

  • Problem Description

    When a Platform behaviour object walks off an object while overlapping a Jumpthru (or walks down a slope while overlapping a Jumpthru) it will be moved downwards further than it should, resulting in a noticeable jolt downwards.

    On a similar note, while walking down a slope, while also overlapping a Jumpthru, the Platform object will be embedded in the ground until it is no longer overlapping the Jumpthru.

    The issue appears to be at lines 791-2 of the Platform behaviour's runtime.js. When the behaviour checks whether it is overlapping a Jumpthru, it does not check whether it was overlapping previously. If, in this case, it walks off an edge while overlapping a jumpthru, it moves the player downwards, attempts to push upwards (including jumpthrus), and when it fails to push upwards it doesn't move the player back.

    I've been developing a behaviour of my own that also has this issue, so I've already attempted to fix the issue for my own use, if it helps simplify things: here's the runtime.js.

    In the checks at around line 690, if you hold on to the overlapping Jumpthru instance, you can then check further down, just before the push that fails (line 794 onwards in example), to see if it's still overlapping after moving downwards pre-push. The vertical push can then be changed to only push out of Jumpthrus if there's still a valid one.

    Attach a Capx

    Capx

    Description of Capx

    This capx contains an object with the Platform behaviour, a few Solid objects, and a few Jumpthru objects that overlap areas where the player can walk.

    Steps to Reproduce Bug

    • Step 1: Run capx
    • Step 2: Walk off Solid
    • Step 3: Walk off lowest Jumpthru
    • Step 4: Walk downhill along Solid slope, through lowest Jumpthru

    Observed Result

    When walking off the ledges, for a single frame the Platform object moves noticeably more than it should. When walking along the slope, the Platform object clips into the ground for as long as the player continues to move and overlap.

    Expected Result

    In both cases, normal vertical movement is expected, without the player object being pushed lower than usual.

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Internet Explorer: YES

    Operating System and Service Pack

    Windows 7 Service Pack 1

    Construct 2 Version ID

    r236

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)