brief description of how teching works in ssbm
0
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_lris set to the value oftimer_LR.timer_LRis 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 windowcorresponds to the period of time wheretimer_LRis counting up from 0 to 20 andsince_rapid_lris not between 0 and 40.the
tech lockoutis simply whenever bothtimer_LRandsince_rapid_lrare between 0 and 40, as another trigger input will keep this state going withtimer_LRreset to 0.