Chip's Challenge File Layout Information

(Copyright 1997 Greg Heier)

NOTE: This document was contributed by a visitor who wishes to remain anonymous, and replaces the information I had on this site before (it is far more complete). There may be an inaccuracy here and there, and needs some editing, but other than that it should prove to be very useful to those who might hack CHIPS.DAT a bit.

Amended and HTML cleaned up by John Elliott

Below you will find a description of the layout of the file CHIPS.DAT.

Each level of Chips Challenge is made up on a 32x32 tile grid. In addition, each Chip's Challenge level is made up of two layers: upper and lower. This allows chips to be placed under dirt blocks and monsters on top of cloning machines.

File Header

Offset Description
$00-$03Unsigned Long This is a 'magic number'. CHIPS.EXE uses this to check for a valid CHIPS.DAT file. The value must be $0002AAAC. Tile World also accepts $0102AAAC and uses it to select Atari Lynx rules.
$04-$05Unsigned WordNumber of levels in the file

Format of a level:

General information

The first 8 bytes of a level have fixed meanings:

Unsigned Word Number of bytes in this level (not including this word)
Unsigned WordLevel number
Unsigned WordTime (in seconds). A value of ZERO indicates no time limit.
Unsigned WordNumber of chips to pick up

Map details

Unsigned Word0 or 1: Map detail
Unsigned WordNumber of bytes in first layer
...Map detail, first layer
Unsigned WordNumber of bytes in second layer
...Map detail, second layer

(If the second layer is not used, it appears as, "FF FF 00 FF FF 00 FF FF 00 FF FF 00 FF 04 00", which indicates that there are 255+255+255+255+4 = 1024 = 32x32 spaces under the objects.)

"Optional" fields

The "Optional" fields are preceded by a word describing how many bytes there are. If there are more than 1152 bytes, "Chip's Challenge" will crash when loading the level.

Unsigned Word Number of bytes of optional fields
... One or more optional fields

All "Optional" fields start with two bytes:

Unsigned ByteField type
Unsigned ByteNumber of additional bytes in field

Since all field types include the number of additional bytes, CHIPS.EXE can skip over fields which it does not recognise.

Field types are:

The standard levels file contains extra fields in the order 3,7,6,4,5,10; but this is not required.

Each level will always include fields 3 and 6.

Field 1 - Level time

Unsigned Byte$01 = Field type
Unsigned Byte$02 = Field length
Unsigned WordTime in seconds, 0 for none

This field is not found in CHIPS.DAT because it is completely unnecessary.

Field 2 - Chip count

Unsigned Byte$02 = Field type
Unsigned Byte$02 = Field length
Unsigned WordNumber of chips on the level

This field is not found in CHIPS.DAT because it is completely unnecessary.

Field 3 - Map Title

Unsigned Byte$03 = Field type
Unsigned ByteLength of string including the terminating 0
ASCIIMap title. Can be up to 63 bytes.
Byte0 (end of string)

Field 4 - Trap Controls

Unsigned Byte$04 = Field type
Unsigned ByteLength of field, a multiple of $0A bytes
Trap records Unsigned WordButton X position
Unsigned WordButton Y position
Unsigned WordTrap X position
Unsigned WordTrap Y position
Unsigned WordAlways zero (used in the game for open/closed?)

Field 5 - Cloning Machine Controls

Unsigned Byte$05 = Field type
Unsigned ByteLength of field, a multiple of $08 bytes
Cloning machine records Unsigned WordButton X position
Unsigned WordButton Y position
Unsigned WordTrap X position
Unsigned WordTrap Y position

Field 6 - Map Password

Unsigned Byte$06 = Field type
Unsigned ByteLength of string including the terminating 0
ASCIIEncoded password.
Byte0 (end of string)

Standard passwords are always 4 bytes long, but the game engine allows passwords to be up to 9 bytes.

The password is encoded by XORing each byte in it with $99. This gives character encodings:

AD8ND7
BDBOD6
CDAPC9
DDDQC8
EDCRCB
FDFSCA
GDETCD
HD1UCC
ID0VCF
JD3WCE
KD2XC1
LD5YC0
MD4ZC3

Field 7 - Map Hint

Unsigned Byte$07 = Field type
Unsigned ByteLength of string including the terminating 0
ASCIIHint text. Can be up to 127 bytes.
Byte0 (end of string)

Field 8 - Map Password

Unsigned Byte$08 = Field type
Unsigned ByteLength of string including the terminating 0
ASCIIPassword (not encoded).
Byte0 (end of string)

Field 9 - Unknown

Unsigned Byte$09 = Field type
Unsigned ByteLength of field data
...Field data.

This field is ignored by CHIPS.EXE.

Field 10 - Movement

Unsigned Byte$0A = Field type
Unsigned ByteLength of field, a multiple of $02 bytes
Monster movement records Unsigned ByteMonster X position
Unsigned ByteMonster Y position

Example dump of CHIPS.DAT

Offset Description
$00-$03Unsigned Long $0002AAAC - magic number
$04-$05Unsigned Word $95 -> 149, number of levels
The information below applies to the first record. The levels that follow are in the same format.
$06-$07Unsigned Word Offset to next record. Level 1 = $135 bytes in level. $08+$135=$13D=begin next level.
$08-$09Unsigned WordLevel number
$0A-$0BUnsigned WordTime (in seconds). A value of ZERO indicates no time limit
$0C-$0DUnsigned WordNumber of chips to pick up
$0E-$0FUnsigned WordAlways = 1 = field 1 = Map detail Upper layer
$10-$11Unsigned WordNumber of bytes in Map detail, first layer. Level 1 = $C1. $12+$C1=$D3=begin lower layer
$12-$D2N/ALevel 1 map detail Upper layer
$D3-$D4Unsigned WordNumber of bytes in Map detail, second layer. Level 1 = $0F. $D5+$0F=$E4=end map detail
$D5-$E3N/ALevel 1 map detail (second layer)
$E4-$E5Unsigned WordNumber of bytes to end of level. Level 1 = $57. $E6+$57=$13D
$E6Unsigned ByteAlways = 3. Field 3 = Level Title
$E7Unsigned ByteNumber of bytes in Title. Level 1 = 9
$E8-$F0N/ALevel Title. Level 1 = "Lesson 1",0
$F1Unsigned ByteAlways 7 = Field 7 = Hint text
$F2Unsigned ByteNumber of bytes in Hint text. Level 1 = $43. $F3+$43=$136=end Hint Text
$F3-$135N/AASCII - Hint text. Level 1 = "Collect chips to get past the chip socket. Use keys to open doors.",00
$136Unsigned ByteAlways 6. Field 6 = Password
$137Unsigned ByteAlways 5. Password length
$138-$13CN/A Level Password (encrypted). Level 1 = $DB,$DD,$D1,$C9,$00 = BDHP

Chip's Challenge Object Codes

This is a listing of the object codes used in the Map Detail. This will be helpful to those who wish to change their maps. Please read File Layout Information for more information.

$00Empty Tile (Space) $26Switch Block, Open $4CTank (N)
$01Wall $27Brown Button - Traps $4DTank (W)
$02Computer Chip $28Blue Button - Tanks $4ETank (S)
$03Water $29Teleport $4FTank (E)
$04Fire $2ABomb $50Ghost (N)
$05Invisible Wall (won't appear) $2BTrap $51Ghost (W)
$06Blocked North $2CInvisible Wall (Will appear) $52Ghost (S)
$07Blocked West $2DGravel $53Ghost (E)
$08Blocked South $2EPass Once $54Frog (N)
$09Blocked East $2FHint $55Frog (W)
$0AMovable Dirt Block $30Blocked South - East $56Frog (S)
$0BDirt $31Cloning Machine $57Frog (E)
$0CIce $32Force All Direction $58Dumbbell (N)
$0DForce South (S) $33Drowning Chip $59Dumbbell (W)
$0ECloning Block North (N) $34Burned Chip $5ADumbbell (S)
$0FCloning Block West (W) $35Burned Chip(2) $5BDumbbell (E)
$10Cloning Block South (S) $36NOT used $5CBlob (N)
$11Cloning Block East (E) $37NOT used $5DBlob (W)
$12Force North (N) $38NOT used $5EBlob (S)
$13Force East (E) $39Chip in Exit - end game $5FBlob (E)
$14Force West (W) $3AExit - end game $60Centipede (N)
$15Exit $3BExit - end game $61Centipede (W)
$16Blue Door $3CChip Swimming (N) $62Centipede (S)
$17Red Door $3DChip Swimming (W) $63Centipede (E)
$18Green Door $3EChip Swimming (S) $64Blue Key
$19Yellow Door $3FChip Swimming (E) $65Red Key
$1ASouth« East Ice Slide $40Bug (N) $66Green Key
$1BSouth« West Ice Slide $41Bug (W) $67Yellow Key
$1CNorth« West Ice Slide $42Bug (S) $68Flippers
$1DNorth« East Ice Slide $43Bug (E) $69Fire Boots
$1EBlue Block, becomes Tile $44Fire Bug (N) $6AIce Skates
$1FBlue Block, becomes Wall $45Fire Bug (W) $6BSuction Boots
$20NOT used $46Fire Bug (S) $6CChip (N)
$21Thief $47Fire Bug (E) $6DChip (W)
$22Socket $48Pink Ball (N) $6EChip (S) (Always used)
$23Green Button - doors $49Pink Ball (W) $6FChip (E)
$24Red Button - cloning $4APink Ball (S)
$25Switch Block, Closed $4BPink Ball (E)

Codes $20,$36,$37,$38 work apparently in the same fashion as code $05. However they are not used in the original game.

Codes $39-$3F are only used internally by the game.

[Back] Back to Chip's Challenge for Windows Main Page