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.
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.
Each level can contain up to 10 fields of information for that level. Each field is identified by a numerical header;
* Field 1 is the map detail.
* Field 2 is not used. (It is implied that this would indicate the second map detail layer, which is always present)
* Field 3 is the map title.
* Field 4 is used to map brown buttons to traps.
* Field 5 is used to map red buttons to cloning machines.
* Field 6 is used to indicate password.
* Field 7 is used to indicate hint text
* Field 8 is not used. (perhaps can be used to map green or blue buttons??)
* Field 9 is not used. (perhaps can be used to map green or blue buttons??)
* Field 10 is used to indicate where moving objects (monsters) occur
If a level contains all valid fields, they appear in the order: 1,3,7,6,4,5,10.
Each level will always include fields 1, 3, and 6.
Field 1 - Map Detail Top Layer
* Indicated by the unsigned word $01.
* Map detail is created using a series of object codes (outlined later)
* Valid object codes range from $0-$6F
* Object codes $70-$9F are used internally as "ORd" copies of codes $3F-$6F
* Object codes $9F-$CF are used internally as "XORd" copies of codes $70-$9F
* An object code of $FF is an indicator of RLE (run-length-encoding)
* RLE takes the form: $FF, #copies.byte, object-code.byte
* Therefore an rle code of "$FF,$08,$02" would create a row of 8 chips
Field 2 - Map Detail Bottom Layer (implied)
There is no indicator of field 2, however it is needed for every level of the game, whether it is used or not. This layer always occurs immediately following field 1.
Format is the same as above
(If this 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.)
Field 3 - Map Title
* Indicated by the unsigned byte $03
* ASCII character string representing the level Title.
* String is always terminated with a 0 (null).
Field 7 - Map Hint
* Indicated by the unsigned byte $07.
* ASCII character string representing the level Hint.
* String is always terminated with a 0 (null).
Field 6 - Map Password
* Indicated by the unsigned byte $06.
* Always terminated with a 0 (null). Therefore it is always 5 bytes in length.
* Map Password is made up of 4 encrypted ASCII characters from the following equivalents:
A D8 N D7
B DB O D6
C DA P C9
D DD Q C8
E DC R CB
F DF S CA
G DE T CD
H D1 U CC
I D0 V CF
J D3 W CE
K D2 X C1
L D5 Y C0
M D4 Z C3
Field 4 - Trap Controls
* Indicated by the unsigned byte $04.
* Traps are assigned to appropriate brown buttons on the map detail.
* An X-Y coordinate system is used. Since the map is a 32x32 tile grid, valid X-Y values are $00-$1F
* Trap controls are represented as: ButtonX.word, ButtonY.word, TrapX.word, TrapB.word, 0.word, therefore: 5.w, 5.w, 6.w, 5.w, 0.w (unsigned string appears: 05 00 05 00 06 00 05 00 00 00) indicates that a Button at coordinates 5,5 (X,Y) - controls a Trap at coordinates 6,5 (X,Y)
* Each Coordinate pair is terminated with a 0.word, therefore trap data is always a multiple of $0A bytes.
Field 5 - Cloning Machine Controls
* Indicated by the unsigned byte $05.
* Cloning Machines are assigned to appropriate Red buttons on the map detail.
* An X-Y coordinate system is used, as in Field 4 above.
* Each coordinate pair is NOT terminated with a 0.word, therefore Cloning Machine data is always a multiple of $08 bytes. (Dont ask me why the in-consistencies, I didnt have anything to do with the programming J )
Field 10 - Movement
* Indicated by the unsigned byte $0A
* Each Monster placed on the map must be listed in this field in order for movement to occur. If not listed, it will simply remain in its starting position.
* An X-Y coordinate system is used. Since the map is a 32x32 tile grid, valid X-Y values are $00-$1F.
* Monster controls are represented as: MonsterX.byte, MonsterY.byte, therefore: 05 05 06 06 indicates that TWO monsters a coordinates 5,5 and 6,6 exist, and should move.
$00-$03 Unsigned Long suspect this is the size of the file without RLE. Perhaps important for memory allocation??
$04-$05 Unsigned Word Chips.dat shows $95 -> 149, which happens to be the number of levels there are
The information below applies to the first record. The levels that follow are in the same format.
$06-$07 Unsigned Word Offset to next record Level 1 = $135 bytes in level. $08+$135=$13D=begin next level.
$08-$09 Unsigned Word Level number
$0A-$0B Unsigned Word Time (in seconds). A value of ZERO indicates no time limit
$0C-$0D Unsigned Word # of chips to pick up
$0E-$0F Unsigned Word Always = 1 = field 1 = Map detail Upper layer
$10-$11 Unsigned Word Number of bytes in Map detail, first layer. Level 1 = $C1. $12+$C1=$D3=begin lower layer
$12-$D2 N/A Level 1 map detail Upper layer
$D3-$D4 Unsigned Word Number of bytes in Map detail, second layer. Level 1 = $0F. $D5+$0F=$E4=end map detail
$D5-$E3 N/A Level 1 map detail (second layer)
$E4-$E5 Unsigned Word # of bytes to end of level. Level 1 = $57. $E6+$57=$13D
$E6 Unsigned Byte Always = 3. Field 3 = Level Title
$E7 Unsigned Byte Number of bytes in Title. Level 1 = 9
$E8-$F0 N/A Level Title. Level 1 = "Lesson 1",0
$F1 Unsigned Byte Always 7 = Field 7 = Hint text
$F2 Unsigned Byte Number of bytes in Hint text. Level 1 = $43. $F3+$43=$136=end Hint Text
$F3-$135 N/A ASCII - Hint text. Level 1 = "Collect chips to get past the chip socket. Use keys to open doors.",00
$136 Unsigned Byte Always 6. Field 6 = Password
$137 Unsigned Byte Always 5. Password length
$138-$13C N/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.
$00 Empty Tile (Space) $26 Switch Block, Open $4C Tank (N)
$01 Wall $27 Brown Button - Traps $4D Tank (W)
$02 Computer Chip $28 Blue Button - Tanks $4E Tank (S)
$03 Water $29 Teleport $4F Tank (E)
$04 Fire $2A Bomb $50 Ghost (N)
$05 Invisible Wall (wont appear) $2B Trap $51 Ghost (W)
$06 Blocked North $2C Invisible Wall (Will appear) $52 Ghost (S)
$07 Blocked West $2D Gravel $53 Ghost (E)
$08 Blocked South $2E Pass Once $54 Frog (N)
$09 Blocked East $2F Hint $55 Frog (W)
$0A Movable Dirt Block $30 Blocked South - East $56 Frog (S)
$0B Dirt $31 Cloning Machine $57 Frog (E)
$0C Ice $32 Force All Direction $58 Dumbbell (N)
$0D Force South (S) $33 Drowning Chip $59 Dumbbell (W)
$0E Cloning Block North (N) $34 Burned Chip $5A Dumbbell (S)
$0F Cloning Block West (W) $35 Burned Chip(2) $5B Dumbbell (E)
$10 Cloning Block South (S) $36 NOT used $5C Blob (N)
$11 Cloning Block East (E) $37 NOT used $5D Blob (W)
$12 Force North (N) $38 NOT used $5E Blob (S)
$13 Force East (E) $39 Chip in Exit - end game $5F Blob (E)
$14 Force West (W) $3A Exit - end game $60 Centipede (N)
$15 Exit $3B Exit - end game $61 Centipede (W)
$16 Blue Door $3C Chip Swimming (N) $62 Centipede (S)
$17 Red Door $3D Chip Swimming (W) $63 Centipede (E)
$18 Green Door $3E Chip Swimming (S) $64 Blue Key
$19 Yellow Door $3F Chip Swimming (E) $65 Red Key
$1A South« East Ice Slide $40 Bug (N) $66 Green Key
$1B South« West Ice Slide $41 Bug (W) $67 Yellow Key
$1C North« West Ice Slide $42 Bug (S) $68 Flippers
$1D North« East Ice Slide $43 Bug (E) $69 Fire Boots
$1E Blue Block, becomes Tile $44 Fire Bug (N) $6A Ice Skates
$1F Blue Block, becomes Wall $45 Fire Bug (W) $6B Suction Boots
$20 NOT used $46 Fire Bug (S) $6C Chip (N)
$21 Thief $47 Fire Bug (E) $6D Chip (W)
$22 Socket $48 Pink Ball (N) $6E Chip (S) (Always used)
$23 Green Button - doors $49 Pink Ball (W) $6F Chip (E)
$24 Red Button - cloning $4A Pink Ball (S)
$25 Switch Block, Closed $4B Pink 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.
Here's some information from Douglas Holmes on the
XOR - exclusive OR function. If you treat each character as its underlying binary code and XOR with the mask 1100 0011 you will translate the password character into the displayable character or vice-versa. Each bit character is changed if the mask has a 1 and left alone if it has a 0 in the corresponding place. The documentation I picked up at your site has a table of characters and equivalents, this was just the reasoning as to why they matched up the way they did.
Back to Chip's Challenge for Windows Main Page