brief description of how teching works in ssbm
0
ssbm-tech.md edited
37 lines 1.3 kB view raw view code

SSBM tech: the code#

Teching in SSBM depends on two values: timer_LR and since_rapid_lr.

How do these values behave?#

Both values initialise at -1 at game start.

timer_LR:

  • sets to 0 on any digital trigger press.
  • increments every frame unless it is equal to -1.
  • naturally overflows from 127 to -128 when incrementing.

since_rapid_lr:

  • records the exact value of timer_LR at the last digital trigger press.
  • does not increment, is not a timer.

What this means for logic#

On the frame a trigger press is recorded:

  • since_rapid_lr is set to the value of timer_LR.
  • timer_LR is then set to 0.

When can I tech?#

A tech happens if and only if: the player is in hitstun or tumble (aka any variant of the DamageFly or DamageFall states) && 0 <= timer_LR < 20 && (since_rapid_lr < 0 || 40 <= since_rapid_lr)

What is the tech window, and what is a lockout?#

tech windows and lockouts are purely conceptual:

the tech window corresponds to the period of time where timer_LR is counting up from 0 to 20 and since_rapid_lr is not between 0 and 40.

the tech lockout is simply whenever both timer_LR and since_rapid_lr are between 0 and 40, as another trigger input will keep this state going with timer_LR reset to 0.