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

Get help using Construct 2

### » Sat Aug 27, 2016 11:08 am

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
@BackendFreak
@newt
@rexrainbow
Last edited by chadorireborn on Sat Aug 27, 2016 8:01 pm, edited 1 time in total.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
78
S
27
G
93
Posts: 1,152
Reputation: 62,415

### » Sat Aug 27, 2016 3:03 pm

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)

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...
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
23
G
18
Posts: 2,123
Reputation: 17,200

### » Sun Aug 28, 2016 3:37 pm

Aphrodite wrote: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.

Aphrodite wrote:
Code: Select all
`JumpStrength = T*GravityJumpStrength = sqrt(2*H*Gravity)JumpStregth = 2*H/TGravity = JumpStrength/TGravity = (JumpStrength^2)/(2*H)Gravity = 2*H/(T^2)T = JumpStrength/GravityT = 2*H/JumpStrengthT = sqrt(2*H/Gravity)H = (JumpStrength^2)/(2*Gravity)H = JumpStregth*T/2H = Gravity*(T^2)/2`

Wow these formulas were the ones I was looking for. Thank you very much! You were a big help.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
78
S
27
G
93
Posts: 1,152
Reputation: 62,415

### » Sun Aug 28, 2016 4:12 pm

chadorireborn wrote: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.

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

Glad those could help someone ^-^.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
23
G
18
Posts: 2,123
Reputation: 17,200