Troubleshooting a Simulation: Acceleration & Velocity Lost in a Jump

AI Thread Summary
The discussion focuses on troubleshooting a simulation involving player acceleration and velocity during jumps. To model acceleration, a formula is needed that incorporates frames until full speed, maximum speed, and the number of frames the player has been running. The goal is to ensure the player accelerates to full speed rather than starting at it immediately, which is crucial for realistic movement, especially for jumping. For estimating velocity loss during a jump, a method is proposed to divide the x, y, and z components of velocity by a specific number, with suggestions for calculating the new velocities based on jump angles and gravity effects. Overall, the conversation emphasizes the need for cartoon physics to exaggerate certain values for a more engaging simulation experience.
cubby208
Messages
6
Reaction score
0
Hello! I have been trying to make a simulation and it doesn't quite work right, don't exactly know why. I have two questions!

1. Acceleration
I have been trying

I need a formula that uses.
frames till full speed (f) (if framerate is 60fps and this value is 60 then player is at full speed after 1 second this is probably in essence really drag )
Full speed (s) (stores the maximum speed in distance per second)
Frames (t) (stores how many frames the player has been trying to run for)

If their are more variables that are needed feel free to use them.

And comes out with
Actually speed (as) (which is the speed the player should move considering acceleration this value will get added to player position each frame)

I suppose I am really trying to model acceleration which is like

a = (velocity change)/(time) however doing that doesn't seem to get the right effect.

My goal is that when the player moves it is not full speed from the start, instead it accelerates up to full speed. This is so if you want to for example jump across a long distance you need to get a running start.2. Velocity lost in a jump
So when a human jumps about how much x, y, and z is lost (I realize it is impossible to find an exact number... I just need an estimate for a simulation). Basically when the player jumps I am going to divide x y and z velocity by a number, but I don't know which one.

I suppose in both of these situations I am really asking for cartoon physics so I might be necessary to exaggerate some values.
 
Physics news on Phys.org
Speed is Acceleration*Time if acceleration is constant. However, your acceleration might not be constant. If you want to use this, then your acceleration should be
A= (s)/(f) for 0<(t)<(f), A = 0 when (t) >=(f)
(as) = A*(t) for 0<(t)<(f), (as) =(s) when (t) >=(f).
If the person is accelerating from a medium speed (ps), then I would reset the relative time to (t) = (ps)/A.

For the second part, one simple way would be to transfer the speed directly into the jump.
if you start with [x,y,0] and jump angle is b, then the speeds after the jump would be [xcosb,ycosb, sqrt(x^2+y^2)sinb], with the z component needing to lose speed due to gravity.
 
To simulate system behaviour by forces law and initial conditions only, just take a look.
 
I have recently been really interested in the derivation of Hamiltons Principle. On my research I found that with the term ##m \cdot \frac{d}{dt} (\frac{dr}{dt} \cdot \delta r) = 0## (1) one may derivate ##\delta \int (T - V) dt = 0## (2). The derivation itself I understood quiet good, but what I don't understand is where the equation (1) came from, because in my research it was just given and not derived from anywhere. Does anybody know where (1) comes from or why from it the...
Back
Top