SMM 2 > Ninji Ghosts

Ninji ghosts are downloaded from the server with the GetEventCourseGhost method. Ninji ghosts are zlib compressed and may use up to 0x8000 bytes.

A decompressed ghost always uses exactly 0x24A36 bytes:

OffsetSizeDescription
0x00x3CFile header
0x3C0x249FAReplay frames

File Header

The header is stored in big endian byte order.

OffsetSizeDescription
0x04Version number (always 2)
0x44Unknown
0x84Unknown
0xC4Time in milliseconds
0x104Unknown
0x141Unknown
0x151Unknown
0x162Unknown
0x184Unknown
0x1C4Unknown
0x204Unknown
0x244Unknown
0x284Unknown
0x2C4Unknown
0x304Unknown
0x344Unknown
0x384Magic number (always SPGD)

Replay Frame

Replay data is stored in little endian byte order. The replay frames are stored directly after each other, with no padding.

OffsetSizeDescription
0x010xAB
A: Flags
B: Player state
0x12X position
0x32Y position

If flags & 4:

OffsetSizeDescription
0x51Unknown

If flags & 2 but not flags & 4:

OffsetSizeDescription
0x51Unknown (X)

If X & 7 != 1:

OffsetSizeDescription
0x62Unknown

Player State

ValueDescription
0Waiting / walking / running
1Jumping
2Swimming
3Climbing
4"hipat"
5Slipping
6"wsld"
7Moving through clear pipe (SM3DW) or riding dry bones shell
8Cat attack (SM3DW) or riding clown car
9Waiting on tree top (SM3DW) or riding lakitu cloud
10Riding goomba shoe (SMB1/SMB3), Koopa Troopa car (SM3DW) or Yoshi
11Walking cat