Custom character tutorial/Overview

From SRB2 Wiki
Jump to navigation Jump to search
  Custom character tutorial [view]

Chapter 1: OverviewChapter 2: S_SKINChapter 3: SpritesChapter 4: Character select

SRB2 itself features six playable characters: Sonic, Tails, Knuckles, Amy Rose, Fang, and Metal Sonic. Through addon files, you can add new playable characters to the game. Internally, SRB2 calls a playable character a skin. A skin consists of a skin definition that defines the character's stats and attributes, such as speed and special abilities, and a set of sprites that define the character's appearance. To create a custom playable character, you must supply both of these in a WAD or PK3 file that can be added to the game, along with a few other, optional components. This chapter gives an overview of what is required for creating a custom character.

Requirements

You need the following things to create your own custom character with:

  1. A lump editor. SLADE, more specifically version 3.1.13, is recommended for beginners, but this tutorial will also cover XWE where necessary. This tutorial assumes that you have basic knowledge of what a WAD/PK3 file is and how to use your chosen lump editor.
  2. A graphics editing program for creating your character's sprites. For the best results, many dedicated sprite artists use pixel art programs such as Aseprite or GraphicsGale. However, programs like Microsoft Paint, Paint.NET, GIMP, and Photoshop are also employed.
  3. A basic outline for your character's appearance and gameplay (i.e., what they are, what they can do, what they look like, etc.). You should generally plan this in advance to save you from unnecessary work.

Before you start making your character, you need to decide if you want to store it in a WAD file or a PK3 file. If your character is for the latest version of SRB2, it is recommended that you use a PK3 file because it is compressed and can have folders, which makes it easier to organize your data. However, this tutorial will also cover how to store a character in a WAD file.

Contents

A custom character generally consists of three components:

  • S_SKIN – The skin definition for the playable character. This is a special text lump that lists the character's attributes. The name of this lump is partially flexible – any name that starts with "S_SKIN" is accepted, such as "S_SKIN", "S_SKIN1", "S_SKIN2", etc. Further details are covered in the S_SKIN chapter of the tutorial.
  • Character sprites – These are the graphics that make up the character and determine how the character appears in-game. Unlike normal sprites, character sprites are not required to be in-between the marker lumps S_START and S_END (for WAD files) or in the Sprites/ folder (for PK3 files), respectively. Further details are covered in the Sprites chapter of the tutorial.
  • Character select entry – This is a SOC block that defines the information for the character on the Single Player character select screen. Like any SOC block, it must be stored in a SOC lump. If you are using a WAD file, the SOC lump's name must begin with SOC_ or must be MAINCFG or OBJCTCFG. If you are using a PK3 file, it must be stored in the SOC/ folder. If the character is not meant to be used in Single Player, this component can be left out. Further details are covered in the Character select chapter of the tutorial.

Miscellaneous graphics are usually also provided for the HUD and for the character's entry in the character select screen. Custom sounds for the character may also be provided if specified in the S_SKIN lump.

Organization

A common problem with creating custom characters is figuring out how to order all the contents of a custom character inside the WAD or PK3 file. The most important thing to note is that the S_SKIN lump must be placed immediately before the character's sprites in the WAD or PK3 file. This is so SRB2 can detect where the sprites for a character are – if another lump is placed in-between these (e.g., the SOC lump containing the character select entry, or the marker lumps S_START or S_END), the game will not display any of the character's sprites in-game. This section briefly shows you how a character's contents in a WAD or PK3 file should be laid out:

WAD

WAD files cannot have folders, so all lumps for the character are simply listed after each other. A typical WAD file for a single playable character is laid out like this:

[Miscellaneous graphics]
[Custom sounds]
[Lua scripts]
MAINCFG [contains character select entry]
S_SKIN
[Sprites]

A WAD file can also contain multiple characters. In this case, it is laid out like this:

[Miscellaneous graphics, for all characters]
[Custom sounds, for all characters]
[Lua scripts, for all characters]
MAINCFG [contains character select info for all characters]

S_SKIN [for Character #1]
[Sprites for Character #1]

S_SKIN [for Character #2]
[Sprites for Character #2]

etc...

Note that the MAINCFG lump may also be called OBJCTCFG or SOC_xxxx where xxxx is any four-letter name you want.

PK3

PK3 files allow you to organize your lumps into folders. A typical PK3 file for a single playable character is laid out like this:

Graphics/ [miscellaneous]
Sounds/
Lua/
SOC/
    Character select.txt
[Character name]/
    S_SKIN
    [Sprites]

A typical PK3 file containing multiple characters is laid out like this:

Graphics/ [miscellaneous, for all characters]
Sounds/ [for all characters]
Lua/ [for all characters]
SOC/ [for all characters]
    Character select.txt [for all characters]
{Character #1]/
    S_SKIN
    [Sprites]
[Character #2]/
    S_SKIN
    [Sprites]
	
etc.

The character select entry can have any name you want. Most of these folders are optional and can have any name you want. However, any Lua scripts you are using must be placed in the Lua/ folder and the character select entry must be placed in the SOC/ folder – otherwise, SRB2 will not recognize them.

  Custom character tutorial [view]

Chapter 1: OverviewChapter 2: S_SKINChapter 3: SpritesChapter 4: Character select