Sonic Adventure 2/Level Data Formats

From Sonic Retro

SCHG: Sonic Adventure 2

LandTable header format

This struct defines the number of models and animations in the level, the location of the corresponding lists, and the texture list used. The name comes from the label in the DLL Export table of various DLLs in the PC versions of Sonic Adventure DX and Sonic Adventure 2.

Offset Type Description
0 Short COL Count
2 Short Chunk Model Count
4 Int? Unknown
8 Int? Unknown
C Float Unknown, usually 3000
10 Pointer COL List
14 Int? Unknown
18 Pointer Texture file name. Optional.

If not null, a PVM with this name will be loaded to the address pointed to by the texture list pointer.

1C Pointer Texture List

The number of models indicated by the Chunk Model Count will be using the Chunk Model, and any models after that will be using the Basic Model. Generally, the visible models are nonsolid chunk models, and collision is solid basic models. In Battle, the main LandTables use a new model format in place of the Chunk Model.

COL Format

The name COL is an antiquated misnomer, but for lack of a better name, it stuck. This data struct is a reference for loading a level model. It's 0x20 bytes long and works as follows:

Offset Type Description
0 Float[3] Center of collision sphere
C Float Radius of collision sphere
10 Pointer Model (OBJECT Struct)
14 8 Bytes Padding?
1C Int Surface Flags (see below)

Surface Flags

These flags are not entirely figured out yet, but here's what is known for sure:
0x00000001 = Solid
0x00000002 = Water (ignores Solid bit)
0x00000004 = Ice
0x00000008 = Slow
0x00000010 = Less Slow
0x00000020 = Diggable
0x00000080 = Cannot Climb
0x00000100 = Ignore Slope
0x00000400 = Hurt
0x00001000 = Cannot Land Or Climb
0x00002000 = Other Water, Cannot Swim
0x00008000 = Don't Cast Shadow
0x00100000 = Something Weird
0x00400000 = Cannot Land 2
0x01000000 = Very Weird Collision
0x08000000 = Slow, Fall Off Edge, Cannot Climb
0x80000000 = Visible

Sonic Community Hacking Guide
Sonic Music Hacking Guide | SonED2 Manual
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic Eraser | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Nick Arcade prototype) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (8-bit) | Sonic 2 & Knuckles | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Sonic 3 | Sonic & Knuckles | Sonic the Hedgehog 3 & Knuckles | Sonic & Knuckles Collection | Sonic Crackers | Sonic 3D: Flickies' Island | Chaotix | Sonic R PC | Sonic Jam 6 | Sonic Advance | Sonic Advance 2 | Sonic Advance 3 | Sonic Battle | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Shadow the Hedgehog | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Lost World | Sonic Forces
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | Subroutine Equivalency List | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | VDP Documentation | Official Sega 32X Documentation | Official Mega-CD Documentation | Official Sega Mega Drive Documentation