Difference between revisions of "NSD"

From Crash Bandicoot Hacking Wiki
Jump to navigation Jump to search
(Created page with "NSD is a custom file format created by Naughty Dog for use in the Crash games. The root directory of a Crash game CD will have several sub-directories, with names S0, S1, S2, ...")
 
m (Crash 1)
Line 107: Line 107:
 
struct NSD
 
struct NSD
 
{
 
{
   unsigned long entryhashoffsets[256];
+
   union
 +
  {
 +
    unsigned long entryhashoffsets[256];
 +
    unsigned long *entryhashbuckets[256];
 +
  }
 
   unsigned long chunkcount;
 
   unsigned long chunkcount;
 
   unsigned long entryhashcount;
 
   unsigned long entryhashcount;

Revision as of 08:31, 26 July 2015

NSD is a custom file format created by Naughty Dog for use in the Crash games. The root directory of a Crash game CD will have several sub-directories, with names S0, S1, S2, and S3; within these sub-directories are pairs of files with the name S00000**.NSD/.NSF. Each pair corresponds to a specific level in the game, and these files contain the game data for that level. An NSD file is essentially an index for its paired NSF file, but in Crash 1 it contains additional information such as a level descriptor/header and a loading screen descriptor.

Format

Crash 1

Offset Field Size Value
0x0 Entry Hash Table Offsets 4 bytes x 256 *
0x400 Chunk Count 4 bytes c
0x404 Entry Hash Table Size 4 bytes s
0x408 Unknown 4 bytes *
0x40C Unknown 4 bytes *
0x410 Unknown 4 bytes *
0x414 Unknown 4 bytes *
0x418 Offset of Uncompressed Chunks 4 bytes *
0x41C Compressed Chunk Count 4 bytes *
0x420 Compressed Chunk Offsets 4 bytes x 64 *
0x520 Entry Hash Table 4 bytes x 2 x s *
0x520 + (8 x s) + 0x0 Level Header Magic Number?? 4 bytes ?
0x520 + (8 x s) + 0x4 Level ID 4 bytes *
0x520 + (8 x s) + 0x8 Initial Zone EID 4 bytes *
0x520 + (8 x s) + 0xC Initial Camera Path (Item Index) 4 bytes *
0x520 + (8 x s) + 0x10 Unknown 4 bytes *
0x520 + (8 x s) + 0x14 Object Type -> Executable EID map 4 bytes x 64 *
? Descriptor for 'loading screen' image ?

Structure

Crash 1

struct NSD
{
  union
  {
    unsigned long entryhashoffsets[256];
    unsigned long *entryhashbuckets[256];
  }
  unsigned long chunkcount;
  unsigned long entryhashcount;
  unsigned long unk_408;
  unsigned long unk_40C;
  unsigned long unk_410;
  unsigned long unk_414;
  unsigned long uncompressedoffset;
  unsigned long compressedcount;
  unsigned long compressedoffsets[64];
  hashpair      entryhash[entryhashcount];
  struct levelheader
  {
    const unsigned long magic = ?
    unsigned long levelID;
    unsigned long firstzone;
    unsigned long firstcampath;
    unsigned long unknown;
    unsigned long execeidmap[64];
  };
};

Purpose

TBD