Guest Article: Street Fighter II Hitboxes

Combining alchemy and modern technology, Dammit has somehow miraculously succeeded in unlocking the hidden hitboxes of several classic fighting games. He was kind enough to provide his custom display script with brief instructions on how to use it, in addition to a whole slew of fascinating example screenshots alongside detailed background explanations.

Here is a sample of Street Fighter II hitboxes, made with the MAME-rr emulator and Lua script that I developed based on work by mz and felineki.

A brief guide to seeing the hitboxes in action:

Download and set up either MAME-rr or FBA-rr. We recommend MAME because the boxes can cause slowdown in FBA, but it works fine in either.

Launch the emulator and start any one of the SF2 games: World Warrior, Champion Edition, Hyper Fighting, Super, Super Turbo or Hyper Street Fighter II. Both “parent” and “clone” sets work.

Open a Lua window. In MAME-rr this is done with Ctrl-L by default. In FBA, click Game, Lua Scripting, and New Lua Script Window. Click the Browse button in the window, select the Lua file, and click Run.

Now as you play the game, hitboxes are superimposed on the sprites. Blue is the area that can be hit by the opponent, and red is the area that can hit the opponent. The green boxes are the areas that can never overlap and will cause characters to push each other.

And now for some hitbox demonstrations:

Getting hit by different attacks causes different reel animations, and heavier attacks cause more exaggerated reeling. Some characters lean way back, others not so much.

There is a fourth box type peculiar to the CPS-1 games known as the weak box, colored yellow. Getting hit in the weak box causes you to take double damage, but only if an associated parameter has a certain value. The boxes are present in some form in the first three games but cause double damage only in World Warrior.

In this shot, we can see the weak box on Blanka’s ball attack and the animation frame of Ryu’s dizzy that leans farthest forward. (These boxes are absent in CE.) This makes WW Ken plainly better than WW Ryu, if there are no other differences. The tall skinny pushbox on the WW Blanka ball is what causes it to bounce off knocked down opponents. This property was not preserved in HSF2.

Each of the bosses in WW also has a weak box during their signature moves: Balrog’s Turn Punch startup, Vega’s Claw Dive, Sagat’s Tiger Uppercut recovery and Bison’s Psycho Crusher active frames.

Weak boxes, being confusing and worthless, were abolished in Super and ST, but brought back in HSF2 for the CPS-1 modes. A proper counterattack system wasn’t implemented in a Capcom game until SFA3.

Super Turbo-version T.Hawk has a famous stray hitbox on the recovery of his c.MP. You can easily punch him in the head without touching him. Furthermore, his Tomahawk Buster startup is less safe and his j.D+HP body splash is horribly downgraded from Super.

ST Dhalsim’s Yoga Blast has no collision box, so it can’t negate other projectiles, which would be limited to another upflame or Akuma’s air fireball anyway. It does, however, have a momentary attack box behind him, which makes it possible to hit someone jumping over you. His Yoga Inferno super, besides having a ridiculous number of invincibility frames, also leaves him headless for the duration. Since the hit area is huge and it can negate any non-super projectile without being negated itself, this makes it unreasonably hard to punish if whiffed.

Trying to hit the projectile limit in Rainbow Edition. In general, if an attack keeps the character stationary, the pushbox won’t budge, even if you lean way forward during the move. This is what allows attacks like the Hadouken to be used harmlessly at point blank. It’s possible to pack Sonic Booms more closely than this but you’d need a more complicated setup.

…and here it is. The limit is indeed eight. Doing more makes the character perform the move but nothing new comes out.

Juggling was first encountered by accident in Champion Edition. If CE Dhalsim is hit in a way that makes him go off the ground but land on his feet instead of his back, he is vulnerable during a particular animation frame of the fall. (This glitch was not preserved in HSF2.) In this shot, Guile landed an air-to-air j.MK and is about to juggle with an LK Flash Kick.

Attack boxes were gradually toned down over time. In the earlier games there was a tendency for extended limbs to have a huge red box but no vulnerability. While this is fun, it tends to favor mashing and spamming by making it harder to punish irresponsible attacks. The red boxes got smaller and the blue boxes got bigger as Capcom games evolved.

Blanka’s HP Electricity opposite Honda’s HP Hundred Hand Slap, in WW and ST. Incidentally, Hundred Hand Slap became steerable in Champion Edition and lost that ability in ST, in exchange for lunging forward.

Bison’s HP Psycho Crusher opposite Zangief’s KKK Lariat, in Hyper Fighting and Super Turbo. The CE version of the torpedo is even cheaper, with the hittable area only where the yellow box is. HF Zangief’s KKK Lariat spins three times quickly and is unhittable below the arms for the whole duration. It was changed in the later games to have midsection invulnerability, just like the PPP version but with two spins.

Ken’s MP Shoryuken opposite Blanka’s jumping roundhouse, in CE and ST. For most of the series, Ryu and Ken’s Dragon Punches are invincible on the way up, until after the last active frame. In ST they have head and body vulnerability, except the jab versions which are unhittable from the neck down, to avoid fireballs. Notice how Blanka’s shadow gets longer like his sprite in ST.

DeeJay’s LP Machine Gun Upper opposite Balrog’s LP Dash Straight, in Super and ST. MGU lost some upper body invulnerability and Dash Straights became crouchable in ST. (They were also crouchable in CE.) Not that you’d ever want to use the old versions of these characters.

P1 Akuma has no problem timing the Dragon Punch through P2 Akuma’s Zankuu Hadouken, while P2 Akuma shows off the Hurricane Kick that hits on the way up while invincible.

The hitbox code got more complicated the farther back I looked, with SF2 being the most convoluted. It uses pointers for both the animation frame data and the hitbox data. That means you won’t find either the box IDs or the box parameters in each character’s personal memory area. Instead you’ll find a pointer to the animation frame data, which contains the IDs, and a pointer to the character’s hitbox tables, which contain the box parameters. The ID tells you which box to look up from the tables. (A pointer is a value in memory that contains an address to some other value.)

The four box parameters are the horizontal and vertical offsets from the character position, and the horizontal and vertical size. Each uses only one signed byte, which limits them to ±128 pixels. This was a problem for Dhalsim’s long range attacks with their huge horizontal offsets. felineki figured out there was another byte that, if greater than 128 (unsigned), took precedence over the usual horizontal offset byte. The developers must have thought one byte would be enough and added this as an afterthought as Dhalsim’s design was fleshed out.

Except for using two bytes for box parameters, Hyper Street Fighter II’s hitbox code is mostly unchanged from the rest of the series despite being released in 2004. The CPS-2 games sometimes have an extra frame of delay between inputting a command and seeing the response on screen. This causes the boxes to update one frame too soon. This can be corrected by increasing the DRAW_DELAY value near the top of the script.

Many thanks to Dammit for doing all this work, and still providing additional text by request. Even if you’re already familiar with some of these concepts, it’s awesome seeing them represented graphically with such precision.

Has anyone ever tried to set up a block damage lockdown using Blanka’s Electricity by having the opponent jump over Blanka as he starts buzzing facing the wrong direction?

It doesn’t work. You’d think it would at least work in World Warrior, but nope, they get pushed away. Why? If the hitbox is uniform, then you’d think the sparks behind him would pull opponents toward him. But even if they get hit, they get knocked away.

What’s even stranger is that if Guile jumps behind Honda as he starts Hundred Hand Slap facing the other way, and he uses F+MK knee to reach into hands from behind, he gets pushed away too. We know for a fact that every one of those HHS active frames normally pushes away, because nobody’s gotten hit by hands and been pulled towards Honda.

So how does the game know to reverse pushback when you get behind Honda/Blanka/Chun Li?

this is cool stuff. i’ve always thought this stuff was awesome since i picked up MK Trilogy for PSX back in the day when it was brand new. in the cheat menu, it has an option for “hit boxes on” and i remember thinking it was so cool seeing how the game decides what hits and what doesnt, and why some attacks whiff when they look like they hit.

If I look at the SF4 engine I suppose every ‘entity’ gets a property that tells where it is hitting from. An entity can be an active hitbox or a fireball.

It’s easy to see that this works for fireballs:
If Rose does an FADC cancel on her fireball, then jumps over the opponent before the fireball hits, the opponent will get hit and be pulled towards Rose. The system remembered the direction, it doesnt care where the opponents are current time.
It gets even better with her ultra 2, once booted, the properties are set.

Now in your case, you would indeed suppose that properties of HHS or electricity are set at startup of the move, and thus the move should pull toward if it hits the opponent fromp the other side, but chances are the move itself is not a concrete entity, but every phase of the move is one.
Every new active hitbox created in the session (like 10 or so for electricity) gets the property of direction, depending on the current positioning, and is forgotten immediately when the next one is created. The only thing that remains fixed is player positioning until the whole session of hitbox entities is over.