Week 50: Sticking the landing on super-slippery surfaces

An animated GIF of a recording from Squirrel Away showing the character sliding past the turning around and coming to a stop at the intended destination on a slippery ice surface..
The character now backtracks when overshooting the intended destination on a slippery surface.


tl;dr: I refactored how walking navigation is calculated, and I added better support for getting to the intended destination on slippery surfaces.


What happened last week?

Highlights

  • I refactored how walking navigation is calculated.
  • I added support for conditionally decelerating at the end of a walking navigation.
  • I added support for turning around and backtracking when overshooting the intended destination on a slippery surface.

Laundry list

  • Refactor IntraSurfaceCalculator:
    • Refactor stopping-distance calculations.
    • Add support for calculating stopping-distance with some initial backward deceleration.
    • Add support for pressing backwards on intra-surface edges, if the stopping distance would be too great with only forward-acceleration.
    • Update IntraSurfaceEdge to include stopping deceleration in the duration.
    • Update IntraSurfaceEdge to not be ended until after decelerating rather than immediately when releasing.
    • Update IntraSurfaceEdge to support pressing backward, against the direction of motion.
    • Add a check for whether there is enough time to decelerate to zero in an intra-surface edge.
    • Fix various issues relating to the recent intra-surface-edge refactor.
    • Fix an issue with intra-surface-edge trajectory positions being clamped such that movement can't move past the start point in the direction opposite the end point.
    • Clamp intra-surface-edge trajectory positions to the bounds of the surface, and discard any duplicate positions from this clamping.
    • Update intra-surface-edge and move-to-collinear-neighbor-surface-edge start velocities to match previous-edge end velocities.
    • Add an indicator for whether an intra-surface-edge should include deceleration at the end.
    • Fix duration and end-velocity calculations for intra-surface-edges when not including deceleration at end.
    • Fix issue with IntraSurfaceEdge.includes_deceleration_at_end not being set sometimes.
    • Start creating a new function for backtracking to the intended destination point when end-velocity would otherwise send the character past the destination.
    • Remove legacy logic for dynamically adjusting navigation at the end of a path in order to correct for discrete-interval-run-time-error and ensure the character isn't leaning too-far past the end of a surface.
    • Update calculate_duration_for_displacement to support starting with max-speed but decelerating.
    • Update calculate_velocity_for_displacement to support starting with max-speed but decelerating.
  • Miscellaneous:
    • Fix an issue with `is_dashing` checks causing errors when the character can't dash.
    • Fix a typo with run-time velocity updates using the wrong parameters for gravity.
    • Fix an issue with over-counting jumps, which prevented correct gravity and double-jumps from working.
    • Clean-up how wall-vs-left-wall/right-wall and surface-vs-floor/ceiling/wall state is maintained in CharacterSurfaceState.
    • Add new surface-state helper functions for checking whether we just transitioned to a neighbor surface.
    • Update sync_state_for_surface_grab to consider the previous state when updating just_(touched|grabbed)_(surface) state.
    • Update SurfaceNavigator logging to consider surface-state syncing verbose when the mismatch is only across the cusp between neighbor collinear surfaces.
    • Fix an issue with the animator flickering to face the wrong direction when crossing neighbor collinear surfaces.
    • Fix an issue with the cat-animator hip sprite rendering behind the torso sprite.

What's next?

  • Finish some remaining details for slippery surface navigation.
  • Fix the navigator's ability to always calculate a valid fall-from-air edge.
  • Fix some issues with Behaviors.


🎉 Cheers!


This is a simple icon representing my sabbatical.

Comments