DDiCI Graphics format

From ModdingWiki
Jump to navigation Jump to search
DDiCI Graphics format
There is no image of a tileset in this format — upload one!
Format typeTileset
HardwareEGA
Max tile count?
PaletteN/A
Tile names?No
Minimum tile size (pixels)0×0
Maximum tile size (pixels)8191×65535
Plane count4
Plane arrangement?
Transparent pixels?Yes
Hitmap pixels?No
Metadata?None
Supports sub-tilesets?No
Compressed tiles?Yes
Hidden data?Yes
Games

Dangerous Dave in Copyright Infringement has all its graphics in the file EGAPICS.DD2. The format is quite convoluted and was eventually abandoned for the more convenient but closely related Commander Keen EGA Header. The problem is that ALL the game's graphics are stored in this file as 4-plane Raw EGA data, including the sprites, and that the game itself is rather primitive.

DDiCI can only retrieve data from 'rounded ($X0) addresses; this means that all pointers end in 0 ($00030, $00150...) and that any data not stored starting at a rounded address will be 'clipped' (Though the sprites have a way around this...) The locations are always the actual location divided by 16, (In hex just lop a zero off the end of the address, so $0890 becomes $0089) This is seen later on in Keen, albeit a bit differently.

The file doesn't have an EGA plane size in it, and indeed the planes can be different sizes (But they shouldn't be.) This is because the primitive Dave engine loads the graphics consecutively rather than as separate modules like in Keen, and because the file contains a header, which cannot be part of a plane. The plane size has to be worked out using more complicated means.

Another thing to note is the sprite 'masking'; since DDiCI has the sprites and other graphics together, it can't use a separate 'masking' plane like later games did. Instead EACH of the rgbi planes has a separate 'mask data' segment after EVERY sprite data segment. These masks are all identical but all four are needed for a sprite to be masked, as each ONLY masks its own plane. This is even more inefficient than its precursor Dangerous Dave, where a single monochrome mask graphic masked all four planes.

Another similarity to Dave 1 is the sprite graphics themselves, each sprite frame is composed of four graphics, stored individually, each offset by two pixels from each other. These are used for smooth movement in-game. (In later games the game engine created these graphics automatically and they did not need to be stored individually.)

Data type Name Description
UINT16LE Blank
UINT32LE Font start Start of 8x8 font ÷ 16
UINT32LE Tile start Start of 16x16 tiles ÷ 16
UINT32LE Image start Start of unmasked images ÷ 16
UINT32LE Sprit start Start of masked sprites ÷ 16
UINT32LE Image en st Start of image header entries ÷ 16
UINT32LE Sprit en st Start of sprite graphics header entries ÷ 16
UINT32LE Blue pl st Start of the blue plane (At end of header)
UINT32LE Green pl st Start of green plane
UINT32LE Red pl st Start of red plane
UINT16LE Inten pl st Start of intensity plane
UINT16LE Num font Number of font entries
UINT16LE Num til Number of tiles
UINT16LE Num unmsk Number of unmasked images in file
UINT16LE Num spr Number of sprite images
UGFX[] Image ent Image entries, name, size, etc
MGFX[] Mask ent Sprite entries, name, size, etc
BYTE[] EGA data Raw uncompressed EGA data for all graphics

Each UGFX is an unmasked graphic entry, defined as:

Data type Name Description
UINT16LE Width Image width, in bytes (pixel width ÷ 8)
UINT16LE Height Image height
UINT32LE Offset Offset from plane start to start reading data \16
char[8] Name Image name, padded with nulls

Each MGFX is a masked sprite entry, defined as:

Data type Name Description
UINT16LE Width Sprite width, in bytes (pixel width ÷ 8)
UINT16LE Height Sprite height
UINT32LE Offset Offset from plane start to start reading data ÷ 16
UINT32LE Mask offset Offset for mask data, = [Offset] + [Height] × [Width]
UINT16LE hitLeft Hitbox coords, relative to (0,0)
UINT16LE hitTop Hitbox coords, relative to (0,0)
UINT16LE hitRight Hitbox coords, relative to (0,0)
UINT16LE hitBottom Hitbox coords, relative to (0,0)
char[12] Name Sprite name, padded with nulls

Notes

This format in practice bridges the gap between Dangerous Dave and later games like Dangerous Dave 2; the graphics are stored in something very close to that of Dave 1, but with innovations and formats that were passed on to the later games.

Credits

This file format was reverse engineered by Levellass. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)