Difference between revisions of "Sonic Adventure 2/Level Data Formats"
From Sonic Retro
ShadowBlitz (talk | contribs) (→Dreamcast Lighting Data) |
m (Text replacement - "__NOTOC__ {{SCHG SA2}}" to "{{SCHG SA2}} __TOC__") |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
{{SCHG SA2}} | {{SCHG SA2}} | ||
− | + | __TOC__ | |
==LandTable header format== | ==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. | 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. | ||
− | {| class="prettytable" | + | {| class="prettytable" style="width:65%" |
!Offset||Type||Description | !Offset||Type||Description | ||
|- | |- | ||
Line 37: | Line 36: | ||
| 18 | | 18 | ||
| Pointer | | Pointer | ||
− | | Texture file name. Optional. | + | | 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. |
− | If not null, a PVM with this name will be loaded to the address pointed to by the texture list pointer. | ||
|- | |- | ||
| 1C | | 1C | ||
Line 46: | Line 44: | ||
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. | 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 | + | ==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: | 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: | ||
− | {| class="prettytable" | + | {| class="prettytable" style="width:40%" |
!Offset||Type||Description | !Offset||Type||Description | ||
|- | |- | ||
Line 73: | Line 71: | ||
|} | |} | ||
− | ===Surface | + | ===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 93: | Line 91: | ||
0x80000000 = Visible | 0x80000000 = Visible | ||
− | + | ===Dreamcast Lighting data=== | |
− | ===Dreamcast Lighting | ||
0x20 bytes long. This is for lighting stored in stgXX_light.bin files. It begins with a direction vector (can be any length) followed by a float related to color multiplication and an ARGB color in floats. Direction vector should be thought of as moving from the point provided towards 0,0,0. Colors and/or multipliers should use the range 0-1F. Seems to always contain 12 sections. | 0x20 bytes long. This is for lighting stored in stgXX_light.bin files. It begins with a direction vector (can be any length) followed by a float related to color multiplication and an ARGB color in floats. Direction vector should be thought of as moving from the point provided towards 0,0,0. Colors and/or multipliers should use the range 0-1F. Seems to always contain 12 sections. | ||
− | {| class="prettytable" | + | {| class="prettytable" style="width:30%" |
!Number||Type||Description | !Number||Type||Description | ||
|- | |- | ||
Line 133: | Line 130: | ||
|} | |} | ||
− | ===Gamecube Lighting | + | ===Gamecube Lighting data=== |
− | 0x30 bytes long. This is for lighting stored in stgXX_light_gc.bin files. Seemingly a way to extend the original lighting format using many of the same principles. Unlike | + | 0x30 bytes long. This is for lighting stored in stgXX_light_gc.bin files. Seemingly a way to extend the original lighting format using many of the same principles. Unlike Dreamcast lighting, it can hold 2 colors and does not use a multiplier value, instead relying solely on the color values for both. The first color is the directional while the second is the ambient. Following this is a u32 int flag which should be set to 0 unless you wish to ignore the data for that struct and use what the game loads for the Dreamcast version of the file from that section instead. If the Dreamcast file does not exist, parts of objects in that section that receive lighting will black from lack of lighting. Seems to always contain 12 sections to match with what it can override from its DC counterpart. |
− | {| class="prettytable" | + | {| class="prettytable" style="width:50%" |
!Number||Type||Description | !Number||Type||Description | ||
|- | |- | ||
Line 187: | Line 184: | ||
| Unknown value; Leaving as 0 seems fine. | | Unknown value; Leaving as 0 seems fine. | ||
|} | |} | ||
+ | |||
+ | ===Light Data Usage=== | ||
+ | The following is a list of each stage and the lighting files they utilize, if applicable. | ||
+ | |||
+ | *<span style="color:#FF0000">Red</span>: File is called, but does not exist on DC | ||
+ | *<span style="color:#FFFF00">Yellow</span>: File is called, but does not exist in SA2B | ||
+ | |||
+ | {| class="prettytable" style="width:50%" | ||
+ | !Stage||File | ||
+ | |- | ||
+ | | Green Forest | ||
+ | | STG03_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | White Jungle | ||
+ | | STG04_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Pumpkin Hill | ||
+ | | STG05_LIGHT(_GC) | ||
+ | |- | ||
+ | | Sky Rail | ||
+ | | STG06_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Aquatic Mine | ||
+ | | STG07_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Security Hall | ||
+ | | STG08_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Prison Lane | ||
+ | | STG09_LIGHT(_GC) | ||
+ | |- | ||
+ | | Metal Harbor | ||
+ | | STG10_LIGHT(_GC) | ||
+ | |- | ||
+ | | Iron Gate | ||
+ | | STG11_LIGHT(_GC) | ||
+ | |- | ||
+ | | Weapons Bed | ||
+ | | STG12_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | City Escape | ||
+ | | STG13_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Radical Highway | ||
+ | | STG14_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Weapons Bed 2P | ||
+ | | STG15_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Mission Street | ||
+ | | STG16_LIGHT(_GC) | ||
+ | |- | ||
+ | | Wild Canyon | ||
+ | | STG17_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Dry Lagoon | ||
+ | | STG18_LIGHT(_GC) | ||
+ | |- | ||
+ | | Sonic vs. Shadow 1 | ||
+ | | N/A | ||
+ | |- | ||
+ | | Tails vs. Eggman 1 | ||
+ | | STG20_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Sand Ocean | ||
+ | | STG21_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Crazy Gadget | ||
+ | | STG22_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Hidden Base | ||
+ | | STG23_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Eternal Engine | ||
+ | | STG24_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Death Chamber | ||
+ | | STG25_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Egg Quarters | ||
+ | | STG26_LIGHT(_GC) | ||
+ | |- | ||
+ | | Lost Colony | ||
+ | | STG27_LIGHT(_GC) | ||
+ | |- | ||
+ | | Pyramid Cave | ||
+ | | STG28_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Tails vs. Eggman 2 | ||
+ | | N/A | ||
+ | |- | ||
+ | | Final Rush | ||
+ | | STG30_LIGHT(_GC) | ||
+ | |- | ||
+ | | Green Hill | ||
+ | | STG31_LIGHT(_GC) | ||
+ | |- | ||
+ | | Meteor Herd | ||
+ | | STG32_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Knuckles vs. Rouge | ||
+ | | N/A | ||
+ | |- | ||
+ | | Cannon's Core (Sonic) | ||
+ | | STG34_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Cannon's Core (Eggman) | ||
+ | | STG35_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Cannon's Core (Tails) | ||
+ | | STG36_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Cannon's Core (Rouge) | ||
+ | | STG37_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Cannon's Core (Knuckles) | ||
+ | | STG38_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Mission Street 2P | ||
+ | | STG39_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Final Chase | ||
+ | | STG40_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Wild Canyon 2P | ||
+ | | STG41_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Sonic vs. Shadow 2 | ||
+ | | STG42_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Cosmic Wall | ||
+ | | STG43_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Mad Space | ||
+ | | STG44_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Sand Ocean 2P | ||
+ | | STG45_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Dry Lagoon 2P (SA2B) | ||
+ | | STG46_LIGHT(_GC) | ||
+ | |- | ||
+ | | Pyramid Race (SA2B) | ||
+ | | STG47_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Hidden Base 2P (SA2B) | ||
+ | | STG48_LIGHT(_GC) | ||
+ | |- | ||
+ | | Pool Quest (SA2B) | ||
+ | | STG49_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Planet Quest (SA2B) | ||
+ | | STG50_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Deck Race (SA2B) | ||
+ | | STG51_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Downtown Race (SA2B) | ||
+ | | STG13_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Cosmic Wall 2P (SA2B) | ||
+ | | STG43_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Grind Race (SA2B) | ||
+ | | STG54_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Lost Colony 2P (SA2B) | ||
+ | | <span style="color:#FFFF00">STG55_LIGHT</span>(_GC) | ||
+ | |- | ||
+ | | Eternal Engine 2P (SA2B) | ||
+ | | <span style="color:#FFFF00">STG29_LIGHT</span>(_GC) | ||
+ | |- | ||
+ | | Metal Harbor 2P (SA2B) | ||
+ | | STG10_LIGHT(_GC) | ||
+ | |- | ||
+ | | Iron Gate 2P (SA2B) | ||
+ | | STG58_LIGHT(_GC) | ||
+ | |- | ||
+ | | Death Chamber 2P (SA2B) | ||
+ | | STG59_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | Big Foot | ||
+ | | <span style="color:#FF0000">STG50_LIGHT</span>(DC)/ <span style="color:#FFFF00">STG60_LIGHT</span>(_GC)(SA2B) | ||
+ | |- | ||
+ | | Hot Shot | ||
+ | | <span style="color:#FF0000">STG50_LIGHT</span>(DC)/ <span style="color:#FFFF00">STG61_LIGHT</span>(_GC)(SA2B) | ||
+ | |- | ||
+ | | Flying Dog | ||
+ | | <span style="color:#FF0000">STG50_LIGHT</span> (DC only) | ||
+ | |- | ||
+ | | King Boom Boo | ||
+ | | <span style="color:#FF0000">STG50_LIGHT</span> (DC only) | ||
+ | |- | ||
+ | | Egg Golem (Sonic) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Biolizard | ||
+ | | STGBL1_LIGHT(<span style="color:#FFFF00">_GC</span>) | ||
+ | |- | ||
+ | | FinalHazard | ||
+ | | STG56_LIGHT(DC)/ STG66_LIGHT(<span style="color:#FFFF00">_GC</span>)(SA2B) | ||
+ | |- | ||
+ | | Egg Golem (Eggman) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Route 101/280 | ||
+ | | N/A | ||
+ | |- | ||
+ | | Kart Racing | ||
+ | | N/A | ||
+ | |- | ||
+ | | Chao World | ||
+ | | <span style="color:#FF0000">STG50_LIGHT</span> (DC only) | ||
+ | |- | ||
+ | | Chao Garden | ||
+ | | <span style="color:#FF0000">STG50_LIGHT</span>(DC)/ STG13_LIGHT(<span style="color:#FFFF00">_GC</span>)(SA2B) | ||
+ | |} | ||
+ | |||
+ | ===Fog Data (16 and 528 byte versions)=== | ||
+ | There are 2 variations of the fog format with the second 528 byte variant usually being "fogB", though not always. In the PC version, only the initial 16 bytes are used regardless. It is speculated that the remaining data in 528 byte fog files is unused garbage data or related to fog falloff in some way in the Dreamcast release. The format is rather simple, seeming to have two u16 ints as parameters to start, the color, and then then the near and far distance. These seem to affect clipping on certain special bits of geometry like Metal Harbor water. | ||
+ | |||
+ | At the Maximum Fog Effect Distance from the player, geometry will be purely the color picked for the fog. Up to that point from the Minimum Fog Effect Distance, a gradient of fog is made. This is negative in many levels to make the fog more dense close to the player. | ||
+ | |||
+ | {| class="prettytable" style="width:40%" | ||
+ | !Number||Type||Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | U16 Int | ||
+ | | Fog Type (Usually 02) | ||
+ | |- | ||
+ | | 2 | ||
+ | | U16 Int | ||
+ | | Fog Param 2 (Usually 02) | ||
+ | |- | ||
+ | | 4 | ||
+ | | Char Array[4] | ||
+ | | ASCII Color (ARGB), Alpha ignored | ||
+ | |- | ||
+ | | 8 | ||
+ | | Float | ||
+ | | Maximum Fog Effect Distance | ||
+ | |- | ||
+ | | C | ||
+ | | Float | ||
+ | | Minimum Fog Effect Distance | ||
+ | |} | ||
+ | |||
+ | ===Fog File Usage=== | ||
+ | The following is a list of all stages and the fog files they utilize, if applicable. | ||
+ | |||
+ | *<span style="color:#FF0000">Red</span>: File is called, but does not exist in either version | ||
+ | *<span style="color:#FFFF00">Yellow</span>: File is called, but does not exist on DC | ||
+ | *<span style="color:#00FFFF">Aqua</span>: File is called, but does not exist in SA2B | ||
+ | |||
+ | {| class="prettytable" style="width:50%" | ||
+ | !Stage||File | ||
+ | |- | ||
+ | | Green Forest | ||
+ | | <span style="color:#00FFFF">STG03_FOG</span> (SA2B only) | ||
+ | |- | ||
+ | | White Jungle | ||
+ | | STG04_FOG | ||
+ | |- | ||
+ | | Pumpkin Hill | ||
+ | | <span style="color:#00FFFF">STG05_FOG</span> | ||
+ | |- | ||
+ | | Sky Rail | ||
+ | | STG06_FOG | ||
+ | |- | ||
+ | | Aquatic Mine | ||
+ | | STG07_FOG, STG07_FOGB | ||
+ | |- | ||
+ | | Security Hall | ||
+ | | STG08_FOG, STG08_FOGB | ||
+ | |- | ||
+ | | Prison Lane | ||
+ | | STG09_FOG | ||
+ | |- | ||
+ | | Metal Harbor | ||
+ | | STG10_FOG, STG10_FOGB | ||
+ | |- | ||
+ | | Iron Gate | ||
+ | | <span style="color:#00FFFF">STG11_FOG</span>, STG11_FOGB | ||
+ | |- | ||
+ | | Weapons Bed | ||
+ | | STG12_FOG | ||
+ | |- | ||
+ | | City Escape | ||
+ | | <span style="color:#00FFFF">STG13_FOG</span> | ||
+ | |- | ||
+ | | Radical Highway | ||
+ | | <span style="color:#FF0000">STG14_FOG</span> | ||
+ | |- | ||
+ | | Weapons Bed 2P | ||
+ | | STG15_FOG | ||
+ | |- | ||
+ | | Mission Street | ||
+ | | N/A | ||
+ | |- | ||
+ | | Wild Canyon | ||
+ | | <span style="color:#FF0000">STG17_FOG</span> | ||
+ | |- | ||
+ | | Dry Lagoon | ||
+ | | STG18_FOG, STG18_FOGB (B is only called on DC) | ||
+ | |- | ||
+ | | Sonic vs. Shadow 1 | ||
+ | | <span style="color:#00FFFF">STG19_FOG</span> | ||
+ | |- | ||
+ | | Tails vs. Eggman 1 | ||
+ | | <span style="color:#FF0000">STG20_FOG</span> | ||
+ | |- | ||
+ | | Sand Ocean | ||
+ | | STG21_FOG | ||
+ | |- | ||
+ | | Crazy Gadget | ||
+ | | STG22_FOG | ||
+ | |- | ||
+ | | Hidden Base | ||
+ | | STG23_FOG | ||
+ | |- | ||
+ | | Eternal Engine | ||
+ | | STG24_FOGA | ||
+ | |- | ||
+ | | Death Chamber | ||
+ | | STG25_FOG, STG25_FOGB (B is only called on DC) | ||
+ | |- | ||
+ | | Egg Quarters | ||
+ | | STG26_FOG, STG26_FOGB, STG26_FOGC (B and C are only called on DC) | ||
+ | |- | ||
+ | | Lost Colony | ||
+ | | STG27_FOG, STG27_FOGB | ||
+ | |- | ||
+ | | Pyramid Cave | ||
+ | | STG28_FOG | ||
+ | |- | ||
+ | | Tails vs. Eggman 2 | ||
+ | | <span style="color:#FF0000">STG29_FOG</span> | ||
+ | |- | ||
+ | | Final Rush | ||
+ | | STG30_FOGA, STG30_FOGB | ||
+ | |- | ||
+ | | Green Hill | ||
+ | | N/A | ||
+ | |- | ||
+ | | Meteor Herd | ||
+ | | <span style="color:#00FFFF">STG32_FOG</span> (SA2B only) | ||
+ | |- | ||
+ | | Knuckles vs. Rouge | ||
+ | | <span style="color:#FF0000">STG33_FOG</span> | ||
+ | |- | ||
+ | | Cannon's Core (Sonic) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Cannon's Core (Eggman) | ||
+ | | <span style="color:#FFFF00">STG35_FOG</span> (DC only) | ||
+ | |- | ||
+ | | Cannon's Core (Tails) | ||
+ | | <span style="color:#FFFF00">STG36_FOG</span> (DC only) | ||
+ | |- | ||
+ | | Cannon's Core (Rouge) | ||
+ | | <span style="color:#FFFF00">STG37_FOG, STG37_FOGB</span> (DC only) | ||
+ | |- | ||
+ | | Cannon's Core (Knuckles) | ||
+ | | STG38_FOG, STG38_FOGB | ||
+ | |- | ||
+ | | Mission Street 2P | ||
+ | | <span style="color:#FF0000">STG39_FOG</span> | ||
+ | |- | ||
+ | | Final Chase | ||
+ | | <span style="color:#00FFFF">STG40_FOG</span> (SA2B only) | ||
+ | |- | ||
+ | | Wild Canyon 2P | ||
+ | | <span style="color:#FFFF00">STG41_FOG</span> | ||
+ | |- | ||
+ | | Sonic vs. Shadow 2 | ||
+ | | <span style="color:#00FFFF">STG42_FOG</span> | ||
+ | |- | ||
+ | | Cosmic Wall | ||
+ | | <span style="color:#FF0000">STG43_FOGA</span> | ||
+ | |- | ||
+ | | Mad Space | ||
+ | | STG44_FOGA, STG44_FOGB | ||
+ | |- | ||
+ | | Sand Ocean 2P | ||
+ | | STG45_FOG (DC only) | ||
+ | |- | ||
+ | | Dry Lagoon 2P (SA2B) | ||
+ | | STG18_FOG | ||
+ | |- | ||
+ | | Pyramid Race (SA2B) | ||
+ | | STG23_FOG | ||
+ | |- | ||
+ | | Hidden Base 2P (SA2B) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Pool Quest (SA2B) | ||
+ | | STG49_FOG | ||
+ | |- | ||
+ | | Planet Quest (SA2B) | ||
+ | | <span style="color:#00FFFF">STG50_FOGA, STG50_FOGB</span> | ||
+ | |- | ||
+ | | Deck Race (SA2B) | ||
+ | | <span style="color:#00FFFF">STG51_FOG</span> | ||
+ | |- | ||
+ | | Downtown Race (SA2B) | ||
+ | | <span style="color:#00FFFF">STG52_FOG</span> | ||
+ | |- | ||
+ | | Cosmic Wall 2P (SA2B) | ||
+ | | <span style="color:#00FFFF">STG53_FOG</span> | ||
+ | |- | ||
+ | | Grind Race (SA2B) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Lost Colony 2P (SA2B) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Eternal Engine 2P (SA2B) | ||
+ | | <span style="color:#00FFFF">STG29_FOG</span> | ||
+ | |- | ||
+ | | Metal Harbor 2P (SA2B) | ||
+ | | STG10_FOG, STG10_FOGB | ||
+ | |- | ||
+ | | Iron Gate 2P (SA2B) | ||
+ | | <span style="color:#00FFFF">STG58_FOG</span> | ||
+ | |- | ||
+ | | Death Chamber 2P (SA2B) | ||
+ | | STG25_FOG | ||
+ | |- | ||
+ | | Big Foot | ||
+ | | N/A | ||
+ | |- | ||
+ | | Hot Shot | ||
+ | | N/A | ||
+ | |- | ||
+ | | Flying Dog | ||
+ | | <span style="color:#00FFFF">STGFD_FOG</span> | ||
+ | |- | ||
+ | | King Boom Boo | ||
+ | | N/A | ||
+ | |- | ||
+ | | Egg Golem (Sonic) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Biolizard | ||
+ | | N/A | ||
+ | |- | ||
+ | | FinalHazard | ||
+ | | N/A | ||
+ | |- | ||
+ | | Egg Golem (Eggman) | ||
+ | | N/A | ||
+ | |- | ||
+ | | Route 101/280 | ||
+ | | CART_FOG (SA2B only) | ||
+ | |- | ||
+ | | Kart Racing | ||
+ | | N/A | ||
+ | |- | ||
+ | | Chao World | ||
+ | | N/A | ||
+ | |- | ||
+ | | Chao Garden | ||
+ | | N/A | ||
+ | |} | ||
+ | |||
+ | ==References== | ||
+ | <references /> | ||
{{SCHGuides}} | {{SCHGuides}} |
Latest revision as of 04:30, 25 March 2020
SCHG: Sonic Adventure 2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Dreamcast GameCube PC | ||||||||||||
|
Contents
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
Dreamcast Lighting data
0x20 bytes long. This is for lighting stored in stgXX_light.bin files. It begins with a direction vector (can be any length) followed by a float related to color multiplication and an ARGB color in floats. Direction vector should be thought of as moving from the point provided towards 0,0,0. Colors and/or multipliers should use the range 0-1F. Seems to always contain 12 sections.
Number | Type | Description |
---|---|---|
0 | Float | X Vector Component |
4 | Float | Y Vector Component |
8 | Float | Z Vector Component |
C | Float | Color Multiplier |
10 | Float | Alpha (Color Multiplier) |
14 | Float | Red |
18 | Float | Green |
1C | Float | Blue |
Gamecube Lighting data
0x30 bytes long. This is for lighting stored in stgXX_light_gc.bin files. Seemingly a way to extend the original lighting format using many of the same principles. Unlike Dreamcast lighting, it can hold 2 colors and does not use a multiplier value, instead relying solely on the color values for both. The first color is the directional while the second is the ambient. Following this is a u32 int flag which should be set to 0 unless you wish to ignore the data for that struct and use what the game loads for the Dreamcast version of the file from that section instead. If the Dreamcast file does not exist, parts of objects in that section that receive lighting will black from lack of lighting. Seems to always contain 12 sections to match with what it can override from its DC counterpart.
Number | Type | Description |
---|---|---|
0 | Float | X Vector Component |
4 | Float | Y Vector Component |
8 | Float | Z Vector Component |
C | Float | Red (Directional) |
10 | Float | Green (Directional) |
14 | Float | Blue (Directional) |
18 | Float | Red (Ambient) |
1C | Float | Green (Ambient) |
20 | Float | Blue (Ambient) |
24 | U32 Int | DC override flag |
28 | U32 Int | Unused? Leaving as 0 seems fine. |
2C | U32 Unk | Unknown value; Leaving as 0 seems fine. |
Light Data Usage
The following is a list of each stage and the lighting files they utilize, if applicable.
- Red: File is called, but does not exist on DC
- Yellow: File is called, but does not exist in SA2B
Stage | File |
---|---|
Green Forest | STG03_LIGHT(_GC) |
White Jungle | STG04_LIGHT(_GC) |
Pumpkin Hill | STG05_LIGHT(_GC) |
Sky Rail | STG06_LIGHT(_GC) |
Aquatic Mine | STG07_LIGHT(_GC) |
Security Hall | STG08_LIGHT(_GC) |
Prison Lane | STG09_LIGHT(_GC) |
Metal Harbor | STG10_LIGHT(_GC) |
Iron Gate | STG11_LIGHT(_GC) |
Weapons Bed | STG12_LIGHT(_GC) |
City Escape | STG13_LIGHT(_GC) |
Radical Highway | STG14_LIGHT(_GC) |
Weapons Bed 2P | STG15_LIGHT(_GC) |
Mission Street | STG16_LIGHT(_GC) |
Wild Canyon | STG17_LIGHT(_GC) |
Dry Lagoon | STG18_LIGHT(_GC) |
Sonic vs. Shadow 1 | N/A |
Tails vs. Eggman 1 | STG20_LIGHT(_GC) |
Sand Ocean | STG21_LIGHT(_GC) |
Crazy Gadget | STG22_LIGHT(_GC) |
Hidden Base | STG23_LIGHT(_GC) |
Eternal Engine | STG24_LIGHT(_GC) |
Death Chamber | STG25_LIGHT(_GC) |
Egg Quarters | STG26_LIGHT(_GC) |
Lost Colony | STG27_LIGHT(_GC) |
Pyramid Cave | STG28_LIGHT(_GC) |
Tails vs. Eggman 2 | N/A |
Final Rush | STG30_LIGHT(_GC) |
Green Hill | STG31_LIGHT(_GC) |
Meteor Herd | STG32_LIGHT(_GC) |
Knuckles vs. Rouge | N/A |
Cannon's Core (Sonic) | STG34_LIGHT(_GC) |
Cannon's Core (Eggman) | STG35_LIGHT(_GC) |
Cannon's Core (Tails) | STG36_LIGHT(_GC) |
Cannon's Core (Rouge) | STG37_LIGHT(_GC) |
Cannon's Core (Knuckles) | STG38_LIGHT(_GC) |
Mission Street 2P | STG39_LIGHT(_GC) |
Final Chase | STG40_LIGHT(_GC) |
Wild Canyon 2P | STG41_LIGHT(_GC) |
Sonic vs. Shadow 2 | STG42_LIGHT(_GC) |
Cosmic Wall | STG43_LIGHT(_GC) |
Mad Space | STG44_LIGHT(_GC) |
Sand Ocean 2P | STG45_LIGHT(_GC) |
Dry Lagoon 2P (SA2B) | STG46_LIGHT(_GC) |
Pyramid Race (SA2B) | STG47_LIGHT(_GC) |
Hidden Base 2P (SA2B) | STG48_LIGHT(_GC) |
Pool Quest (SA2B) | STG49_LIGHT(_GC) |
Planet Quest (SA2B) | STG50_LIGHT(_GC) |
Deck Race (SA2B) | STG51_LIGHT(_GC) |
Downtown Race (SA2B) | STG13_LIGHT(_GC) |
Cosmic Wall 2P (SA2B) | STG43_LIGHT(_GC) |
Grind Race (SA2B) | STG54_LIGHT(_GC) |
Lost Colony 2P (SA2B) | STG55_LIGHT(_GC) |
Eternal Engine 2P (SA2B) | STG29_LIGHT(_GC) |
Metal Harbor 2P (SA2B) | STG10_LIGHT(_GC) |
Iron Gate 2P (SA2B) | STG58_LIGHT(_GC) |
Death Chamber 2P (SA2B) | STG59_LIGHT(_GC) |
Big Foot | STG50_LIGHT(DC)/ STG60_LIGHT(_GC)(SA2B) |
Hot Shot | STG50_LIGHT(DC)/ STG61_LIGHT(_GC)(SA2B) |
Flying Dog | STG50_LIGHT (DC only) |
King Boom Boo | STG50_LIGHT (DC only) |
Egg Golem (Sonic) | N/A |
Biolizard | STGBL1_LIGHT(_GC) |
FinalHazard | STG56_LIGHT(DC)/ STG66_LIGHT(_GC)(SA2B) |
Egg Golem (Eggman) | N/A |
Route 101/280 | N/A |
Kart Racing | N/A |
Chao World | STG50_LIGHT (DC only) |
Chao Garden | STG50_LIGHT(DC)/ STG13_LIGHT(_GC)(SA2B) |
Fog Data (16 and 528 byte versions)
There are 2 variations of the fog format with the second 528 byte variant usually being "fogB", though not always. In the PC version, only the initial 16 bytes are used regardless. It is speculated that the remaining data in 528 byte fog files is unused garbage data or related to fog falloff in some way in the Dreamcast release. The format is rather simple, seeming to have two u16 ints as parameters to start, the color, and then then the near and far distance. These seem to affect clipping on certain special bits of geometry like Metal Harbor water.
At the Maximum Fog Effect Distance from the player, geometry will be purely the color picked for the fog. Up to that point from the Minimum Fog Effect Distance, a gradient of fog is made. This is negative in many levels to make the fog more dense close to the player.
Number | Type | Description |
---|---|---|
0 | U16 Int | Fog Type (Usually 02) |
2 | U16 Int | Fog Param 2 (Usually 02) |
4 | Char Array[4] | ASCII Color (ARGB), Alpha ignored |
8 | Float | Maximum Fog Effect Distance |
C | Float | Minimum Fog Effect Distance |
Fog File Usage
The following is a list of all stages and the fog files they utilize, if applicable.
- Red: File is called, but does not exist in either version
- Yellow: File is called, but does not exist on DC
- Aqua: File is called, but does not exist in SA2B
Stage | File |
---|---|
Green Forest | STG03_FOG (SA2B only) |
White Jungle | STG04_FOG |
Pumpkin Hill | STG05_FOG |
Sky Rail | STG06_FOG |
Aquatic Mine | STG07_FOG, STG07_FOGB |
Security Hall | STG08_FOG, STG08_FOGB |
Prison Lane | STG09_FOG |
Metal Harbor | STG10_FOG, STG10_FOGB |
Iron Gate | STG11_FOG, STG11_FOGB |
Weapons Bed | STG12_FOG |
City Escape | STG13_FOG |
Radical Highway | STG14_FOG |
Weapons Bed 2P | STG15_FOG |
Mission Street | N/A |
Wild Canyon | STG17_FOG |
Dry Lagoon | STG18_FOG, STG18_FOGB (B is only called on DC) |
Sonic vs. Shadow 1 | STG19_FOG |
Tails vs. Eggman 1 | STG20_FOG |
Sand Ocean | STG21_FOG |
Crazy Gadget | STG22_FOG |
Hidden Base | STG23_FOG |
Eternal Engine | STG24_FOGA |
Death Chamber | STG25_FOG, STG25_FOGB (B is only called on DC) |
Egg Quarters | STG26_FOG, STG26_FOGB, STG26_FOGC (B and C are only called on DC) |
Lost Colony | STG27_FOG, STG27_FOGB |
Pyramid Cave | STG28_FOG |
Tails vs. Eggman 2 | STG29_FOG |
Final Rush | STG30_FOGA, STG30_FOGB |
Green Hill | N/A |
Meteor Herd | STG32_FOG (SA2B only) |
Knuckles vs. Rouge | STG33_FOG |
Cannon's Core (Sonic) | N/A |
Cannon's Core (Eggman) | STG35_FOG (DC only) |
Cannon's Core (Tails) | STG36_FOG (DC only) |
Cannon's Core (Rouge) | STG37_FOG, STG37_FOGB (DC only) |
Cannon's Core (Knuckles) | STG38_FOG, STG38_FOGB |
Mission Street 2P | STG39_FOG |
Final Chase | STG40_FOG (SA2B only) |
Wild Canyon 2P | STG41_FOG |
Sonic vs. Shadow 2 | STG42_FOG |
Cosmic Wall | STG43_FOGA |
Mad Space | STG44_FOGA, STG44_FOGB |
Sand Ocean 2P | STG45_FOG (DC only) |
Dry Lagoon 2P (SA2B) | STG18_FOG |
Pyramid Race (SA2B) | STG23_FOG |
Hidden Base 2P (SA2B) | N/A |
Pool Quest (SA2B) | STG49_FOG |
Planet Quest (SA2B) | STG50_FOGA, STG50_FOGB |
Deck Race (SA2B) | STG51_FOG |
Downtown Race (SA2B) | STG52_FOG |
Cosmic Wall 2P (SA2B) | STG53_FOG |
Grind Race (SA2B) | N/A |
Lost Colony 2P (SA2B) | N/A |
Eternal Engine 2P (SA2B) | STG29_FOG |
Metal Harbor 2P (SA2B) | STG10_FOG, STG10_FOGB |
Iron Gate 2P (SA2B) | STG58_FOG |
Death Chamber 2P (SA2B) | STG25_FOG |
Big Foot | N/A |
Hot Shot | N/A |
Flying Dog | STGFD_FOG |
King Boom Boo | N/A |
Egg Golem (Sonic) | N/A |
Biolizard | N/A |
FinalHazard | N/A |
Egg Golem (Eggman) | N/A |
Route 101/280 | CART_FOG (SA2B only) |
Kart Racing | N/A |
Chao World | N/A |
Chao Garden | N/A |
References