Sonic Heroes/Visibility Editing
From Sonic Retro
Revision as of 02:24, 8 June 2016 by Igorseabra4 (talk | contribs) (Created page with "{{SCHG SH}} Visibility data for level models is set in sLL_blk.bin files located in the dvdroot folder. They are little endian binary files which define boundary boxes. When...")
SCHG: Sonic Heroes |
---|
Main Article |
Mechanic Editing |
DOL Editing |
Model Editing |
Collision Format Model Format |
Level Editing |
Camera Editing |
Particle Editing |
Particle Editing |
Sound Editing |
Music List |
SCHG How-Tos |
Custom Object Material Effect Tutorial |
Visibility data for level models is set in sLL_blk.bin files located in the dvdroot folder. They are little endian binary files which define boundary boxes. When the camera is inside the box (its XYZ coordinates fit inside the specified maximums and minimums), the specified chunk of level geometry (loaded from the BSP files packed inside the sLL.one file) is rendered.
File Layout
Each sLL_blk.bin file contains 64 (0x40) entries for boundary boxes, which seems to be the maximum. Most levels are split into 5 to 15 chunk, so usually the majority of those entries is left unused.
Each entry is 0x1B bytes long and is set like this:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 {00 00 00 00
Offset | Type | Description |
---|---|---|
0x00 | Long | Chunk number |
0x04 | Long | Minimum X |
0x08 | Long | Minimum Y |
0x0C | Long | Minimum Z |
0x10 | Long | Maximum X |
0x14 | Long | Maximum Y |
0x18 | Long | Maximum Z |
The XYZ coordinates for the maximum and minimum of the boundary boxes are not floats. They are read the following way:
- If the first word of the long is 0x0000, then the second word is loaded as the coordinate as a positive integer
- If the first word of the long is 0xFFFF, then the second word is subtracted from 0x10000 (65536 in dec) and the result is loaded as the coordinate as a negative integer
This means that 65536 units to either positive or negative directions in any of the three axes is the maximum distance for the game to be able to render the level model. It is possible to pass those distances with the characters, though.
The same chunk can be specified to load from more than one entry, and multiple chunks can be loaded at the same time from overlapping boxes.
Note that the chunks are specified in the form of SLL_XX_NN.BSP files located in the sLL.one file. LL is the level number, XX are letters that identify which part of the geometry is in that file (ground, walls, detail, skybox, water) and NN is the chunk number. All files with the same number make up the same chunk and are loaded at the same time