Sonic Adventure 2/Model Formats
From Sonic Retro
SCHG: Sonic Adventure 2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Dreamcast GameCube PC | ||||||||||||
|
The following is a breakdown of the model information used by all versions of Sonic Adventure 2.
Please make note of the version of the game that's being examined, as the byte order varies depending on the game and the file. The Dreamcast version of SA2 and the EXE/DLL of SA2 PC store their data in Little Endian, while SA2B and the rest of SA2 PC is in Big Endian.
The base addresses for models are as follows:
SA2 DC 1STREAD: 0x8C010000
SA2 DC STG Files: 0x8C500000
SA2 PC EXE: 0x402600
SA2 PC Data_DLL: 0x10002000
Contents
Chunk Model Format
ATTACH struct
Offset | Type | Description | Notes |
---|---|---|---|
0 | Pointer | Vertlist | |
4 | Pointer | Polylist | |
8 | Float[3] | Model Center | |
14 | Float | Radius |
OBJECT struct
Offset | Type | Description | Notes |
---|---|---|---|
0 | 4 Bytes | Flags | See section below. |
4 | Pointer | Attach | |
8 | Float[3] | Position | |
14 | Int[3] | Rotation | Signed BAMS (0x10000 = 360°) |
20 | Float[3] | Scale | Ignored for level geometry. |
2C | Pointer | OBJECT Child | |
30 | Pointer | OBJECT Sibling |
GC Model Format
ATTACH Struct
Offset | Type | Description | Notes |
---|---|---|---|
0 | Pointer | Vertlist | |
4 | 4 Bytes | Unknown, tends to be null | |
8 | Pointer | Opaque Polylist | |
C | Pointer | Alpha Polylist | |
10 | Short | Opaque Poly Count | |
12 | Short | Alpha Poly Count | |
14 | Float[3] | Model Center | |
20 | Float | Radius |
OBJECT struct
OBJECT Flags
These flags have (or don't have) various effects on how the model data is used.
Bit | Value (hex) | Description |
---|---|---|
0 | 1 | Don't apply position values. Seems to have no actual effect. |
1 | 2 | Don't apply rotation values. Seems to have no actual effect. |
2 | 4 | Don't apply scale values. Seems to have no actual effect. |
3 | 8 | Don't render this model. Does not affect level geometry. |
4 | 10 | Don't process children. Seems to have no actual effect. |
5 | 20 | Rotation values are in ZYX order. Seems to have no actual effect. |
6 | 40 | Don't include this model for animations. |
7 | 80 | Don't include this model for morphs. |
References