Part of the direction I want to go with in #24 is to make the jump use this new movement actions mechanism. Currently the jump parameters are part of TnuaPlatformerConfig, but if the jump action itself is not privileged it doesn't seem right to privilege its configuration, so maybe they should be moved to the action command itself? Currently, jumping is done by:
controls.jump = Some(1.0);
Where the value passed to Some is multiplied by full_jump_height (so Some(1.0) is a full jump). I can do the same with the jump action and have it look at the configuration, but why not instead just remove full_jump_height and pass the actual height to the action (without needing to multiply by anything)? That way, the configuration won't have to "know" about jumping (just like it doesn't know about the other specific actions)
If I do this, maybe I should also remove full_speed from the configuration and just pass the actual speed to controls.desired_velocity?
I'm also thinking about moving some other parameters away from the configuration:
jump_input_buffer_time, coyote_time, and held_jump_cooldown will be part of the actions API (maybe with some renaming). Or should they? Maybe I should just use the same buffer time and coyote time for all actions?
upslope_jump_extra_gravity, jump_takeoff_extra_gravity, jump_takeoff_above_velocity, jump_shorten_extra_gravity, jump_peak_prevention_at_upward_velocity and jump_peak_prevention_extra_gravity are parameters for configuring the jump. I'm not sure I want to put so many parameters into the jump action though...
jump_fall_extra_gravity and free_fall_behavior seem jump related but can also affect a free fall, so I'm still going to need them inside the jump.
Actually, the LikeJumpShorten setting for free_fall_behavior requires jump_shorten_extra_gravity to be in the configuration as well. Maybe I should decouple them?
My gut tells me to move only full_jump_height and full_speed out of the configuration, but that was something I lowkey wanted to do even before I started designing the movement actions mechanism, so I'm not sure...
Part of the direction I want to go with in #24 is to make the jump use this new movement actions mechanism. Currently the jump parameters are part of
TnuaPlatformerConfig
, but if the jump action itself is not privileged it doesn't seem right to privilege its configuration, so maybe they should be moved to the action command itself? Currently, jumping is done by:Where the value passed to
Some
is multiplied byfull_jump_height
(soSome(1.0)
is a full jump). I can do the same with the jump action and have it look at the configuration, but why not instead just removefull_jump_height
and pass the actual height to the action (without needing to multiply by anything)? That way, the configuration won't have to "know" about jumping (just like it doesn't know about the other specific actions)If I do this, maybe I should also remove
full_speed
from the configuration and just pass the actual speed tocontrols.desired_velocity
?I'm also thinking about moving some other parameters away from the configuration:
jump_input_buffer_time
,coyote_time
, andheld_jump_cooldown
will be part of the actions API (maybe with some renaming). Or should they? Maybe I should just use the same buffer time and coyote time for all actions?upslope_jump_extra_gravity
,jump_takeoff_extra_gravity
,jump_takeoff_above_velocity
,jump_shorten_extra_gravity
,jump_peak_prevention_at_upward_velocity
andjump_peak_prevention_extra_gravity
are parameters for configuring the jump. I'm not sure I want to put so many parameters into the jump action though...jump_fall_extra_gravity
andfree_fall_behavior
seem jump related but can also affect a free fall, so I'm still going to need them inside the jump.LikeJumpShorten
setting forfree_fall_behavior
requiresjump_shorten_extra_gravity
to be in the configuration as well. Maybe I should decouple them?My gut tells me to move only
full_jump_height
andfull_speed
out of the configuration, but that was something I lowkey wanted to do even before I started designing the movement actions mechanism, so I'm not sure...