Formula to get the predicted Y-Axis from the Platform Jump?

0 favourites
  • 4 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • Hello, Does anyone know how to get the predicted Y-Axis gain from the Platform Behavior Jump?

    I'll make it a math problem to make it tidy.

    Given (On Jump):

    InitalY = 0

    FinalY = ?

    MaxSpeed = 660

    Acceleration = 1500

    Deceleration = 1500

    Jump Strength = 650

    Gravity = 1500

    Max Fall Speed = 1000

    Jump Sustain = 0

    I'm trying to find the Final Y-Axis. So guys can you give me the formula for this?

    Another thing, do both gravity and deceleration affect jump? or only gravity?

    Thanks.

    I'll just insert some great people here for faster result:

    glerikud

    R0J0hound

    zenox98

    Kyatric

    SoldjahBoy

    saiyadjin

    newt

    rexrainbow

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well we discussed it a little while ago in this topic :

    turns out while C2 current formula (which will change and will solve the issue) isn't as accurate (it gives a slitghly higher and longer jump), you can use this to find a good ballpark value (later it will be almost perfect)

    in your case

    Jump Strength = 650

    Gravity = 1500

    so final Y = -H = -(JumpStrength^2)/(2*Gravity) = -140,8333...

    Just tested it, gives around -143.54 with the current behavior, -140.90 with the "corrected one"

    Also acceleration and deceleration only affect the X axis, JumpStrength, jump sustain and gravity affect the Y axis

    I nevered bothered to calculate with jump sustain though...

  • Well we discussed it a little while ago in this topic : viewtopic.php?f=146&t=180450

    turns out while C2 current formula (which will change and will solve the issue) isn't as accurate (it gives a slitghly higher and longer jump), you can use this viewtopic.php?f=146&t=128434&p=905081#p905081 to find a good ballpark value (later it will be almost perfect)

    I saw that topic. I thought it was referring to the Platform Behavior's Frame-rate Independence. I didn't know it was more than that.

    It's okay it doesn't matter to me even if the accuracy is off by +-25.

    > JumpStrength = T*Gravity
    JumpStrength = sqrt(2*H*Gravity)
    JumpStregth = 2*H/T
    
    Gravity = JumpStrength/T
    Gravity = (JumpStrength^2)/(2*H)
    Gravity = 2*H/(T^2)
    
    T = JumpStrength/Gravity
    T = 2*H/JumpStrength
    T = sqrt(2*H/Gravity)
    
    H = (JumpStrength^2)/(2*Gravity)
    H = JumpStregth*T/2
    H = Gravity*(T^2)/2
    [/code:2w7ew3ir]
    
    

    Wow these formulas were the ones I was looking for. Thank you very much! You were a big help.

  • I saw that topic. I thought it was referring to the Platform Behavior's Frame-rate Independence. I didn't know it was more than that.

    It was a topic about pixel perfect jumping no matter the framerate but it turned into a topic about maths not being correct in C2.

    Wow these formulas were the ones I was looking for. Thank you very much! You were a big help.

    Glad those could help someone ^-^.

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