I wanted to post this from an old bookmark I had, back when I was at one time interested in attempting to make a character. But I didn't know anything about hitboxes, or how they operated in mugen. And the docs didn't give me that much to work with. Same for KFM. Granted, hitboxes for both mugen and arcade fighting games differ, they do have similarities. But for someone like myself, I couldn't outright understand hitboxes in mugen, without figuring out how they work in arcade versions of those games first.
So, I'll just go ahead and copy & paste what was put in the link I found, since it is not all the time available to view, due to the server not being available all the time. I'll add spoiler tags, to make sure it stays orderly. Despite one of the goals of mugen as a whole, is to have freedom of doing what you like, for someone that has little understanding of the complexity of characters, and their creation, without first understanding their counterparts in the real games, then it helps.
I will say this: There are a good handful of creators who do their own thing with character creation, so this mostly won't apply for those who are seasoned in doing so. But this is geared towards those who want to get started doing something a little closer to home, in understanding some of the terms used, and see why some things react the way they do in arcade versions. It would hopefully give some kind of insight, for future releases by up and coming creators.
1. Introduction
Although the sprites on screen seem to interact directly with one another, 2D fighting games and other action games usually use unseen hitboxes to determine whether attacks connect or miss. These boxes can be made visible in MAME-rr (http://code.google.com/p/mame-rr/downloads/list) and FBA-rr (http://code.google.com/p/fbarr/) through the use of Lua scripting (http://code.google.com/p/mame-rr/wiki/LuaScriptingFunctions). This information can help players improve their game and help people who don't play the games to appreciate how they work.
Also see combovid (http://combovid.com/?category_name=technical) for in-depth discussions.
2. Common box types
Some game engines have specialized kinds of boxes, but here are the types that are found in most games.
(http://i49.tinypic.com/2nrfzax.jpg)
Vulnerability and Attack
The attack box must touch the opponent's vulnerability for the attack to connect. Characters may have one or several vulnerability boxes for different areas of the sprite, but most fighting games only allow attacks to have one attack box at a time.
3. Projectile Vulnerability and Attack
If an opposing projectile's attack touches a projectile vulnerability box, the projectiles negate one another. In some games, projectiles don't have designated vulnerability areas and negate by touching attack boxes.
4. Push
A pushbox cannot occupy the same space as another pushbox. Attempting to press them together will cause characters to push one another. Jumping attacks that extend below and behind the pushbox allow for easier crossup attacks. Some moves cause pushboxes to disappear, allowing the character to pass through the opponent. In primitive games like Fatal Fury 1 & 2, vulnerability boxes also perform the function of pushboxes.
5. Throw and Throwable
A throwbox must touch the opponent's throwable box for the throw attempt to succeed. Throws are generally active for only one frame. Some games don't have designated throwable boxes and reuse the pushbox for this purpose.
6. Usage
These scripts work with either parent and clone ROMs. Download the script file, load the appropriate ROM, launch a Lua window (ctrl-L by default), then browse for and run the .lua file. The ROM must be up to date for MAME-rr or FBA-rr, and may be out of date with respect to mainline MAME (http://mamedev.org/).
The current versions can be downloaded from the SVN repository (http://mame-rr.googlecode.com/svn/lua/). Changes are trackable on the update page (http://code.google.com/p/mame-rr/updates/list) or by subscribing to the update feed.
The behavior can be modified by pressing Lua hotkeys. (The key bindings are assigned in the emulator settings.)
Hide or reveal all the graphics on the screen to show only the boxes. Default off.
Hide or reveal axis markers for characters and other objects. Default on.
Hide or reveal the centers of individual boxes. Default off.
Hide or reveal pushboxes. Default on.
Hide or reveal throwability boxes. Default off.
The best way to get images is with the emulator's screenshot function (F12 by default).
7. MAME-rr vs. FBA-rr
Both emulators can show boxes, but they differ in usability and accuracy.
MAME-rr advantages:
doesn't crash so much on loading savestates or loading new ROMs
doesn't demand so much CPU when displaying partially transparent boxes
more powerful cheat engine means a more reliable background removal procedure
no frame sync problems for CPS2 games
can use debugger breakpoints for games on any system, but this requires extra effort in coding and usage
FBA-rr advantages:
much better performance for CPS3 games
built-in Lua breakpoints for NeoGeo, CPS1 and CPS2 systems
This means only FBA can properly show throwboxes for the sf2 and cps2 scripts, and is required for the garou script.
8. Background removal
The game backgrounds can make the boxes harder to see. This can be offset by increasing the fill opacity of the boxes, but this in turn makes the character sprites harder to see. The ideal solution is to remove the backgrounds entirely. One way to do this is with "cheat" codes that prevent the background and HUD from being displayed by the game.
(http://i47.tinypic.com/345lcep.jpg)(http://i45.tinypic.com/25g44nc.jpg)
Here is how to get the codes working in MAME:
Download the latest official cheat pack.
Extract cheat.zip from the downloaded archive to the base MAME folder.
Run the ROM in MAME, find Cheats from the main menu, and set the code to On.
Other information:
The codes for some games need to be activated before the start of the match to remove the HUD.
The codes are designed to only affect the game while a match is in progress.
The effects of some codes are not fully reversible.
Most of the codes patch ROM data and will only work with parent sets, not clones.
The background color for NeoGeo games can be adjusted by editing the color value in the codes.
It possible to convert codes for some, not all, games to work in FBA.
(http://i49.tinypic.com/142tpht.jpg)
Screenshots or videos captured with the backgrounds removed can easily be processed to make the background color transparent. In order for this to work with hitboxes, the fill opacity must be set to zero and the border opacity should be maximum. A shortcut to do this is to set no_alpha in the globals at the top of the script to true.
local globals = {
axis_color = 0xFFFFFFFF,
blank_color = 0xFFFFFFFF,
axis_size = 12,
mini_axis_size = 2,
blank_screen = false,
draw_axis = true,
draw_mini_axis = false,
draw_pushboxes = true,
draw_throwable_boxes = false,
no_alpha = true, --fill = 0x00, outline = 0xFF for all box types
}
9. Color customization
Colors can be changed by editing the box values at the top of the script.
["vulnerability"] = {color = 0x7777FF, fill = 0x40, outline = 0xFF},
["attack"] = {color = 0xFF0000, fill = 0x40, outline = 0xFF},
["proj. vulnerability"] = {color = 0x00FFFF, fill = 0x40, outline = 0xFF},
["proj. attack"] = {color = 0xFF66FF, fill = 0x40, outline = 0xFF},
["push"] = {color = 0x00FF00, fill = 0x20, outline = 0xFF},
["throw"] = {color = 0xFFFF00, fill = 0x40, outline = 0xFF},
["throwable"] = {color = 0xF0F0F0, fill = 0x20, outline = 0xFF},
The color numbers are RGB values (http://www.w3schools.com/html/html_colors.asp), and the fill and outline determine the opacity of the inside and outside of the box. 0xFF is fully opaque and 0x00 is invisible.
The default colors are subject to change in future versions.
Supported games
sf2-hitboxes.lua
All of the Street Fighter II games.
Parent ROM Game
sf2 Street Fighter II: The World Warrior
sf2ce Street Fighter II': Champion Edition
sf2hf Street Fighter II': Hyper Fighting
ssf2 Super Street Fighter II: The New Challengers
ssf2t Super Street Fighter II Turbo
hsf2 Hyper Street Fighter 2: The Anniversary Edition
(http://i47.tinypic.com/348nc3m.jpg)(http://i47.tinypic.com/34jd2qu.jpg)
(http://i50.tinypic.com/racmqb.jpg)(http://i45.tinypic.com/2w5it12.jpg)
(http://i46.tinypic.com/29o3eok.jpg)(http://i48.tinypic.com/1zpnw90.jpg)
SF2 Notes
(http://i46.tinypic.com/2vb24bd.jpg)
weak box
Attacks that hit a weakbox deal double damage. Weak boxes only appear in Street Fighter II: World Warrior and in WW mode of Hyper Street Fighter 2. They are colored the same as throwboxes by default.
air throwable box
This box is susceptible to air throws but not ground throws. The opposite is true for the normal throwable box.
marvel-hitboxes.lua
All of the Marvel/Versus games on the CPS-2 system.
Parent ROM Game
xmcota X-Men: Children of the Atom
msh Marvel Super Heroes
xmvsf X-Men Vs. Street Fighter
mshvsf Marvel Super Heroes Vs. Street Fighter
mvsc Marvel Vs. Capcom: Clash of Super Heroes
(http://i47.tinypic.com/20u3n1h.jpg)(http://i46.tinypic.com/1zlgftj.jpg)
(http://i47.tinypic.com/b3swvc.jpg)(http://i45.tinypic.com/2dr6vkn.jpg)
(http://i49.tinypic.com/34sovfp.jpg)
Marvel Notes
FBA is needed to show the exact frames when throws are active and when pushboxes are inactive. In MAME, only the potential throw range is viewable, and pushboxes tend to flicker or not disappear when inactive. However, boxes sometimes update a frame early or late in FBA.
(http://i50.tinypic.com/xngkjm.jpg)
potential throw box
It's possible to show where the box would appear if a throw were attempted. This box type is fully transparent (invisible) by default and can be shown by increasing its opacity value. This is unnecessary since FBA can show the real throw attempts.
cps2-hitboxes.lua
All of the remaining CPS-2 fighting games, including the Street Fighter Alpha and Darkstalkers series.
Parent ROM Game
sfa Street Fighter Alpha: Warriors' Dreams
sfa2 Street Fighter Alpha 2
sfz2al Street Fighter Zero 2 Alpha
sfa3 Street Fighter Alpha 3
dstlk Darkstalkers: The Night Warriors
nwarr Night Warriors: Darkstalkers' Revenge
vsav Vampire Savior: The Lord of Vampire
vhunt2 Vampire Hunter 2: Darkstalkers Revenge
vsav2 Vampire Savior 2: The Lord of Vampire
ringdest Ring of Destruction: Slammasters II
cybots Cyberbots: Fullmetal Madness
sgemf Super Gem Fighter Mini Mix
(http://i50.tinypic.com/bgahw1.jpg)(http://i46.tinypic.com/2rpb81d.jpg)
(http://i48.tinypic.com/34zm5gi.jpg)(http://i47.tinypic.com/2empki0.jpg)
(http://i46.tinypic.com/f5myq.jpg)(http://i47.tinypic.com/scwa5w.jpg)
(http://i48.tinypic.com/ogxqud.jpg)(http://i47.tinypic.com/xarptd.jpg)
(http://i46.tinypic.com/29djjk.jpg)(http://i48.tinypic.com/fn8itd.jpg)
(http://i48.tinypic.com/f10hi0.jpg)(http://i45.tinypic.com/2vn0yuu.jpg)
CPS2 Notes
FBA is required to show all throws in: sfa, sfa2, sfz2al, vsav, vhunt2, vsav2, cybots, and sgemf. It is also needed in dstlk and nwarr to show air throws and to make ground throws be attempted at long range. However, boxes sometimes update a frame early or late in FBA.
(http://i49.tinypic.com/29gealx.jpg)
axis throw box
Air throws in sfa, sfa2 & sfz2al, and special ranged throws in nwarr grab at the opponent's axis instead of a box.
beatemup-hitboxes.lua
Selected beat-em-up games on the CPS-2 system.
Parent ROM Game
ffight Final Fight
dino Cadillacs and Dinosaurs
punisher The Punisher
avsp Alien vs. Predator
ddtod Dungeons & Dragons: Tower of Doom
ddsom Dungeons & Dragons: Shadow over Mystara
batcir Battle Circuit
(http://i45.tinypic.com/4h9iqt.jpg)(http://i45.tinypic.com/cqa9v.jpg)
(http://i47.tinypic.com/2whgj7k.jpg)(http://i45.tinypic.com/2uqnfux.jpg)
(http://i47.tinypic.com/520rw2.jpg)(http://i48.tinypic.com/5xrgvo.jpg)
(http://i50.tinypic.com/rj0gon.jpg)
Beat'em Up Notes
Non-character objects are colored as projectiles. Pushboxes are not used.
kof-hitboxes.lua
Most of the King of Fighters games on the NeoGeo MVS system.
Parent ROM Game
kof94 The King of Fighters '94
kof95 The King of Fighters '95
kof96 The King of Fighters '96
kof97 The King of Fighters '97
kof98 The King of Fighters '98 - The Slugfest
kof99 The King of Fighters '99 - Millennium Battle
kof2000 The King of Fighters 2000
kof2001 The King of Fighters 2001
kof2002 The King of Fighters 2002
(http://i49.tinypic.com/34y91yb.jpg)(http://i50.tinypic.com/2eqgso0.jpg)
(http://i49.tinypic.com/30sbwn6.jpg)(http://i47.tinypic.com/2myvl2c.jpg)
(http://i47.tinypic.com/ea17xv.jpg)(http://i46.tinypic.com/z2uci.jpg)
(http://i46.tinypic.com/2hh3sl0.jpg)(http://i49.tinypic.com/ixcppv.jpg)
(http://i48.tinypic.com/ng7bbd.jpg)
KOF Notes
All throwboxes in NeoGeo games show up one frame late. Not enough frames pass between the box computations and the graphics update to correct this.
FBA is needed to show throwboxes in kof94 and kof95. The the only axis throw boxes for this script are the special throws in those two games.
(http://i45.tinypic.com/2wnpljo.jpg)
guard box
Attacks that hit a guardbox will be blocked, either by manually blocking, by an autoguard move, or by a special counter move.
garou-hitboxes.lua
The Garou Densetsu/Fatal Fury NeoGeo series.
Parent ROM Game
fatfury1 Fatal Fury - King of Fighters
fatfury2 Fatal Fury 2
fatfursp Fatal Fury Special
fatfury3 Fatal Fury 3 - Road to the Final Victory
rbff1 Real Bout Fatal Fury
rbffspec Real Bout Fatal Fury Special
rbff2 Real Bout Fatal Fury 2 - The Newcomers
garou Garou - Mark of the Wolves
(http://i49.tinypic.com/1zpmzhv.jpg)(http://i50.tinypic.com/wgrxab.jpg)
(http://i50.tinypic.com/28vwsxi.jpg)(http://i48.tinypic.com/dptk5l.jpg)
(http://i49.tinypic.com/2nq7dhx.jpg)(http://i48.tinypic.com/ivll36.jpg)
(http://i50.tinypic.com/2lm0uwo.jpg)(http://i45.tinypic.com/35i6nwp.jpg)
Garou Notes
This script mostly doesn't work MAME due to extensive use of breakpoints. FBA is required.
The backgrounds can be removed using the script itself by setting no_background in the globals section to true. This must be done before the match start to work.
(http://i50.tinypic.com/xm263r.jpg)
There are no throwability or projectile vulnerability boxes.
cps3-hitboxes.lua
The CPS3 games, excluding the Jojo titles.
Parent ROM Game
redearth Red Earth
sfiii Street Fighter III: New Generation
sfiii2 Street Fighter III 2nd Impact: Giant Attack
sfiii3 Street Fighter III 3rd Strike: Fight for the Future
(http://i50.tinypic.com/2zxt7r6.jpg)(http://i49.tinypic.com/67sef4.jpg)
CPS3 Notes
This script was originally translated to Lua from the mameserver (http://code.google.com/p/mameserver/) project. The 3rd Strike code was also helped by the work of crystal cube (http://ameblo.jp/3fv/).
For now, the only way to show normal throwboxes in redearth/warzard is with the MAME-rr debugger. Run MAME from the command line with the -debug switch:
> mame redearth -debug -lua cps3-hitboxes.lua
Or to avoid using the command line, edit mame-rr.ini so that debug is 1:
#
# CORE DEBUGGING OPTIONS
#
log 0
verbose 0
update_in_pause 0
debug 1
debugscript
The debugger starts by halting execution of the game and the UI. Press F5 to release control. The script will print the BPs to the Lua console:
(http://i47.tinypic.com/2zf4jl1.jpg)
Copy and paste the line over to the debugger console and hit enter. Now all supported box types will appear correctly.
(http://i47.tinypic.com/2iktsoy.jpg)
The game may glitch up when the command is entered but this only happens once. Before quitting or unloading the ROM, enter bpc into the debugger console to clear any installed breaks, or else MAME will crash.
Hopefully this will be informative to those who want to compare, and actually test it out, instead of second guessing how things go overall between the arcade counterparts, and mugen's own system. Big thanks & credit to Dammi over at the mame-rr homepage, for taking time out to give this kind of info out.