C2H

Revision as of 17:30, 17 March 2018 by imported>Stubbscroll (added external link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

A C2H file (having the extension .c2h) is the file format where Chip's Challenge 2 stores the best scores and times for each level.

The file is a binary file consisting of several sections one after the other, terminated by the END section. Each section begins with a section header, which is followed by the section's data. Each level in the set that the player has encountered has its own copy of the FILE, TYPE, NAME and SAVE sections.

All data in the file is little-endian.

Section header format

Bytes Content
4 Four character code identifying the section, see table below. Codes shorter than 4 characters (such as "END") are padded with spaces (making "END " in this case).
4 The length of the section's data

Section types

Section ID Content Type Content
CC2H Null-terminated string The file's version. The latest version is "7".
FILE Null-terminated string The level's file name
TYPE Null-terminated string Usually the name of the levelset. For the base game, it's "Chips Challenge 2". In some cases it contains an empty string.
NAME Null-terminated string The level's title
SAVE 100 bytes Miscellaneous data
END No content (length is 0) Signifies end of file

SAVE section

Offset Bytes Content
0x00 4 Line number into c2g file where music and level file name can be found
0x04 4 Some kind of total score, in most cases slightly lower than the actual total score
0x08 4 Highest bonus score achieved (does not include bonus from time left)
... Unknown
0x14 4 Base level score, (level number)*500
0x18 4 Level number
... Unknown
0x30 4 1 if level is solved, 0 if unsolved
... Unknown
0x58 4 Highest level time achieved
0x5c 4 Highest level score achieved (including base level score)
0x60 4 Unknown

External Links