Actions

SCHG

Difference between revisions of "Sonic Adventure/Level Data Formats"

From Sonic Retro

m (moved SCHG:Sonic Adventure/Level Geometry to SCHG:Sonic Adventure/Level Data Formats: page sharing and possible expansion)
m (Text replacement - "__NOTOC__ {{SCHG SA}}" to "{{SCHG SA}} __TOC__")
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
 
 
{{SCHG SA}}
 
{{SCHG SA}}
 +
__TOC__
 
==Disclaimer==
 
==Disclaimer==
 
Each level in [[Sonic Adventure]] is a compiled C++ file with embedded model data. They are usually similar in structure, but there is technically the possibility that some things may be in different locations for different levels.
 
Each level in [[Sonic Adventure]] is a compiled C++ file with embedded model data. They are usually similar in structure, but there is technically the possibility that some things may be in different locations for different levels.
  
 
==LandTable header format==
 
==LandTable header format==
{| class="prettytable"
+
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 version.
 +
{| class="prettytable" style="width:auto;"
 
!Offset||Type||Description
 
!Offset||Type||Description
 
|-
 
|-
Line 18: Line 19:
 
| 4
 
| 4
 
| Int
 
| Int
| Some type of flag, usually 12, 13 indicates the presence of animations.
+
| Flags
 +
{| class="prettytable" style="width:auto;"
 +
!Bit||Value (hex)||Description
 +
|-
 +
| 0
 +
| 1
 +
| Has animations
 +
|-
 +
| 1
 +
| 2
 +
| Has texture list
 +
|-
 +
| 4
 +
| 8
 +
| Has texture name
 +
|}
 
|-
 
|-
 
| 8
 
| 8
Line 50: Line 66:
 
|}
 
|}
  
==COL Format==
+
==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 0x24 bytes long and works as follows:
 
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 0x24 bytes long and works as follows:
  
{| class="prettytable"
+
{| class="prettytable" style="width:auto;"
 
!Offset||Type||Description
 
!Offset||Type||Description
 
|-
 
|-
Line 81: Line 97:
 
|}
 
|}
  
===Surface Flags===
+
===Surface flags===
 
These flags are not entirely figured out yet, but here's what is known for sure:<br />
 
These flags are not entirely figured out yet, but here's what is known for sure:<br />
 
0x00000001 = Solid<br />
 
0x00000001 = Solid<br />
Line 94: Line 110:
 
0x80000000 = Visible
 
0x80000000 = Visible
  
==Listing of Header locations==
+
==References==
If you wish to use Dude's level rippers with this data, you will have to enter the COL Address in decimal and the COL Count.
+
<references />
 
 
{| class="prettytable"
 
!Name||File||Address||COL Count||COL Address||Anim Count||Anim Address
 
|-
 
| Emerald Coast 1
 
| STG01.bin
 
| 81554
 
| 445
 
| 7D6C0
 
| 0
 
| 0
 
|-
 
| Emerald Coast 2
 
| STG01.bin
 
| DEB60
 
| 152
 
| DD600
 
| 0
 
| 0
 
|-
 
| Emerald Coast 3
 
| STG01.bin
 
| 11DD58
 
| 190
 
| 11C2A0
 
| 0
 
| 0
 
|-
 
| Windy Valley 1
 
| STG02.bin
 
| D7E0
 
| 72
 
| CDC0
 
| 0
 
| 0
 
|-
 
| Windy Valley 2
 
| STG02.bin
 
| DB40
 
| 23
 
| D804
 
| 0
 
| 0
 
|-
 
| Windy Valley 3
 
| STG02.bin
 
| F274
 
| 164
 
| DB64
 
| 0
 
| 0
 
|}
 
  
 
{{SCHGuides}}
 
{{SCHGuides}}
[[Category:Sonic Community Hacking Guide]]
 

Latest revision as of 04:32, 25 March 2020

SCHG: Sonic Adventure
Dreamcast
Gamecube
2004 PC
2010 PC

Disclaimer

Each level in Sonic Adventure is a compiled C++ file with embedded model data. They are usually similar in structure, but there is technically the possibility that some things may be in different locations for different levels.

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 version.

Offset Type Description
0 Short COL Count
2 Short Anim Count
4 Int Flags
Bit Value (hex) Description
0 1 Has animations
1 2 Has texture list
4 8 Has texture name
8 Float Unknown, usually 3000
C Pointer COL List
10 Pointer Anim List
14 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.

18 Pointer Texture List
1C Int Unknown
20 Int Unknown

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 0x24 bytes long and works as follows:

Offset Type Description
0 Float[3] Center of collision sphere
C Float Radius of collision sphere
10 8 Bytes Padding?
18 Pointer Model (OBJECT Struct)
1C Int Unknown
20 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 (overrides solid flag, makes surface transparent)
0x00000004 = No Friction
0x00000008 = No Acceleration
0x00000080 = Increased Acceleration
0x00000100 = Diggable
0x00001000 = Unclimbable
0x00010000 = Hurt
0x00100000 = Footprints
0x80000000 = Visible

References


Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | 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 | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
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 | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information