.n2d files

Discussion in 'NDS - ROM Hacking and Translations' started by aevanko, Jan 6, 2011.

  1. aevanko

    aevanko Newbie

    Sep 28, 2009
    Can someone help me out? I am trying to figure out how to view an .n2d file. It's a background art image but I cannot find any info on how to open it.
  2. drwhojan

    drwhojan GBAtemp Psycho!

    Jul 14, 2009
    United Kingdom
    Where I Am!
    Sound's like a .nds file made .n2d need renaming to .nds for legal resions

    NintendoDS game i mean
  3. rastsan

    rastsan 8 baller, Death Wizard,

    May 28, 2008
    where did you find it(what game)?
    any other details you can give would be appreciated.
  4. aevanko

    aevanko Newbie

    Sep 28, 2009
    It's a 2D image that is used in Ninokuni. It was found in the bg folder for the tutorial screens.
    I think .n3d represents a 3D model and .n2d represents a 2D, but i can't be sure.
  5. Barubary

    Barubary Member

    Feb 27, 2009
    United States
    .n2d is one of two simple archive formats used in the game. .n3d is practically the same;
    * char[4] magic; // "NPCK"
    * u32 dataOffset;
    * u32 numFiles;
    * {
    *ÂÂÂÂÂÂu32 fileStart; // relative to start of file
    *ÂÂÂÂÂÂu32 length; // can be 0 (if so, fileStart is also 0)
    * }[numFiles] FAT;
    * u8* data;
    'numFiles' is not the actual number of files, but the possible number of files. Each .n2d should have the same number as that field. The index of the contained files is determined by their type. For example, the palette (nclr) is always the first file, while the tile maps (nscr) are always the seventh file. If a certain format is not present (buttons do not use nscr), 'fileStart' and 'length' are 0 for the corresponding index.
    The other format is just a generic archive, with magic header 'NCPK'. The only other difference is an extra u32 for each file (before 'fileStart'), of which I haven't figured out the purpose. Some .bin files use this format.

    You should be able to unpack both types of files with this tool (I know I did). Drag and drop any number of files onto it to unpack them. Dragging a folder onto it is the same as dragging all files directly inside the folder onto the program (only goes one level deep; subfolders are not checked).
    More options are available when using the command line. Provide no arguments to see its usage.