Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

File formats

Overview

There are two file types: level and map files. There are one or more map files for each level file. The level file represents the data common to a set of levels (sprites and status screen information) where as the map file represents the data for one level ie how to draw the map and what the bad guys are going to do.

The game searches for level files sorted by uid. So it will run level file with uid3 equal to 1 before level file with uid3 equal to 2. It then searchs for map files with uid3 equal to the level file number and runs each of these in the order it finds them.

Map Files

Map files contain the information about:

Format

Level Files

These contain the background and ship sprites and the information and sprites used to draw the status screen.

Format

Offsets are given from the first non uid byte, ie the offset of the map sprites offset is 0, the offset of the ship sprites offset is 4 the offset of the uid crc is -4 etc.

Map sprites are 64 pixels by 50 pixels, 2 pixels are stored in each 32bit word, so each sprites is 6400 bytes, see the sprite format for more infomation

Ship sprites are 32x24 pixels, again 2 pixels in one 32bit word, so each sprite is 1536 bytes, see the sprite format for more infomation

Status screen data is a list of the size and where to put sprites for the health and ships, what background sprites to plot, and where to put the score see the RStatus class for more information.

Sprite data format

The sprite data is a series of 32 bit words, the words are broken down into 8 nibbles (nibble = 1/2 byte) each of which represents mask information and two pixels. Numbering the nibbles 87654321 where 8 is the most significant nibble we have:

Sprites are always a multiple of 32bit words therefore the X dimension of sprites is always a mutiple of 2. Also the sprite routines in the game only handle plotting sprites on 32bit boundarys so for a 640 pixel wide screen X dimensions run from 0-319. (ie plotting a sprite at 10,20 will put it at 20 pixels in from the left and 20 pixels down from the top).

Generating uids

The 3 uid words and the uid crc are generated using uidcrc.exe which takes 4 parameters. The three uids and the name of the file to create with the 16 byte uid header.


Documentation for Game (Beta) version 1.44.