Please create an account or Login! Have fun!
User:G-lander/NCCS: Difference between revisions
(Create a mock of the (yet-non-existent) NCCS file format for feedback and stuff) |
(No difference)
|
Revision as of 16:30, 26 May 2021
NCCS (extension being .ncss) is the file format used for storing NotCC level scores and solutions, simiular to the TWS file format.
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.
All data in the file is little-endian.
Format
Section header
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 |
---|---|---|
NCCS | Null-terminated string | The file's version. The latest version is "02". |
FILE | Null-terminated string | The level's (or level set's) file name |
TYPE | Null-terminated string | Usually the name of the levelset. For the base CC2 set it's "Chips Challenge 2". If the level does not have a proper set name (eg. DATs, C2Ms outside of sets), excluded. |
NAME | Null-terminated string | The level's title, excluded if the level has no title. |
MISC | 100 bytes | Level miscellaneous data. The format is identical to the format of the SAVE section in C2H files. |
SLTN/PSLN | Level solution | The recorded level solution, identical to the REPL section of the C2M file, excluding the first three bytes. The PSLN section is compressed, the SLTN section is not. |
STAT | See STAT section below | The state for some level variables |
END | No content (length is 0) | Signifies end of file |
Section packing
"PSLN" sections are packed via the same packing algorithm as C2M.
STAT section
The STAT section contains variables which are most likely to cause a change on the level outcome, contrary to some data in the MISC section, which can only be vital in obscure scenarios.
This section is made up of many sub-sections, each for a single variable, for extensibility.
A single subsection looks like this:
Bytes | Content |
---|---|
1 | The ID of the section |
1 | Length of the section, in bytes. (Multiple sub-sections should be used for larger data) |
Varies | The sub-section data itself |
Here is a list of existing sub-section types:
ID | Length | Data description |
---|---|---|
0x01 | 1 | Random force floor initial direction |
0x02 | 1 | Blob randomness seed |