So, i watched a tutorial (this one : https://www.youtube.com/watch?v=v3zT3Z5apaM), for learninghow to make a bunny hopping mechanic for my fats fps game.
I pass some time trying to replicate his code in Godot, but it turned out to be unsuccessful.
Some i'm asking for help here, because i'm really struggling about how to set up this mechanic
For now, i have a movement script, with acceleration/decceleration/air control taken into account, as well as a function that get the wishDirection value every time a direction key is pressed :
func move(delta):
var input_dir = Input.get_vector("left", "right", "frontward", "backward")
var direction = (cameraHolder.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
calculateWishDirection(direction)
if is_on_floor():
if direction:
velocity.x = lerp(velocity.x, direction.x * moveSpeed, moveAcceleration * delta)
velocity.z = lerp(velocity.z, direction.z * moveSpeed, moveAcceleration * delta)
else:
velocity.x = lerp(velocity.x, direction.x * moveSpeed, moveDecceleration * delta)
velocity.z = lerp(velocity.z, direction.z * moveSpeed, moveDecceleration * delta)
else:
if direction:
velocity.x = lerp(velocity.x, direction.x * moveSpeed, airControlForce * delta)
velocity.z = lerp(velocity.z, direction.z * moveSpeed, airControlForce * delta)
else:
velocity.x = lerp(velocity.x, direction.x * moveSpeed, inAirMoveDecceleration * delta)
velocity.z = lerp(velocity.z, direction.z * moveSpeed, inAirMoveDecceleration * delta)
func calculateWishDirection(direction):
wishDirection = direction
Explanation of how the player movement code in Quake gives rise to these three different player movement "bugs", with a quick look at TAS movement mechanics at the end.
Big thanks to the Quake Speedrunning Discord for helping me out with getting TASQuake running on my machine, and for clarifying terminology.
Here are the original C versions of...