Everyone knows there are random elements in the SF2 engine, including the amount of damage and stun done by most attacks. But what kind of randomness, exactly? Here are the general rules:
attack type | random dizzy | random damage | lifebar scaling* |
---|---|---|---|
non-throws | yes | yes | yes |
normal throws | yes | no | yes |
multi-hit throws | yes* | no | yes |
command throws | yes | depends* | yes |
- I didn't examine lifebar scaling in depth, but a little testing can confirm T.Akiba's findings. Just set the opponent's life to 30 and see the difference.
- Some holds like Blanka's and Balrog's always do no dizzy.
- Throws do fixed damage except the following:
- Gief's SPD (SSF2 and SSF2T versions only)
- Gief's close 360+K, 2nd hit
- Gief's far 360+K
- Gief's super, 3rd hit
- Hawk's super, 2nd hit
- Vega's super, 3rd hit
- Honda's oicho, both hits
Now for the details. To reveal the exact damage and dizzy formula for all attacks and help compile more accurate attack data, I developed the following breakpoints for use in the MAME debugger:
breakpoints | helper Lua script |
---|---|
(local copy) | (local copy) |
You run MAME with the -debug
switch on, then copypaste each of the bp
lines for your game into the console. Then anytime either player gets attacked, the damage and stun info is displayed there. Since the FBA/MAME-rr Lua implementation doesn't support breakpoints, there's no pure-Lua way to get the formulas. What the helper script does is it prints out damage/stun/timeout dealt whenever someone gets hurt. You can use it to more easily verify that the formulas jive with the real figures.
(There's supposed to be a way to enter multiple commands at once, but it doesn't work. Also, these will only work on the current parent ROMs, not clones. However, every ROM address is given relative to the breakpoint address, the pc
, so getting these to work with a clone should only require offsetting the bp
by a constant value.)
How random damage works: there's a base damage for every hit, then a random value is added. The random values are looked up from a table of 32 possibilities, with the actual one selected determined by the output of a pseudorandom number generator. The sum is then scaled down by a certain factor and rounded up to produce the final damage.
The lookup table is dependent on the attack, and all the relevant random number tables are included in the bp file. The scale factor, however, is dependent on the opponent: it's a defense rating.
Recent Comments