Platform2 [behavior]

  • > >

    > > > Ok, could we create a bug / notice about this?

    > > >

    > >

    > > I'm not sure why I would want a limitation/bug in a standard plugin fixed if it's providing my plugin with a selling point...

    > >

    >

    > If Scirra solves this, one thing will happen:

    > We will all benefit from it.

    >

    > It can also happen that you get rid of this problem and focus on other features of the plugin.

    > But that's up to you.

    >

    > Anyway, I opened an error report.

    Is this push out bug happening with platform2? It seems like platform2 was created to fix these types of issues, is that example from built-in platform?

    The error was solved in the previous beta to the current one

  • Ahh thanks, I was curious which your clip was taken from.

  • The error was solved in the previous beta to the current one

    Not completely. The collision with the walls was fixed, but in a collision with the moving ceiling, the character is thrown to the right.

    c2community.ru/forum/download/file.php

  • > The error was solved in the previous beta to the current one

    Not completely. The collision with the walls was fixed, but in a collision with the moving ceiling, the character is thrown to the right.

    http://c2community.ru/forum/download/file.php?id=21612

    And why do not you report this?

    If you think it's improper behavior, let them know.

  • Please start a new thread if you want to discuss the standard platform behaviour and its problems (which are caused by the runtime PushOutSolid function).

    Platform 2 has a completely different approach to collision management, which is why it doesn't suffer from the same problems that the standard behaviour has.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Please start a new thread if you want to discuss the standard platform behaviour and its problems (which are caused by the runtime PushOutSolid function).

    Platform 2 has a completely different approach to collision management, which is why it doesn't suffer from the same problems that the standard behaviour has.

    Colludium Thanks, I just wanted clarification this plugin doesn't have such issues. Bought Platform2 yesterday and I'm rewriting the walljump function from Platformer+ (based exactly on standard platform code, with walljump added) and have a couple of questions.

    1. What's the best way of providing a wall-jump and slide? I have my own method which is working well: s15.postimg.cc/gopjevzdn/walljump.png

    The only issue is with this, the player seems to move at int positions, rather than smoothly on subpixels. Is there a better way you could suggest implementing wallsiding/jump that would be smooth? (Not sure how buggy this way of doing it might be, I haven't road tested it extensively yet)

    2. Matching standard platform movement accel/decell and speed seems perfect, but jump height seems a lot different. This was what I used for Platformer+ : s15.postimg.cc/635o2iqdn/platpls.png

    This is an approximation that I used (still working on a perfect match): s15.postimg.cc/ihsg2vs6j/plat2.png

    Do you know what differences Platform2 and standard platformer would have in relation to jump strength?

    3. I'm aware there's a 1 frame latency on this to the standard engine (which makes it tricky to match speeds and jumps), I'm interested in what exactly causes this, and if there's any way to bring performance in line with the standard? (probably not!)

    Thanks!

  • Zebbi,

    Thanks for buying it! The P2 plugin has a wall hang only so anything additional that you do via events will be good! If the player is moving at int positions then it's not P2 - my plugin works to 1/8 pixel iirc (I'll check).

    Jump height is different because the standard plugin doesn't use Newton's equations of motion, only an approximation, which means that different frame rates will give different jump heights.... But this is not a problem with P2 :)

    That and a completely different collision system (including filtering) are the main differences.

    There shouldn't be any latency compared to the standard plugin. I'm intrigued by what you could mean for that.

    Cheers!

  • Zebbi,

    Thanks for buying it! The P2 plugin has a wall hang only so anything additional that you do via events will be good! If the player is moving at int positions then it's not P2 - my plugin works to 1/8 pixel iirc (I'll check).

    Jump height is different because the standard plugin doesn't use Newton's equations of motion, only an approximation, which means that different frame rates will give different jump heights.... But this is not a problem with P2 :)

    That and a completely different collision system (including filtering) are the main differences.

    There shouldn't be any latency compared to the standard plugin. I'm intrigued by what you could mean for that.

    Cheers!

    Yeah, as we worked out, it's because platform+ registers the input during pause, whereas platform2 doesn't. I've tried matching the jump heights and jump speeds, but it's quite tricky to get a frame accurate match, specifically because I can can't change the timescale without it screwing up platform+'s height scale (which platform2 THANKFULLY fixes!) so step incrementing is the only real option for side-by-side testing. I assume incrasing gravity will increase the jump acceleration speed, which is the hardest part to match between the two, specifically the initial launch speed of the jump, and platform2 always seems a little slower to launch the jump. I'm not sure how to take Newton's laws:

    v * v = u * u + 2 * a * s

    = (v * v - u * u) / (2 * a)

    is distance traveled which, in this case, is jump height; so jump height = jump strength squared >divided by 2 x gravity

    ccording to Newton(edited)

    o, double the jump speed = you jump 4 times the height (due to velocity squared)

    and apply that to my platform+ settings to get the closest possible match I can. The reason I need it exact is for porting a couple of game engines already designed with previous platform settings, and also so I can finish writing a walljump group of events that accurately matches platform+ (which is tough to do by comparison without the rest of the speeds matched).

  • Zebbi,

    I've submitted a new version to the store for approval. v2.8 will register inputs during debug pause/step.

  • Colludium thanks so much, makes things a lot easier to test! Here's an example: dropbox.com/s/l4ticlv1aclhhgo/EXAMPLETEST.capx

    Needs platform+ ( dropbox.com/s/1km48l9kp8t3g9r/platform%2B.rar - put in behaviors folder)

    This has three different players that all jump when Space is pressed, Platform2 on the left, Platform+ in the middle, and platform built-in on the right. All three use different settings, and I have approximated two of three things:

    1. All three hit the same exact pixel height (Yes)

    2. All three hit the ground at the exact same time (Yes)

    3. All three match the same pixel positions when accelerating from launch and decelerating to fall (No.)

    It seems impossible to be able to make Platform2 match Platform+ or Platform built-in's curve of motion, I've tried every iteration I can come up with of Jump Strength, Gravity and Fall Speed. Is there any way, using the debugger and stepping through the entire jump motion, I can match every pixel perfectly between platform2 and platform+ or platform built-in? What is causing the difference, and could a launch/acceleration and fall descent option be added to allow for more precise fine tuning?

  • Zebbi,

    The differences you see are because the plugins use different calculations to determine y position when jumping.

    The standard plugin (and Platform Plus) both incorrectly approximate the new y position as if the velocity over the previous tick was constant - they assume that y distance traveled is equal to velocity multiplied by time; the error here is that velocity is not constant because of acceleration due to gravity. Newton's equations account for this and Platform2 uses one of them to correctly set the new y position. By not using the correct equations of motion, the standard plugin suffers from inconsistent jump behavior when delta-time varies (jump heights change if delta-time changes).

    Unfortunately that means that it is not possible for the Platform2 jumps to ever be the same as the standard plugin's - you can tweak jump velocity and gravity so that the jump height or jump time are similar, but you can't have them all the same - you are asking if there's a way to make the Platform2 jumps behave like the standard plugin's (non-quadratic movement) when really you should be asking scirra to fix the standard plugin so it uses correct calculations to determine jump position...

  • Zebbi,

    The differences you see are because the plugins use different calculations to determine y position when jumping.

    The standard plugin (and Platform Plus) both incorrectly approximate the new y position as if the velocity over the previous tick was constant - they assume that y distance traveled is equal to velocity multiplied by time; the error here is that velocity is not constant because of acceleration due to gravity. Newton's equations account for this and Platform2 uses one of them to correctly set the new y position. By not using the correct equations of motion, the standard plugin suffers from inconsistent jump behavior when delta-time varies (jump heights change if delta-time changes).

    Unfortunately that means that it is not possible for the Platform2 jumps to ever be the same as the standard plugin's - you can tweak jump velocity and gravity so that the jump height or jump time are similar, but you can't have them all the same - you are asking if there's a way to make the Platform2 jumps behave like the standard plugin's (non-quadratic movement) when really you should be asking scirra to fix the standard plugin so it uses correct calculations to determine jump position...

    Thanks for the explanation, it's been driving me nuts trying to figure out where I was going wrong! Indeed both built-in and plus are nerve-wracking, I can barely ever match anything due the inconsistencies of the jump heights, fall speeds, etc. I used to do a similar thing with matching the awful built-in Clickteam platform movement to their far superior platform extension, and even though the built-in didn't have proper push-out (you could see in debug the character going into the ground, then placed on the floor surface!) the movements still matched, so I can't imagine why Scirra left it like this.

    As a compromise, I'll probably leave it with a matched jump height and fall time, that was at least nothing in the game will be compromised in terms of jump distances.

    Colludium Here's a wall-jump capx that uses Platform+ and Platform2: dropbox.com/s/6bn837q29lklnzj/walljumpplatformplus.capx - I've tried to match the walljump from Platform+ as best as I can, but with the difference in gravity, the only similarities I can match almost perfectly is the jump out distance and the point in which they return to the wall. Hopefully, someone better skilled can look at these events and improve them, as they might serve as a solid basis for any Platform2 games that require wall jump. If something like this was built into Platform2 it would be a lifesaver, is there any consideration for adding a wall-jump like this to the engine? I'm sure with code it could be a lot more reliable, certainly than my own events ;)

  • Zebbi,

    I'll take a look and let you know if it's possible or not.

  • Zebbi,

    I'll take a look and let you know if it's possible or not.

    Wonderful, I'd really appreciate that! I̶'̶m̶ ̶t̶h̶i̶n̶k̶i̶n̶g̶ ̶t̶h̶a̶t̶ ̶m̶y̶ ̶m̶e̶t̶h̶o̶d̶ ̶o̶f̶ ̶c̶h̶a̶n̶g̶i̶n̶g̶ ̶t̶h̶e̶ ̶f̶a̶l̶l̶ ̶s̶p̶e̶e̶d̶ ̶m̶i̶g̶h̶t̶ ̶n̶o̶t̶ ̶b̶e̶ ̶t̶h̶e̶ ̶b̶e̶s̶t̶,̶ ̶p̶e̶r̶h̶a̶p̶s̶ ̶u̶s̶i̶n̶g̶ ̶w̶a̶l̶l̶ ̶c̶l̶i̶n̶g̶ ̶a̶n̶d̶ ̶m̶a̶n̶u̶a̶l̶l̶y̶ ̶s̶e̶t̶t̶i̶n̶g̶ ̶t̶h̶e̶ ̶y̶-̶v̶e̶l̶o̶c̶i̶t̶y̶ ̶m̶i̶g̶h̶t̶ ̶b̶e̶ ̶b̶e̶t̶t̶e̶r̶.̶ ̶P̶r̶o̶b̶a̶b̶l̶y̶ ̶w̶h̶y̶ ̶a̶ ̶c̶o̶d̶e̶d̶ ̶m̶e̶t̶h̶o̶d̶ ̶w̶o̶u̶l̶d̶ ̶b̶e̶ ̶f̶a̶r̶ ̶s̶u̶p̶e̶r̶i̶o̶r̶!̶ 😄 EDIT: I couldn't get wall cling to work :p

  • Zebbi,

    That wall jump mechanic you have is excellent and I couldn't really improve on it.

    I'm not sure what you were trying to do for wall-hang and move, but you need to set Solid2 to Type: "Wall hang" in the properties window. Wall hang then happens on wall collision if a control input is selected to move towards the wall.

    Regarding improving the wall hang - are you asking for a wall-slide velocity option (so the player can slide down the wall) and/or for the x velocity to be set away from the wall with a wall jump?

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