You are on page 1of 7

ChipsChallengeFileLayout

BasedontheChipsChallengeFileLayoutInformation,copyright1997GregHeier,whichcanbefoundinmanyplaces
online.Thisdocumentisanattempttocleanup,somewhatreorganize,andclarifysomeoftheinformationpresented
there.
Anoteonnamingconventions:thenamesofvariousobjectsusedinthisdocumentaredesignedtobegenerallymore
genericthanwhathasbeenpresentedinthepast.Thisisanattempttoavoidtermsthatarespecifictotheoriginal
ChipsChallengegame(andclones),allowingformoregeneralizedrulesthatcanbeappliedtosimilargamesusing
similaralgorithms,withoutbeingtieddowntotheoriginalnomenclature.Forinstance,theuseofartifactinsteadof
chiporleftwallhuggerinsteadofbug.

GeneralLayout
EachlevelofChipsChallenge(andsimilargamesthatusethefileformatdescribedhere)ismadeupofa32x32tilegrid
(themap;1024tilestotal).Eachmapcontainstwolayers:thetoplayer(whichwillgenerallycontainthebulkofthe
objectsinthemap)andthebottomlayer(usedwhenvariousobjectsshouldbeplacedunderotherobjectslistedonthe
toplayer;e.g.fireunderblocks).
Dataconsistingofmultiplebytesfollowthelittleendianscheme(leastsignificantbytefirst).
Eachfilecontainsthegeneralsectionslistedbelow:

FileHeader
Offset

Bytes

$00(0)

$04(4)

Description
MagicNumber,usedtocheckforavalidfile.Thevaluemustbe$0002AAAC.
TileWorldalsoaccepts$0102AAAC(AtariLynxrules).
Numberoflevelscontainedinthefile.

LevelInformation
Level1informationwillalwaysbeginwithoffset$06(6).Allotheroffsetsarecalculatedfromlevel1.
Offset
+$00(0)
+$02(2)
+$04(4)
+$06(6)
+$08(8)
+$0A(10)
+$0C(12)

Bytes
2
2
2
2
2
2
Varies
2
Varies
2
1
1

Description
Numberofbytesinthislevel(notincludingthisword).
Numberoflevelscontainedinthefile.
Timeallotted(inseconds).0indicatesunlimitedtime.
Numberofartifactstopickup.
0or1(0isnotusedintheoriginalCHIPS.DAT).Exactpurposeisunknown.
Numberofbytesintopmaplayer(notincludingthisword).[TMB]
Topmaplayerdetail.SeeMapDetailsectionbelow.
Numberofbytesinbottommaplayer(notincludingthisword).[BMB]
Bottommaplayerdetail.SeeMapDetailsectionbelow.
Numberofbytesinoptionalfields
Optionalfieldtype.SeeOptionalFieldssectionbelow.
Numberofbytesinthisoptionalfield

Eachlevelafterlevel1followsthesamepattern.Offsetsshouldbecalculatedaccordingly.

MapDetail
Themapdetailconsistsofaseriesofobjectcodes(seeChipsChallengeFileFormatObjectCodes),intherangeof$00
$6F.Objectcodes$70$9F(ORdcopiesof$3F$6F)and$A0$CF(XORdcopiesof$70$9F)areusedinternally.

$FFindicatesRunLengthEncoding(RLE),whichtakestheform$FF[numberofcopies][objectcode].
Forexample,$FF$08$02wouldindicatearowof8artifacts.Ifthebottommaplayerisnotused,itappearsas$FF$FF
$00$FF$FF$00$FF$FF$00$FF$FF$00$FF$04$00,whichis1024emptytiles(255+255+255+255+4)underthe
toplayer.

OptionalFields
Theupperlimitoftheoptionalfieldsis1152bytes.ChipsChallengewillcrashwhenloadingtheleveliftherearemore
bytespresent.
CHIPS.DATcontainsthesefieldsinthisorder:3,7,6,4,5,10.However,thisisnotstrictlyrequired.Eachlevelwillalways
containfields3and6.
FieldType
1
2
3
4
5
6
7
8
9
10

Description
Leveltime[NOTUSED]
Numberofartifactsinthelevel[NOTUSED]
MapTitle
Mapoftrapbuttonstotraps
Mapofclonerbuttonstocloners
MapPassword(encrypted)
HintText
MapPassword(notencrypted)[NOTUSED]
[NOTUSED]
MapofMonsters

Anyotherfieldtypenumbersaretreatedas9andignored.

FieldType1LevelTime[NOTUSED]
Offset
+$00(0)
+$01(1)
+$02(2)

Bytes
1
1
2

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte).
Timeallotted(inseconds).0indicatesunlimitedtime.

Duplicateofinformationcontainedatoffset+$04ofthelevel.

FieldType2NumberofArtifactsintheLevel[NOTUSED]
Offset
+$00(0)
+$01(1)
+$02(2)

Bytes
1
1
2

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte).
Numberofartifactstopickup.

Duplicateofinformationcontainedatoffset+$06ofthelevel.

FieldType3MapTitle
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

TheMapTitleisASCIIencoded.

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),including
terminating0.
Maptitle.Canbeupto63bytes.Terminateswith$00.

FieldType4Mapoftrapbuttonstotraps
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),amultipleof
$0Abytes.
Traprecords

Traprecordsconformtothefollowingformat.
Offset
+$00(0)
+$02(2)
+$04(2)
+$06(2)
+$08(2)

Bytes
2
2
2
2
2

Description
ButtonXposition
ButtonYposition
TrapXposition
TrapYposition
Always$00.Exactpurposeisunknown.

$00$1FarevalidXandYpositionsonthe32x32grid.

FieldType5Mapofclonerbuttonstocloners
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),amultipleof
$08bytes.
Clonerrecords

Clonerrecordsconformtothefollowingformat.
Offset
+$00(0)
+$02(2)
+$04(2)
+$06(2)

Bytes
2
2
2
2

Description
ButtonXposition
ButtonYposition
ClonerXposition
ClonerYposition

$00$1FarevalidXandYpositionsonthe32x32grid.

FieldType6MapPassword(encrypted)
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),including
terminating0.
Encodedpassword.Terminateswith$00.

ThepasswordisencodedbyXORingeachbyteinitwith$99.Thisproducesthefollowingencoding:
A

$D8

$DB

$DA

$DD

$DC

$DF

$DE

$D1

$D0

$D3

$D2

$D5

$D4

$D7

$D6

$C9

$C8

$CB

$CA

$CD

$CC

$CF

$CE

$C1

$C0

$C3

Standardpasswordsare4bytes(characters)long,althoughtheformatallowsforpasswordsupto9bytes(characters).

FieldType7HintText
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),including
terminating0.
HintText.Canbeupto127bytes.Terminateswith$00.

TheHintTextisASCIIencoded.

FieldType8MapPassword(notencrypted)[NOTUSED]
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),including
terminating0.
Plaintextpassword.Terminateswith$00.

Duplicateoffield6,exceptnotencrypted.PasswordtextisASCIIencoded.Notgenerallyused.

FieldType9[NOTUSED]
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),including
terminating0.
Fielddata

Fieldtype9isnotused.Allotherfieldtypesaretreatedthesameandareignored.

FieldType10MapofMonsters
Offset
+$00(0)

Bytes
1

+$01(1)

+$02(2)

Varies

Description
FieldType
Numberofbytesinthisoptionalfield(notcountingthisbyte),amultipleof
$02bytes.
Monsterrecords

Monsterrecordsconformtothefollowingformat.
Offset
+$00(0)
+$02(2)

Bytes
2
2

Description
MonsterXposition
MonsterYposition

$00$1FarevalidXandYpositionsonthe32x32grid.
UndertheoriginalChipsChallengegame,eachmonsterplacedonthemapmustbelistedinoptionalfield10,otherwise
itwillnotmove.Additionally,amaximumof128monstersisallowed.

ChipsChallengeFileFormatObjectCodes

$00(0)

Empty(Floor)

$02(2)

Artifact

$01(1)

Wall

$03(3)

Water

$04(4)

Fire

$1C(28)

IceCornerSoutheast

$05(5)

InvisibleWall(doesntappear)

$1D(29)

IceCornerSouthwest

$06(6)

ThinWallNorth

$1E(30)

BlueBlock(becomesempty)

$07(7)

ThinWallWest

$1F(31)

BlueBlock(becomeswall)

$08(8)

ThinWallSouth

$20(32)

NOTUSED(actsas$05)

$09(9)

ThinWallEast

$21(33)

Thief

$0A(10)

Block

$22(34)

Gate

$0B(11)

Dirt

$23(35)

ToggleWallButton

$0C(12)

Ice

$24(36)

ClonerButton

$0D(13)

ForceFloorSouth

$25(37)

ToggleWall(on)

$0E(14)

CloneBlockNorth

$26(38)

ToggleWall(off)

$0F(15)

CloneBlockWest

$27(39)

TrapButton

$10(16)

CloneBlockSouth

$28(40)

DumbSentryButton

$11(17)

CloneBlockEast

$29(41)

Teleport

$12(18)

ForceFloorNorth

$2A(42)

Bomb

$13(19)

ForceFloorEast

$2B(43)

Trap

$14(20)

ForceFloorWest

$2C(44)

InvisibleWall(appears)

$15(21)

Exit

$2D(45)

Gravel

$16(22)

BlueDoor

$2E(46)

RetractedWall

$17(23)

RedDoor

$2F(47)

Hint

$18(24)

GreenDoor

$30(48)

ThinWallSoutheast

$19(25)

YellowDoor

$31(49)

Cloner

$1A(26)

IceCornerNorthwest

$32(50)

ForceFloorRandom

$1B(27)

IceCornerNortheast

$33(51)

HeroDrowned

$34(52)

HeroBurned

$4C(76)

DumbSentryNorth

$35(53)

HeroBurned(2)

$4D(77)

DumbSentryWest

$36(54)

NOTUSED(actsas$05)

$4E(78)

DumbSentrySouth

$37(55)

NOTUSED(actsas$05)

$4F(79)

DumbSentryEast

$38(56)

NOTUSED(actsas$05)

$50(80)

LeftSentryNorth

$39(57)

$51(81)

LeftSentryWest

$3A(58)

$52(82)

LeftSentrySouth

$3B(59)

$53(83)

LeftSentryEast

$54(84)

ChaserNorth

$55(85)

ChaserWest

$56(86)

ChaserSouth

$57(87)

ChaserEast

$3C(60)
$3D(61)
$3E(62)
$3F(63)

HeroinExitEndGame
(usedinternally)
ExitEndGame
(usedinternally)
ExitEndGame
(usedinternally)
HeroSwimmingNorth
(usedinternally)
HeroSwimmingWest
(usedinternally)
HeroSwimmingSouth
(usedinternally)
HeroSwimmingEast
(usedinternally)

$40(64)

LeftWallHuggerNorth

$58(88)

RandomSentryNorth

$41(65)

LeftWallHuggerWest

$59(89)

RandomSentryWest

$42(66)

LeftWallHuggerSouth

$5A(90)

RandomSentrySouth

$43(67)

LeftWallHuggerEast

$5B(91)

RandomSentryEast

$44(68)

RightSentryNorth

$5C(92)

RandomNorth

$45(69)

RightSentryWest

$5D(93)

RandomWest

$46(70)

RightSentrySouth

$5E(94)

RandomSouth

$47(71)

RightSentryEast

$5F(95)

RandomEast

$48(72)

SentryNorth

$60(96)

RightWallHuggerNorth

$49(73)

SentryWest

$61(97)

RightWallHuggerWest

$4A(74)

SentrySouth

$62(98)

RightWallHuggerSouth

$4B(75)

SentryEast

$63(99)

RightWallHuggerEast

$64(100)

BlueKey

$6A(106)

IceShoes

$65(101)

RedKey

$6B(107)

ForceShoes

$66(102)

GreenKey

$6C(108)

HeroNorth

$67(103)

YellowKey

$6D(109)

HeroWest

$68(104)

WaterShoes

$6E(110)

HeroSouth

$69(105)

FireShoes

$6F(111)

HeroEast

You might also like