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.
360 frames in total can be dedicated to a character. A character WAD can be considered complete with only around 177 frames on average 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.
- 1 Requirements
- 2 Components
- 3 S_SKIN
- 4 Attributes for S_SKIN
- 4.1 name
- 4.2 flags
- 4.3 hudname
- 4.4 realname
- 4.5 charsel
- 4.6 face
- 4.7 superface
- 4.8 ability
- 4.9 ability2
- 4.10 actionspd
- 4.11 mindash
- 4.12 maxdash
- 4.13 normalspeed
- 4.14 runspeed
- 4.15 thrustfactor
- 4.16 accelstart
- 4.17 acceleration
- 4.18 startcolor
- 4.19 prefcolor
- 4.20 jumpfactor
- 4.21 highresscale
- 4.22 thokitem
- 4.23 spinitem
- 4.24 revitem
- 5 Implementing S_SKIN
- 6 Character select entry
- 7 Attributes of the character select entry
- 8 Implementing the character select entry
- 9 Frames
- 10 Custom sounds
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 custom character consists of three components:
- 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. See Frame list below.
- Character select entry - This is a SOC block that defines the information for the character on the Single Player character select screen. If the character is not meant to be used in Single Player, it can be left out.
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.
Like with SOCs, the text in the S_SKIN lump is 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_NONE||No ability||The player will not have a special ability. This is the default ability given to characters that do not have one set.|
|CA_THOK||Speed thok||Sonic's default ability, loosely based on Sonic's air dash attack from Sonic Adventure. Pressing jump a second time in mid-air will thrust the player forward at the speed determined by actionspd.|
|CA_FLY||Flying||Tails' default ability, based on Tails' flight ability from Sonic 3. Pressing jump a second time in mid-air will make the player start flying in mid-air – repeatedly pressing jump afterwards will allow the player to fly further upwards. However, the player will be unable to fly after a limited amount of time (determined by
Other notes about flying:
Frames U and V are used for the flying animation, and Frames W-Z are used when the character can't fly anymore.
|CA_GLIDEANDCLIMB||Gliding and climbing||Knuckles' default ability, based on Knuckles' abilities (gliding, climbing and rock smashing) from Sonic & Knuckles. Pressing jump a second time in mid-air will make the player start a glide – the player will acclerate forward from a starting speed determined by actionspd for as long as the jump button is held down. However, the player will gradually fall down while doing so. The player will be able to damage all enemies that touch them while using this ability. The player will also skid when landing on the ground from gliding, slowing down to a grinding halt when doing so.
If the player glides into a wall, they will latch onto it and can move in any direction up, down or to the sides of it, and can climb over to other walls if possible. If the player is climbing, pressing jump will make them jump off and face away from the wall; pressing spin will make them jump away while still facing the wall. However, not all walls are climbable; some linedefs may have the Not Climbable flag checked, which prevents characters with this ability from climbing it. Any walls that are part of the sky will also not be climbable regardless of linedef flags.
Additionally, characters with this ability will be able to destroy all types of bustable FOFs on touch, rather than needing to spin into them. Some bustable FOFs will have the
Frames U and V are used for the gliding animation, Frame W is used for the climbing "standing", and Frames X-Z are used for the actual climbing movement animation.
|CA_HOMINGTHOK||Homing attack||A weakened version of the speed thok ability, but with the addition of a homing attack feature similar to that of Sonic Adventure's and beyond – if an enemy, spring or monitor is close enough to the player when triggering the ability, the player will home in towards the target Object until they touch/destroy it. If the character fails to reach the Object within 3 seconds, the homing attack is automatically cancelled.|
|CA_SWIM||Swimming||Similar to the flying ability, except this ability will work only underwater; attempting to use this ability outside of water will do nothing. Also unlike flight however, the ability can be used indefinitely while underwater. Characters with this ability will also be given the ability to run on water.|
|CA_DOUBLEJUMP||Double jump||Pressing jump a second time in mid-air will make the player do a second jump.|
|CA_FLOAT||Floating||Pressing jump a second time in mid-air and holding the button down will allow the player to hold their vertical position mid-air continuously, similarly to Super Sonic's own floating ability but without the limitation of needing to move while doing so.|
|CA_SLOWFALL||Floating with slow descent||Pressing jump a second time in mid-air and holding the button down will cause the player to fall at a fixed rate downwards, slowing down the rate the character falls down. This is similar to E-102 Gamma's booster powerup from Sonic Adventure.|
|CA_TELEKINESIS||Telekinesis||Pressing the jump button in mid-air will push enemies and players within a set radius around the player away; pressing spin in midair will pull them closer instead. The thrust of the pushing/pulling is determined by actionspd.|
|CA_FALLSWITCH||Fall switch||Reverses the player's vertical momentum when pressing jump in mid-air, thrusting them in the opposite direction instead.|
|CA_JUMPBOOST||Jump boost||The faster the player moves about, the higher the player's jump speed will be. actionspd is used as a multiplier for the jump boost given. Pressing the jump button in mid-air has no effect otherwise.|
|CA_AIRDRILL||Air drill||Pressing jump a second time in mid-air will initiate an air drill, thrusting the player forward at the angle they're facing. The player will fly in an arc, eventually finishing the drill when the player is falling down to the ground. Holding the spin button while drilling will cause the player to descend more swiftly. actionspd is used as an angular speed for the drill.|
|CA_JUMPTHOK||Jump-thok||A hybrid between the thok and the double jump. Gives the player 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).
Character select entry
If you want your character to be usable in Single Player, you need to add an entry to the character select screen. This is done via SOC. Specifically, you must add a
Character block to either the
MAINCFG lump or the
OBJCTCFG lump. The block looks like this:
Character Status = SkinName = PicName = PlayerText =
In some character WADs, you might see the attributes "MenuPosition = " or "PlayerName = ". These are obsolete values.
Attributes of the character select entry
The block for the character select entry is started with a header that simply reads
Character. No number must be supplied for the character select entry; SRB2 will find an unused slot automatically. However, when editing an already existing character select entry, the slot number must supplied. For example, to edit Sonic's character select entry, the header must be
This parameter determines whether the character select entry is displayed (
1) or not (
0). When adding an entry for a new character, this parameter is required for the character select entry to be displayed. However, it is useful for removing SRB2's own characters from the character select screen. To disable Sonic's entry, for example, you can add a block with the header
Character 0 and
Status = 0 as the only parameter.
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
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. Custom color codes may also be used.
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. #
Implementing the character select entry
Because the character select entry is a SOC, it should be put in a text lump called
OBJCTCFG. If your WAD already contains other SOCs, such a lump already exists. In that case, simply open it in a lump editor and add the block for the character select entry. Otherwise, create a new lump called
OBJCTCFG and put the character select entry block into it.
This is a typical example of what a character select entry may look like:
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. 360 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, and 12 animations without rotations (death, extra life icon, end sign icon and 9 super transformation frames), 360 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 360 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 list of skin colors article 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.