SALUTE TO THE FLAGS
THE HITBOX FLAG DIRECTORY
(read this you maggots)
While I've documented all the hitboxes of every character and item, I haven't yet done things like ATs and Pokémon, while stage and enemy attacks may be their own thing entirely.
(the witty bit)
So you've opened up your favourite character editing program (i.e. the only one that works) and are dutifully working away on your moveset editing or whatever. But there's always the time when you're changing a hitbox and you run into a string of eight digits that you don't really know what they do. Maybe you know it does something with the attack's effects or sound, but you can't find a pattern. You probably copy the unhelpfully-labelled "flags" from an attack that does what you want, but wouldn't it be better if you could completely control it instead? That's where all this comes in.
(To skip the rest of the preamble, you can go right to "The Roles Of Flags".)
WHUTS R FLAGGS?
(non-newbies can skip this part)
A flag is basically a bit. You probably know that a bit can be either 0 or 1. Often, bits work together to store numbers or text, but flags sometimes work alone as well.
So, a flag is a bit. But now you're probably thinking, "But the thing called 'Flags' is made of numbers and letters, not 0s and 1s!" That because you're looking at hex digits. Hex (or hexadecimal) is a way to write down four bits in one number - for example, the bit string 0110 is equal to 6. Letters are used because there are only 10 digits, whilere there are 16 possible 4-digit bit strings. For example, D is equal to 13, which is equal to a bit string of 1101. The list of decimal-hex-binary conversions is this:
+----------------+-----------+-------------+ |Number (decimal)|Digit (hex)|String (bits)| +----------------+-----------+-------------+ | 0 | 0 | 0000 | | 1 | 1 | 0001 | | 2 | 2 | 0010 | | 3 | 3 | 0011 | | 4 | 4 | 0100 | | 5 | 5 | 0101 | | 6 | 6 | 0110 | | 7 | 7 | 0111 | | 8 | 8 | 1000 | | 9 | 9 | 1001 | | 10 | A | 1010 | | 11 | B | 1011 | | 12 | C | 1100 | | 13 | D | 1101 | | 14 | E | 1110 | | 15 | F | 1111 | +----------------+-----------+-------------+
DIVISION OF LABOUR
(breaking it up)
The first time you looked at flags, you may have guessed that each of the eight digits had a purpose. That's not a bad idea, and it's partly true - however, it breaks down once you actually try it out. The real culprits are the bits that the digits are made of - they don't work together in evenly-distributed groups. This leads to one attribute overlapping two or even three of a flag's hex digits. Lucky for you, after looking at hundreds of flags, I've pieced together how everything goes together. Let's take the simple 39030200 as an example:
3 9 0 3 0 2 0 0
0011 1001 0000 0011 0000 0010 0000 0000
00 1 1 1 00100 0000 1 1 00 00001 0 00 0 00000
See how the bits are in unevenly-sized groups? Now we just have to convert them into decimal (understandable numbers), and:
00 1 1 1 4 0000 1 1 00 1 0 0 0 0
And now you have some meaningful numbers. Or almost - the meaning of the numbers is the subject of the next section.
(if you don't know how to put a big binary number into decimal, you can put "0b00001000 in decimal" into Google)
THE ROLES OF FLAGS
(the entire point)
The following is a list of how to make the flags do what you want them to do. There are still a few mystery bits, but I believe all the important ones are known.
Bits 1-2: These bits do not seem to be used in any known hitboxes.
Bit 3: Direct As far as I can tell, if this bit is 0, then the attack is considered Special:Indirect; as a result almost everything in the Subspace Emissary will resist it slightly. I don't think it has any effect otherwise.
Bit 4: Rebound (nonfunctional) If this were Melee, this bit would control whether the move rebounds (gets interrupted with the character entering the bounceback animation) when it clangs. In Brawl however the concept appears to be disabled; regardless of this bit, every move that can clang will rebound.
Bit 5: Clang This is the clang bit. You've probably heard of "clang" before - it's when two attacks hit each other and they're both interrupted. This bit controls whether a hitbox is able to clang with other hitboxes - if it's 1, it will; if it's 0, it won't. This doesn't mean it will always clang with any other attack (attacks can only clang if they're both grounded and they deal similar damage within 9%), but it does mean that it will be able to, for example, cancel out similarily-damaging projectiles.
Note: Many people will understand this better if I call it the "priority" bit, with 1 being normal priority and 0 being transcendent priority. However, since it's a single bit, convention dictates that 1 be a "yes it can" and a 0 be a "no it can't", and thus I call it the clang bit.
Bits 6-10: Type You generally won't care about what these bits contain, unless you intend your edits to be useful in the Subspace Emissary (or you just like being thorough and complete). That's because these five bits determine what type an attack is, and thus what kinds of stickers will work on it. Most attacks in a character's basic moveset are given a type, while items are only given a type if they can appear in the Subspace Emissary; in the same way Giga Bowser's and Wario-Man's movesets generally lack typing, as (most likely) do Pokémon and Assist Trophies. (The data would have taken up no more space, so it's just a case of the developers being lazy.) When the five bits are interpreted as an integer (number without a decimal), these are the types:
0: Typeless Most anything that doesn't appear in the Subspace Emissary gets this, as do attacks that don't fit into the other categories (like Mario's Fireball).
1: Head Things like Yoshi's up smash have this typing.
2: Body This is applied to things like shoulder rams, bellyflops, and the like.
3: Butt Moves that use one's rear end as a weapon get this type.
4: Hand Punches, slaps, and so on.
5: Elbow Very few moves have this type.
6: Foot Kicks, generally.
7: Knee You can probably count these ones on one hand.
8: Throwing Throws don't have flags like normal hitboxes do, but throws like Mario's back throw that hurt bystanders using the throwee have this type. Interestingly, the non-grab suction of Kirby's and Dedede's Inhales have this type as well. It can be assumed that for sticker purposes all throws are of this type.
9: Weapon This applies only to weapons in general, like Mario's FLUDD.
10: Sword This should be obvious.
11: Hammer Again, obvious.
12: Explosive Most explosives have this type, but there are a few surprising ones, like Samus's fire blasts, R.O.B.'s burner attacks, and Ivysaur's bulb blasts.
13: Spin Anything that involves spinning for generally more than one or two revolutions. Note that you cannot have a hitbox that's Spin and something else at the same time (like say Arm/Spin).
14: Bite Omnomnom.
15: Magic Again, you can't have a Magic/Arm attack, since they take up the same slot.
16: PK Or Psychic, if you wanna call it that.
17: Bow The vast majority of Pit's attacks are this, including his arrows (though Link's arrows aren't, what the crap).
19: Bat Only applies to Ness's f-smash; for some dumb reason the Home-Run Bat is considered Weapon.
20: Umbrella Applies to Peach's Parasol only (for documented attacks).
21: Pikmin All of 'em.
22: Water Only Squirtle gets this - FLUDD is considered Weapon. I think this is what triggers Water stickers, but I'm not sure.
23: Whip Attacks that involve something whiplike. I certainly wouldn't have thought of making this its own type if I was the designer, but unlike some of the other stuff up there it makes a degree of sense. Includes ZSS's whip attacks, Ivysaur's vines, and Sheik's chain.
24: Tail Why is this so late in the order?
25: Energy Things like Fox's Blaster, Samus' Charge Shot, Ray Gun shots, and so on. Also Beam Swords.
You've probably noticed two things:
1. Type 18 is missing, and I can't find it in any character or item hitboxes. Maybe it doesn't exist?
2. There are more types than sticker effects. I can guess there were going to be Elbow stickers and such at some point, but they decided that there were too few such attacks and merged it with Hand to get Arm stickers. Same with Body/Butt, Foot/Knee, Weapon/Sword/Hammer/Bat/Umbrella (probably), and so on.
Bits 11-14: These bits appear to be unused.
Bit 15 and Bit 16: Aerial and Grounded Bits These two work in tandem to determine whether a hitbox can hit aerial targets, grounded targets, or both. If it's 1, it can hit said target, if it's 0, it cannot. Most moves have both bits as 1, so it'll hit both aerial and grounded targets. Sometimes, a move will have two hitboxes of the same size in the same place, with one hitting air and the other hitting ground; this is used so attacks can have different behaviour on different opponents. A good example of this is Samus' up tilt, it only Meteor Smashes opponents that are grounded.
Bits 17-18: These bits appear unused.
Bits 19-23: Sound When interpreted as an integer, these bits determine what noise you hear when the hitbox strikes an opponent. (Most non-Smasher targets override these sounds, such as breakable walls and such). If an attack deals no damage, the sound will not play. The currently known sounds are as follows:
0: None/Unique (nothing if used with the S level, otherwise seems to produce a noise unique to the user/source; used by: Triforce Slash last hit, Critical Hit, Bumpers, Squeaky Golden Hammer, and some part of Falcon Dive)
5: Bat (as in Home-Run Bat)
13: Thud (as in Snake's attacks)
14: Slam (as in Ike's attacks)
15: Thwomp (as in Dedede's attacks)
16: Magic zap
27: Bat (as in Ness's f-smash)
Bit 24: Also appears unused.
Bits 25-26: Sound Level This number determines how much oomph the impact sound has.
Not all sound types have all levels; for example most of the categories don't have a Huge variant, and you'll get nothing. Another note: the Ping sound is Large Bat (as in Home-Run Bat).
Bit 27: This one appears unused too.
Bits 28-32: Effect This is a rather significant attribute. These are also used for sticker purposes in the Subspace Emissary, although they have a much greater effect, so no hitboxes have been skirted like they were for type. Here's the list:
0: Normal Uses the standard hit effects and the "jagged" impending angle indicator.
1: None? Only one attack that I know of uses this: the non-damaging hitboxes used to determine if Raptor Boost has hit someone. Has no apparent hit effects (and is probably used because of this).
2: Slash Uses cutting hit effects and the "boomerang" impending angle indicator. Assuming that this is what activates Slash stickers, this gives rather odd attacks the Slash property - such as Luigi's f-smash and Ray Gun blasts.
3: Electric Shocks the target, leaving them to spark for a bit. Causes Hotheads to grow and does jack to Yellow Pikmin. I'm pretty sure making an attack electric doesn't change the freeze frames, but it's hard to tell.
4: Freezing All ice attacks freeze the target; I believe the freeze time is based only on knockback taken. Hitting a frozen opponent with an ice attack won't increase or reset the freeze time.
5: Flame Aside from the normal effect, flame is by far the most common effect. Fire attacks will set opponents alight and instantly explode Blast Boxes, as well as thaw frozen enemies and deal 110% knockback to Ivysaur. Squirtle takes only 90% knockback from fire attacks, whereas Red Pikmin are completely immune. Also causes Hotheads to grow. Essentially all explosive attacks use the fire effect.
6: Coin Causes a coin to pop out of the opponent. Does not cause the coin noise, this is set seperately as above. This is what the Super Jump Punch (and a flubbed Fire Jump Punch) uses.
7: Reverse Turns the opponent around. Mario's Cape is the best example of this. Hacking this effect onto attacks that deal regular knockback will cause the target to take minimal fixed knockback (in the opposite direction due to the reverse), making the move impossible to KO with. I'm pretty sure this does not allow an attack to naturally reflect projectiles.
8: Slip This is not the same as having a trip chance of 100%. With a trip chance, the opponent must take little enough knockback that they remain on the ground. With this, the opponent is guarenteed to remain on the ground and trip. This applies even when hacked onto regular attacks - they'll still take all the sideways knockback, so they'll be sliding while tripping.
9: Sleep Opponents hit by a sleep attack will take no knockback, instead going to sleep. Hitting a sleeping opponent with a sleep attack will not increase or reset the duration. Only grounded opponents can go to sleep; I believe aerial opponents will take whatever knockback the move has.
11: Bury Has no extra effect on aerial opponents, but anyone on the ground will find themselves stuck in the dirt. Burying someone already embedded will not increase or reset the duration, although unlike other attacks they won't be sent flying. Hitting an airborne opponent with this does nothing special (normal knockback).
12: Stun This puts the target into their "I'm drunk" state as if their shield broke. Hitting them again won't increase or reset yadda yadda yadda.
17: Grass Squirtle takes 110% knockback from these attacks, while Charizard takes 90%. Otherwise, this effect doesn't do anything special. Uses Slash-like impact effects.
18: Water This causes Charizard to take 110% knockback while Ivysaur takes 90%. This also gives Blue Pikmin a relaxing, completely non-threatening bath. No effect otherwise. Uses Normal-like impact effects. I don't think this triggers Water stickers, seeing as some of Squirtle's attacks are Water-type but not Water-effect (they use water but don't have type effectiveness, maybe to force fixed knockback?).
19: Darkness Sets the opponent on purple fire. Ganondorf and Giga Bowser are the general culprits here, although White Pikmin use the effect as well (just for the visuals; they aren't immune to it).
20: Paralyze This effect makes the target shake in place for a while before taking any knockback. ZSS uses this a bit, as do some Final Smashes.
21: Aura If Lucario is the user, this effect will cause the attack to get stronger or weaker depending on his damage and place in the match. Otherwise, it'll do nothing but produce blue fire.
22: Plunge This is what Pitfalls do - normally it's identical to burying, but it will shove people downwards through soft platforms.
23: Down Hitting with this causes the opponent to immediately lie on their back like Snake's down throw (throws are not hitboxes but do have effects). Hitting in succession will keep the target down. Aerial opponents take minimal knockback in what appears to be the down-back direction, which makes me speculate that this is what actually causes the effect.
24: Flinchless This effect does damage but nothing else; the target will not flinch or get any freeze frames. Interestingly, while Training Mode will correctly report how much damage the hit did, it will not report on consecutive hits or total damage; they will be left unchaged from whatever the previous hit displayed.
You'll see that a few numbers are missing, namely 10, 13, 15, 16, and everything from 25 to 31. As far as I know these effects are undefined; an undefined effect has no hit effects but does deal normal damage and knockback.
If you've done moveset stuff, you may have noticed that some hitboxes have two extra parameters. These are special hitboxes - they may have characteristics that most hitboxes don't need denoted (such as reflectability). The first parameter is the rehit rate (makes the hitbox hit repeatedly every X frames), while the second one is - an entirely new 32-bit set of flags.
Bit 1: Flinchless While I'm not 100% sold on this one, it looks like all attacks the deal knockback without flinching (FLUDD, Gale Boomerang, Inhale) have this on. Attacks that deal no knockback (like Fox's Blaster) don't use this bit, since if the knockback is 0/0 the target doesn't flinch anyway.
Bit 2: No idea. Sorry.
Bit 3: Freeze Frame Disable When set (as in equals 1), the hitbox does not produce any freeze frames. Don't know what the difference is between this bit being set and just giving the hitbox a freezeframe multiplier of 0.
Bit 4: Piercing? People say this will allow a hitbox to ignore invincibility frames. I have yet to confirm this myself.
Bit 5: Grippy I believe that having this bit set will prevent the hitbox's knockback from releasing the target from a grab or throw; this is based on the fact that all pummels and multihit throws, with the exception of Giga Bowser's and Jigglypuff's pummels, have it on.
Bits 6-7: These bits don't seem to be used.
Bit 8: Absorbability If this bit is 0, put away PSI Magnet and Oil Panic, because they're useless. But if it's 1, put up your energy shield and the hitbox will be absorbed.
Bit 9: Reflectability If this bit is 0, don't bother with your Capes and Reflectors. But if it's 1, return postage ahoy.
Bit 10: Shieldability This is normally 1 for obvious reasons. But if this bit is 0, your normally-reliable concentration bubble/egg will fail to save you. This will also make a move go through counters.
Bits 11-12: Seem to always be 0 (that is, unused).
Bits 13-26: Hit Bits These bits control what kind of targets the hitbox will be able to hit; things like special move grabs use this to produce "extra" hitboxes for use in the Subspace Emissary (as they don't otherwise work on enemies). Exactly what is what is sketchy right now, but the following are the plausible ones:
Bit 17: Damageable Floors
Bit 18: Damageable Walls
Bit 19: Damageable Ceilings
Bit 25: SSE Enemies
Bit 26: Smashers
Bit 27: Looks to be unused.
Bit 28: Stretchy When set, the hitbox will turn from a sphere into a tube, stretching from its position to the bone it's attached to. Basically, it starts at the bone with an offset of [0,0,0], it ends at the position it's specified at, and it also covers all the space in between.
Bit 27: Also looks to be unused.
Bits 30-32: Angle Flipping Normally, an attack will always send the target away from the attacker. However, these bits can change it up a bit, depending on what the value is:
0, 2, 5: Regular angles; the target is always sent away from the attacker.
1, 3: The target is always sent the direction the attacker is facing. Examples include Toon Link's f-smash (second hit) and the Knee.
4: The target is always sent the direction the attacker is not facing. So far, I've only seen this on the first hit of Peach's back throw, Sheik's bair, and Dedede's Inhale (but not Kirby's).
6, 7: Now THIS is a wacky one. A hitbox with this as an angle flipper will cause the target to face the screen. They will be unable to walk or run, but they can move through the air normally. They will be unable to use f-tilts, and using an air attack in either direction produces a fair. Special moves tend to act as if the character is facing right. Knockback taken by these hitboxes will have no horizontal component. Getting hit by something else, using an f-smash, or using a side special will end the strangeness.
(the fun part)
So now you're armed with information. Now you just gotta put it into practice - how do you do that?
Say you want a hitbox to be an Hand/Flower attack that plays the Ping noise. You don't care about whether it clangs, and rebound is basically always 1 anyway, so you leave them as a "yes", and you want it to hit both aerial and grounded opponents. So, write it out:
Direct: Yes; Rebound: Yes, Clang: Yes; Type: Hand; Hits aerial: Yes; Hits grounded: Yes; Sound: Ping; Effect: Flower
Now, convert into numbers. Remember that the Ping sound is Large Bat.
1; 1; 1; 4; 1; 1; 5; 2; 14
Convert those numbers into binary. Remember that Type, Sound, and Effect are 5 bits long, while Sound Level is 2 - don't leave out the leading zeros.
1; 1; 1; 00100; 1; 1; 00101; 10; 01110
Now you need to fit these bits into the correct spaces - the Rebound and Clang bits are bits 4 and 5, the Type bits are 6 to 10, and so on. Use 0s to fill in the space.
00 1 1 1 00100 0000 1 1 00 00101 0 10 0 01110
Finally, convert it into hex.
0011 1001 0000 0011 0000 1010 1000 1110
3 9 0 3 0 A 8 E
And there you have it, your flags are 39030A8E!
Now you know a few things about making your own flags, instead of just copying the ones already in the game. You ain't gonna find an Energy/Grass attack that makes a slapping noise in pre-existing code, are you? Would you even want that kind of hitbox? Well, if you did, you should be able to do it now.