PTCL (File Format)

From Zenith
Revision as of 08:19, 22 May 2021 by Aboood40091 (talk | contribs) (Added the emitter set data structure.)
Jump to navigation Jump to search

PTCL is the binary serialization format for nw::eft (NintendoWare Eft Library) particle effect resources.

It has went through several revisions across games. Known versions are 0x28 (New Super Mario Bros. U), 0x41 (Mario Kart 8) and 0x42 (Super Mario Maker and later).


Known magic numbers are SPBD (version 0x28) and EFTF (other known versions).

While it is unknown what the former stands for, the latter stands for "Eft Cafe", where Eft is the name of the library.

Through a debug message left in the library, it has been determined that there exists a separate format for particle effect resources on Windows with a different magic number. The magic number is speculated to be EFTW.


This page documents version 0x28 of the format. For version 0x41 (and possibly version 0x42), visit this page.

File Header

The structure the file begins with. Size is 0x40 bytes.

Offset Data Type Name Description
0x00 char[4] Magic number (SPBD ) This value is not checked in version 0x28 and can be set to anything.
0x04 uint Version -
0x08 uint Number of Emitter Sets The number of emitter sets that follow this header.
0x0C Unknown

4 bytes

Unknown This value is not referenced in the code. Looks to be 0 in all PTCL files I checked.
0x10 uint String / Name Table Offset The offset to a table of null-terminated strings, which are the names of emitters and emitter sets.

Encoding is not known, but it's very likely to be SHIFT-JIS.

0x14 uint Texture Data Table Offset The offset to section where all the raw texture data for emitters is stored.
0x18 uint Texture Data Table Size -
0x1C uint Shader Table Offset The offset to the section that points to all shader sources / binaries.
0x20 uint Shader Table Size -
0x24 uint Keyframe Animation Table Offset -
0x28 uint Keyframe Animation Table Size -
0x2C uint Primitive Table Offset The offset to a table of primitive data that is used by emitters.
0x30 uint Primitive Table Size -
0x34 Unknown

12 bytes

Unknown These 12 bytes are not referenced in the code. Perhaps uncleared padding?

Emitter Set

This structure immediately follows the file header. It is a set of several emitters to create a single effect. Size is 0x1C bytes.

There are as many instances of it as the number of emitter sets defined in the file header.

Offset Data Type Name Description
0x00 uint User Data(?) I never found any references to this value in the Eft library, but it is used by NSMBU's PtclMgr to determine the emitter group to place this emitter set in.
0x04 Unknown

4 bytes

Unknown Never found any references to this value.
0x08 uint Name Offset The offset to the name of this emitter set, relative to the name table specified in the file header.
0x0C char* Name Pointer set at runtime for convenience.
0x10 uint Number of Emitters The number of emitters in the emitter table for this emitter set.
0x14 uint Emitter Table Offset The offset to the emitter table for this emitter set. Offset is absolute.
0x18 Unknown

4 bytes

Unknown This value is not referenced in the code, but guessing from a pattern that exists in this file format, it is probably a pointer to the emitter table for this emitter set.