Character WAD tutorial
|It has been suggested that this article should be split into multiple articles. Please discuss this on the article's talk page.|
A character WAD is a WAD file used in Sonic Robo Blast 2 that contains playable characters. These can be loaded up, and usually, they will be selectable in the character select screen to be played as through the levels. Examples include those that are part of SRB2, such as Sonic, Tails, and Knuckles. Examples in the conventional sense are custom characters, such as Amy, Shadow, and Metal Sonic.
276 frames in total can be dedicated to a character. A character WAD can be considered complete with only around 170 frames though, made possible due to the abridged system of handling sprites. The sheer number of sprites alone contributes to the history of completed character WADs, notorious for having few results being yielded. Nonetheless, several completed Character WADs do exist; the majority of those are edited from the official sprites, while ones made — to some degree — from scratch, also exist.
To edit and create character WADs, one uses lump editors such as SLADE or XWE. The creator draws the amount of sprites their character WAD requires, and then they add them to the WAD file using such aforementioned lump editors.
You need the following things to create your own character WAD:
- A lump editor like SLADE or XWE.
- A basic outline for your character (e.g. what s/he is, what s/he can do, what s/he looks like, etc.).
- A couple of frames of what your character looks like.
- A basic knowledge of what a WAD file is and how to use your editor.
A character WAD, collectively, consists of a series of lumps. The lumps seen in a character WAD are the following:
- S_SKIN - The defining lump of a playable character. This is a special text lump containing attributes which are tweaked to the character's intended properties. The name for this is partially flexible - it can be called "S_SKIN", "S_SKIN1", "S_SKIN2", etc. provided the name at least starts with "S_SKIN".
- Player sprites - The entire series of sprites that make up the character. There may be 275 in total; 173 sprites alone may be made for a complete character WAD using the "abridged" sprite naming scheme. See Frame list below.
- OBJCTCFG - A SOC lump which defines how the playable character is displayed on the Single Player character select screen. This is optional, though it's needed if the character is to be used in Single Player.
Constructing the S_SKIN lump may possibly be the easiest place to start. If you already know how fast you want your character to run, what ability it has, how high it can jump, etc., you can start by making an S_SKIN lump to set the appropriate attributes.
As with level headers and other SOCs, the attribute names themselves of S_SKIN are not case-sensitive. That means "facename" can be identified as "facename", "FACENAME", "FaceName", or even "FaCeNaMe", and it will still mean the same.
The format for an S_SKIN lump is as follows:
name = flags = realname = hudname = charsel = face = superface = startcolor = prefcolor = ability = ability2 = actionspd = mindash = maxdash = normalspeed = runspeed = thrustfactor = accelstart = acceleration = jumpfactor = thokitem = spinitem = revitem = highresscale =
Attributes for S_SKIN
The unique name of the skin, for identification purposes internally. It is used with the SKIN command in the console and will always be used and displayed in all lowercase. Spaces are not allowed; use underscores instead. If another skin of the same name is added to the game, one will wind up with a number tacked onto the end – ensure your skin name is completely unique to avoid this, possibly tagging it with your own handle.
name = metalsonic
Skin flags determine some graphical behaviors of the skin.
|SF_SUPER||Determines if the character can turn Super in Single Player, cannot be set in S_SKIN. Only used by Sonic.|
|SF_SUPERANIMS||The character uses the designated special ability frames (animations U-Z) for the character's Super form, much like Sonic does. This does not include the Super transformation, which has been separated and no longer requires this flag. If this flag is not set, the normal character animations are used while Super.
If set, then frames U and V are used for Super standing, frames W and X are used for Super running, frame Y is used for tipping on an edge, and frame Z is used for getting hurt while Super.
|SF_SUPERSPIN||The character's Super form goes into their spinning animation when they jump/spindash or not. Super Sonic used to not show the spin animation when performing these actions, but rather his standing animation.|
|SF_HIRES||The character's sprites will be rendered at half-size. See
|SF_NOSKID||The character does not display skid particles and sounds when making sharp turns.|
|SF_NOSPEEDADJUST||The character's animations are not adjusted according to the player's velocity, for example when Sonic's walking animation speeds up as he walks faster.|
|SF_RUNONWATER||Allows the character to run on top of water and goop FOFs.|
flags = SF_SUPERSPIN|SF_HIRES|SF_NOSKID
The name of the character displayed next to the life icon. This is no longer a lump name. It is recommended to keep this name length low to fit with the standard five letter lives icons.
hudname = METAL
The name of the character displayed on intermission screens, the multiplayer character select screen, etc. This allows you to set the unique skin name to something other than you want to be displayed, and removes the automatically added trailing number in case of skin conflicts.
realname = Metal_Sonic
The lump name for the character select screen portrait used for the character. This image must be exactly 128×128 pixels in size, or 256×256 for high resolution. This is included in S_SKIN now for use in Record Attack mode. XWE automatically gives this offsets, but this lump should not have any.
The lump name to the life icon used for the character. The life icon is a 32×32 picture shown at the bottom-left of the screen as part of the HUD. Although the value is not case-sensitive (values "STLIFE", "stlife", and "StLiFe" all point to the lump "STLIFE"), it's very highly recommended to input the value in all caps, to match that the lump name is presumably all caps as well. It's more elegant and accepted this way. XWE automatically gives this offsets, but this lump should not have any.
face = METALIFE
The lump name of the character's life icon when they turn Super. When left blank, it defaults to the character's normal life icon.
superface = METALSUP
The character's special ability, such as Sonic's thok, or Tails's flying ability. Only one may be selected. The values possible are as follows:
|CA_FLY||Flying (Frames U and V are used for flying, frames W-Z are used when the character can't fly anymore)|
|CA_GLIDEANDCLIMB||Gliding and climbing (Frames U and V are used for gliding, frame W is used for the climbing "standing", and X-Z are used for the actual climbing movement animation)|
|CA_SWIM||Swimming (basically the flying action only allowed underwater)|
|CA_FLOAT||Floating (e.g. Super Sonic's secondary ability)|
|CA_SLOWFALL||Floating with slow descent (similar to E-102 Gamma's booster powerup in Sonic Adventure)|
|CA_TELEKINESIS||Telekinesis. Press jump in mid-air to push enemies away, and spin to pull them closer.|
|CA_FALLSWITCH||Fall switch. Reverses the player's momentum when pressing jump in mid-air.|
|CA_JUMPBOOST||Jump boost. The faster you run, the higher your jump speed is.|
|CA_AIRDRILL||Air drill. Slower thok that climbs vertically, holding spin descends swiftly.|
|CA_JUMPTHOK||A hybrid between the thok and the double jump. Gives you a burst of speed and an extra jump with each use.|
ability = CA_THOK
The character's secondary ability. This can be the ability to spin, both while jumping and as a spindash, or "multiability" - an option to use the special ability more than one time per jump. Some abilities like Slow Fall get a higher jump height instead. If spinning is set, the player will jump with the frames L-O; all other values will instead have the player jump with the springing frames (P, `, and lowercase a). Only one of these may be selected; the level header rule of adding numbers to combine properties does not apply here. The values possible are as follows:
|CA2_MULTIABILITY||Multiability + no spin|
ability2 = CA2_SPINDASH
Defines the speed value of the character's special ability, or how fast the character can move when performing their special ability. This only applies for thokking, flying, gliding, swimming and homing attack. A negative value can also be given to actionspd to make any of the abilities do reverse actions. The thok becomes reversed and sends the player backwards, flight and swim become unable to rise and are turned into a slow fall that gradually becomes faster and can't hurt enemies, and glide becomes a backwards glide that cannot climb walls. Default is 30.
actionspd = 20
- Sonic - 60
- Tails - 100
- Knuckles - 25
Defines the minimum speed that the character can spin off after charging a spindash. Default is 15.
mindash = 15
Defines the maximum speed that the character can spin off after charging a spindash. Set to "0" to give the character a mêlée attack. Default is 90.
maxdash = 90
The character's normal top running speed, without power-ups. Default is 36.
normalspeed = 32
- Sonic - 36
- Tails - 32
- Knuckles - 34
Defines at which speed the character starts going into their running animation. This does not have to be within the confines of the character's normalspeed. An example would be Tails from SRB2 versions 1.09.4 and older, where he could only reach his runspeed by use of Super Sneakers. Default is 28.
runspeed = 30
Has to do with the character's speed. Literally, as found in the SRB2 source, "Thrust = thrustfactor * acceleration".
In other words, the character's other speed values are multiplied by whatever value thrustfactor is to give a complete picture of the character's speed. The higher the thrustfactor, the more speedy the character is. Think "thrust factor"; the character thrusts themselves forward by a factor of this much (whatever the value for this attribute is). Default is 5.
thrustfactor = 3
- Sonic - 5
- Tails - 3
- Knuckles - 4
The rate that the character starts to accelerate at from when they first stand still. Once one first presses the key, the character's speed will increase by this much until they gain enough speed. Default is 96.
accelstart = 128
- Sonic - 96
- Tails - 192
- Knuckles - 128
The rate the character accelerates once they are already moving. When moving, their speed will increase by this much per certain amount of time until it reaches the normalspeed. Default is 40.
acceleration = 40
- Sonic - 40
- Tails - 50
- Knuckles - 45
Specifies the range of colors of the palette on the character's sprites that can change in multiplayer mode. By default, this is a range of 16, starting from the specified startcolor. See About the palette below.
startcolor = 192
The default color for the character. This is especially useful (and practically required) in Single Player mode, where the color cannot be changed by the player. The possible values are as follows.
prefcolor = Blue
Sets the jump speed, measured as a factor of the default jump height. The usual setting (and the default) for this would be 1.0 (1.0x of the default height), although Knuckles has it set to 0.85.
jumpfactor = 1.0
If the skin flag
SF_HIRES is set, highresscale is used to set exactly what relative size to draw this skin's sprites at. It defaults to 0.5, for double-resolution sprites to be drawn at half-scale. This setting does not affect the character's hitbox, however.
highresscale = 0.5
Replaces the default translucent speed trail left behind by thokking with an Object of the specified Object type. The default is -1, which results in
thokitem = MT_THOK
Replaces the default translucent speed trail left behind by spindashing and spinning on the ground with an Object of the specified Object type. The default is -1, which results in
spinitem = MT_THOK
Replaces the default translucent circles created by charging a spindash with an Object of the specified Object type. The default is -1, which results in
revitem = MT_THOK
One can directly make S_SKIN by making a new lump in a lump editor and typing the details out. Another way is to write it with an external text editor such as Notepad and then import it into the WAD file. This can be done by saving the text file, and then, using a lump editor, importing it into the character WAD with the name S_SKIN.
S_SKIN's placement is very important. S_SKIN must be placed right before the first frame of the character WAD. The reason for this is that once SRB2 reads an S_SKIN lump, it automatically tries to look for all of the character's frames — in order — directly after that lump. If they're not directly after S_SKIN, and another lump is there (say, S_START is the lump after S_SKIN rather than PLAYA1) the game crashes. Note that if your sprites appear between lump markers S_START and S_END, it's okay to put S_SKIN in-between those lump markers. Just so long as S_SKIN appears directly before the first frame, SRB2 will understand it.
This is a typical example of what an S_SKIN lump may look like:
name = Idreia face = IDRALIFE ability = CA_DOUBLEJUMP ability2 = CA2_NONE normalspeed = 36 thrustfactor = 3 accelstart = 112 acceleration = 42 startcolor = 200 prefcolor = Steel_Blue jumpfactor = 1
Note that you don't have to supply all attributes available for S_SKIN, or even anything at all (this is not recommended though). Whatever is left out will fall on a set of default stats (these do not match Sonic's anymore, unlike in previous versions).
OBJCTCFG is required if you'd like to have your character selectable — and essentially playable — in Single Player, in the character select screen. Just like S_SKIN, it is a text lump, or more accurately, a SOC lump. Because it's a SOC lump, the "Character" block can also be put into a MAINCFG instead of making an OBJCTCFG, and the character addon it applies to then depends on the "Character" and "SkinName" attributes below.
You'd go about making and importing OBJCTCFG in the same way as for S_SKIN, but compared to that, it only has a small amount of variables. The variables are:
SRB2 version = Character Status = SkinName = PicName = PlayerText =
In some character WADs, you might see the attribute "MenuPosition = " or "PlayerName = " in the OBJCTCFG. These are obsolete values.
Attributes of OBJCTCFG
Determines which SRB2 version that the character WAD is designed for. Presumably, your character is designed for v2.1, so you'd want to fill this attribute with "210". You see this same variable in the MAINCFG lump, so if you're placing the Character block there, this attribute may already be on the MAINCFG lump.
SRB2 version = 210
Starts a "Character" block. Determines what slot your character will appear in when loaded in SRB2 in the multiplayer select screen. This should not be set to a number, unlike previous versions of SRB2.
Do not include this value unless you know what you're doing.
This can be used to disable the display of another character's entry in the character select screen. "0" stands for don't display the character's entry, anything else stands for display the character's entry.
To disable hardcoded characters like Sonic, for example, an entry in the SOC can be added which defines Character 0 only "Status = 0", and nothing else.
Status = 1
This tells SRB2 the name of the character you made. Use the same variable you used for "name" in the character's S_SKIN.
SkinName = metalsonic
New to 2.1 is the ability to have a single bot player that follows you around exclusive to Single Player, which is set using this value. To do this the & symbol must follow the name of the main player's skin, followed by the name of the skin the bot player is intended to use; the result will have a format of "player&bot", player being the main player's skin and bot being the bot player's skin.
SkinName = sonic&tails
Do not include this value unless you know what you're doing.
This is the name of the image lump that is displayed when the character option is highlighted in the Single Player character select screen. This should only be used if this picture is intended to be different from the one specified in S_SKIN, as by default the character select pic used will be set by charsel from the S_SKIN.
This image must be exactly 128×128 pixels in size, or 256×256 for high resolution. This value is case-sensitive; presumably, one would type this value in all capitals, since lump names are typically in all capitals.
PicName = EGGMPICS
The description that the character will have in the Single Player character select screen. The text will automatically wrap and a large space is available. This attribute string is ended by the # character. Colors can be used with the ^ symbol followed by a number ranging from 1-7 (see list below). ^0 is needed to reset the text color to white when appropriate, as otherwise the last color used will continue until the next time a color is set or the end of the text.
PlayerText = ^2Sonic^0 is the fastest of the three, but also the hardest to control. Beginners beware, but experts will find Sonic very powerful. ^2Ability:^0 Speed Thok Double jump to zoom forward with a huge burst of speed. ^2Tip:^0 Simply letting go of forward does not slow down in SRB2. To slow down, hold the opposite direction. #
Usable colors include:
- ^0 -- White (the normal text color)
- ^1 -- Purple
- ^2 -- Yellow
- ^3 -- Green
- ^4 -- Blue
- ^5 -- Red
- ^6 -- Grey
- ^7 -- Orange
Like S_SKIN, OBJCTCFG is a text lump. Its attributes can directly be put into a new lump in a lump editor, or it can be written in an external editor program such as Notepad. Using an external editor program, save the OBJCTCFG as a text file, and then import it into the WAD file using a lump editor.
This is a typical example of what an OBJCTCFG lump may look like:
SRB2 version = 210 Character SkinName = Amy PlayerText = The girlfriend of Sonic The Hedgehog, doing anything to get him to love her, is now in SRB2. #
A character WAD consists of a series of frames that make up the visual design of the character that's implemented into the game. At least 177 frames are needed to make a complete character WAD. 276 frames may be made in total.
Frames are defined in a character WAD by a certain name format: "NAMEAx", where:
- "NAME" is a four-letter prefix that's unique to your character
- "A" is the animation that the frame consists of; see Frame list below.
- "x" is the rotation number that defines which rotation the frame consists of.
A character WAD sprite is depicted in eight rotations. The rotation number defines which rotation the specific frame depicts. There are nine rotations; A1-A8 cover individual frames ("A" being the name of the frame), while A0 will render the sprite no matter what angle it's facing. One would think that, since there are 33 different animations in 8 different rotations, 3 animations without rotations, as well as 9 Super transformation frames, 276 sprites would have to be made to make a complete character WAD. Actually, one would not have to make nearly this many to make a complete product.
The naming system and rotations
For starters, SRB2's method of handling sprites allows for a condensed (or abridged) structure of sprites to be used in character WADs. There are eight rotations for a sprite, so one would deduct that there would be eight sprites. However, the way sprites are handled allows two rotations to be compacted into one sprite. The one sprite, which is drawn to depict only one rotation by itself, is merely flipped to serve as a depiction for the second rotation. It's very common — almost universal — practice to take advantage of this rule. If you take a look at a typical character WAD, you'll see listings that consist of lump names like these:
PLAYA1 PLAYA2A8 PLAYA3A7 PLAYA4A6 PLAYA5
Note how some of the frames define two rotations: PLAYA2A8, for example, defines that it can be used for rotations "A2" and "A8". The first rotation that's defined tells that the specific rotation is the one drawn in the sprite. The second rotation that's defined tells the game to flip the sprite to make that rotation. This animated GIF shows exactly how this works:
With this condensed system, the 33 full-rotation frames no longer need eight sprites, just five. Adopting this condensed structure allows one to make a character WAD with only 177 sprites, rather than the 276 that the game supports in total. It's a very good time-saver.
Note, however, that because the game flips the one sprite using this naming scheme, asymmetrical features would be flipped as well. For example, if the character carried a weapon on their right hand, it would also appear on their left hand by error when the game flips the sprite, as if they were "switching hands". This can be seen as problematic. Contrary to popular belief, however, it's actually possible to make a character with asymmetrical features by falling back onto the uncondensed naming structure of sprites, like so:
PLAYA1 PLAYA2 PLAYA3 PLAYA4 PLAYA5 PLAYA6 PLAYA7 PLAYA8
This way, different sprites can be drawn for all the rotations. PLAYA2 would show the character holding their weapon on their right hand — the one away from the camera, while PLAYA8 could still show the character holding their weapon on their right hand — in this case, the one towards the camera.
Yet, there is a method to display the same sprite for all angles, as shown.
It is not recomended to use this for anything other than the transformation, death, signpost and life-box though, as no one wants to see your character always walking towards you when you are facing him from the back.
You can also flip the sprite for use in other frames, like this.
This will enable you to save some time on importing, and lower the file size at the same time.
Lowercase lump names
The last thirteen frames in that list all have lowercase letters in them. That means that it's going to have to look like this:
PLAYa1 PLAYa2a8 PLAYa3a7 PLAYa4a6 PLAYa5
Most WAD editors now support lowercase lump letters, though the feature may be turned off by default. Both XWE and SLumpEd, two very popular WAD editors, support this in newer versions. If you would like to know how to turn this feature on, check the XWE tutorial or SLumpEd tutorial to adjust the settings. Also, it is worth noting that this applies to the last 13 frames, the "Falling 2", "Tails pickup" frames, "Life monitor" frames, "End sign" frames, and "Super transformation" frames. The first thirteen frames, "Standing", "Boredom 1", "Boredom 2", "Walking", and "Jumping" are all supposed to use capital letters. The character will not work correctly if these lumps do not use lowercase letters.
About the palette
- See also: List of skin colors
In SRB2, the
STARTCOLOR determines what range of colors can change in multiplayer mode. The values to be used here correspond to the colors in the palette. The
STARTCOLOR value is what determines which color along the palette is the startpoint for the color change and automatically ends 16 colors ahead of it. So, if a character is green (such as Sonic, Tails and Knuckles are in player.dta), and the green range of colors is what is meant to change, then the
STARTCOLOR value would be 160. So, using the example above, the green range of colors, if
STARTCOLOR is 160, the end value will automatically be set to 175.
It is not required that
STARTCOLOR use a line of colors. Two sets of colors can be used, as long as they are within 16 values of
STARTCOLOR. For example, with a blue character, having
STARTCOLOR with a value of 232, and end with 247, the color cyan, 247, will change as well. However, SRB2 will treat them as if they are all along the same line of color, so making a character use green in a multiplayer game will cause both the blue and cyan colors to turn green.
Refer to the below table for the exact color values each of the 16 colors determined by
STARTCOLOR will be changed to, depending on the character's current skin color:
Lastly, characters are capable of having extra sounds. These sounds are either played when the character does something (such as jumping), or when the player activates a sound (such as taunts). The following is a list of sounds that SRB2 has for its regular characters, Sonic, Tails, and Knuckles:
|dsspin||Sound when Sonic goes into a spin while moving|
|dspudpud||Tails tired from flying|
|dsthok||Sound effect used for Sonic's thok|
|dsgasp||Grabbing a bubble|
|dsskid||The sound of changing direction quickly|
However, adding any sounds to the character WAD with those names would overwrite the ones SRB2 has by default. But there is a way to add custom sounds without replacing the ones SRB2 has. If the sounds in the character WAD are given a different name, then they can be used, but they must be directed to do so in the S_SKIN. Here is an example from the old Zim.dta, a nicktoon character that was remade for SRB2, but has since been removed:
dsspin = dszspin dsputput = dszput dspudpud = dszpud dsspndsh = dszdash dszoom = dszzoom dsgasp = dszgasp dsjump = dszjump dsaltow1 = dsizim01 dsaltow2 = dsizim02 dsaltow3 = dsizim03 dsaltow4 = dsizim04 dsvictr1 = dsizim05 dsvictr2 = dsizim06 dsvictr3 = dsizim07 dsvictr4 = dsizim08 dsaltdi1 = dsizim09 dsaltdi2 = dsizim10 dsaltdi3 = dsizim11 dsaltdi4 = dsizim12
Notice how not all the available names have been used. This is because SRB2 does not require all the options filled, only the ones that have been added.