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

Get help using Construct 2

Post » 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
@saiyadjin
@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
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » 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)

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

Post » 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*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




Wow these formulas were the ones I was looking for. Thank you very much! You were a big help. :D
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
65
S
21
G
90
Posts: 1,124
Reputation: 59,862

Post » 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. :D


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


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests