|
Hitboxes
Instructions and index page for hitbox Lua scripts
IntroductionAlthough 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 and FBA-rr through the use of Lua scripting. 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 for in-depth discussions. Common box typesSome game engines have specialized kinds of boxes, but here are the types that are found in most games.
Vulnerability and AttackThe 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. Projectile Vulnerability and AttackIf 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. PushA 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. Throw and ThrowableA 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. UsageThese 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. The current versions can be downloaded from the SVN repository. Changes are trackable on the update page 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.)
The best way to get images is with the emulator's screenshot function (F12 by default). MAME-rr vs. FBA-rrBoth emulators can show boxes, but they differ in usability and accuracy. MAME-rr advantages:
FBA-rr advantages:
Background removalThe 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.
Here is how to get the codes working in MAME:
Other information:
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
}Color customizationColors 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, 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 gamessf2-hitboxes.luaAll of the Street Fighter II games.
Notes
weak boxAttacks 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 boxThis box is susceptible to air throws but not ground throws. The opposite is true for the normal throwable box. marvel-hitboxes.luaAll of the Marvel/Versus games on the CPS-2 system.
NotesFBA 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.
potential throw boxIt'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.luaAll of the remaining CPS-2 fighting games, including the Street Fighter Alpha and Darkstalkers series.
NotesFBA 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.
axis throw boxAir throws in sfa, sfa2 & sfz2al, and special ranged throws in nwarr grab at the opponent's axis instead of a box. beatemup-hitboxes.luaSelected beat-em-up games on the CPS-2 system.
NotesNon-character objects are colored as projectiles. Pushboxes are not used. kof-hitboxes.luaMost of the King of Fighters games on the NeoGeo MVS system.
NotesAll 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.
guard boxAttacks that hit a guardbox will be blocked, either by manually blocking, by an autoguard move, or by a special counter move. garou-hitboxes.luaThe Garou Densetsu/Fatal Fury NeoGeo series.
NotesThis 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.
There are no throwability or projectile vulnerability boxes. cps3-hitboxes.luaThe CPS3 games, excluding the Jojo titles.
NotesThis script was originally translated to Lua from the mameserver project. The 3rd Strike code was also helped by the work of crystal cube 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:
Copy and paste the line over to the debugger console and hit enter. Now all supported box types will appear correctly.
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. Errors or inconsistencies can be reported by leaving a comment to this page. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
:D
Nice Work ! Looking forward for Garou MOTW Hitboxes :)
That link at pastey for background removal seems to be offline, can you put it somewhere else? thanks
A replacement link has been added for the BG codes.
I'd love to see a hitbox view for JoJo?'s Bizarre adventure dammit. Great work!
I'd like to do one for all the CPS3 games at some point, but I need either a faster MAME-rr or a faster computer.
Great work! hope can see the hitbox of samurai spirits, knights of the round and the warriors of fate……