Sprite

From RuneScape Classic Wiki
Jump to navigation Jump to search
In this image, the bucket is a sprite, whereas the barrels are not.

A sprite is a two-dimensional image which is projected on the three-dimensional world of RuneScape Classic.

Players, items, monsters, and non-player characters are represented with sprites. The scenery and landscape are not.

Walls, while appearing to be sprites, are actually textures projected onto thin three-dimensional objects. They provide full viewing angles and do not appear to "snap" around or stay still as the camera is rotated.

Many sprites were hand-drawn and then scanned[1], including those by Gill Gower. Others show signs of being edited in Corel's PaintShop Pro[2].

Players and monsters have three frames of walking animation and three frames of combat animation. The three frames walking frames are drawn at five different orientations, and may be mirrored. Sprites can use a maximum of 256 colours.

Credits

[edit | edit source]

Items

[edit | edit source]
Sprite Author
Runes Andrew Gower
Party Hats Ian Gower
Amulets Paul Gower[3]

Monsters

[edit | edit source]
Sprite Author
Sheep Ian Gower
Cow Paul Gower
Camel Gill Gower
Giant bat Gill Gower
Bear Gill Gower
Spider Gill Gower
Dragon Possibly John Spain, contracted out to Usenet
Giant rat Possibly John Spain, contracted out to Usenet
Skeleton Possibly John Spain, contracted out to Usenet
Ghost Possibly John Spain, contracted out to Usenet

File format

[edit | edit source]

Features

[edit | edit source]

Earlier versions of RuneScape Classic (before 2002) used standard colour-mapped Truevision TGA files inside JAG archives to store sprites. Since 2002, they have been stored in a custom Jagex file format using the .dat extension inside JAG archives.

Sprites are divided into "sprite sheets" which all share a colour map which is limited to 256 24-bit RGB colours. Because of this limitation, many sprites in RuneScape Classic display signs of posterization. This noticeably changed over time, with many sprites gaining or losing quality after the 2002 update that changed the sprite file format (see also graphical updates).

Animations for players and monsters are divided into sprite sheets, with 15 individual sprites used for walking and standing animations, and 3 sprites being used for attacking animations. When necessary, these sprites are mirrored so that the player or monster faces the opposite direction.

Data layout

[edit | edit source]

Like most RuneScape Classic file formats, the .dat format for sprites is a simple binary format using big endian byte order for integers. Metadata and pixel data are stored separately, with the metadata being stored in a file called index.dat.

Metadata format

[edit | edit source]
[uint16_t] sheet width
[uint16_t] sheet height
[uint8_t] sheet colour map size
[uint24_t] sheet colour map entries...
for each sprite in the sheet:
[uint8_t] x-offset
[uint8_t] y-offset
[uint16_t] width
[uint16_t] height
[uint8_t] pixel storage type (see below)

The first entry in a colour map is always 0xff00ff, which is bright magenta and is reserved for regions which should be invisible (i.e. solid transparency).

Pixel format

[edit | edit source]

The first entry in the pixel data is a 16-bit integer pointing to the offset of the metadata for this sprite sheet.

There are two storage types for pixels, presumably chosen depending on compression efficiency. For type 1, the pixels are read as a series of vertical rows. For type 0, they are read as a series of horizontal rows. Every pixel is a single byte pointing to an entry in the colour map.

References

[edit | edit source]
  1. kaibachaoschampion. "Runescape Genesis Runefest 2010 Part 2/3." (03:23 - 03:43), YouTube Video. 28 August 2010.
  2. jagex.tga from 2001
  3. private conversation with Paul