EvilEngine/JAW: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
No edit summary
m (Seil moved page JAW to EvilEngine/JAW)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<onlyinclude>
{{AssetInfobox
{{#vardefine:typeid|JAW}}<nowiki/>
|subtitle=Jaw Data Table
{{#vardefine:name|Jaw Data Table}}<nowiki/>
|type=[[Binary]]
{{#vardefine:type|[[Binary]]}}<nowiki/>
|games=Battle for Bikini Bottom<br>The SpongeBob SquarePants Movie<br>Rise of the Underminer
{{#vardefine:basetype|}}<nowiki/>
|sourcecode=[https://github.com/bfbbdecomp/bfbb/blob/master/src/Core/x/xJaw.h xJaw.h]}}
{{#vardefine:games|BFBB TSSM ROTU}}<nowiki/>
{{#vardefine:sourcecode|[https://github.com/bfbbdecomp/bfbb/blob/master/src/Core/x/xJaw.h xJaw.h]}}<nowiki/>
{{#vardefine:image|}}<nowiki/>
</onlyinclude>
{{AutoAssetInfobox}}


A '''jaw data table''' defines the lip-sync movement for the player/NPCs to use when speaking voicelines. It maps one or more [[Sound Format|sounds]] to an array of open/close mouth positions, which can be generated from the waveform of the sound itself.
A '''jaw data table''' defines the lip-sync movement for the player/NPCs to use when speaking voicelines. It maps one or more [[Sound Format|sounds]] to an array of open/close mouth positions, which can be generated from the waveform of the sound itself.


==Format==
==Format==
The asset data starts with an int which defines the amount of entries in the jaw data table, then a directory containing each entry's offset and size. Each directory entry has the following format:
The asset data starts with an int which defines the amount of entries in the jaw data table, then a table containing each entry's offset and size. Each table entry has the following format:


===xJawDataTable===
{| class="wikitable"
{| class="wikitable"
! Offset !! Type !! Description
! Offset !! Type !! Variable !! Description
|-
|-
| 0x00 || [[AssetID]] ([[SND|Sound]]/[[SNDS|Streaming Sound]]) || '''Sound'''
| 0x00 || [[AssetID]] || '''soundHashID''' || ([[SND|Sound]]/[[SNDS|Streaming Sound]])
|-
|-
| 0x04 || int || '''Offset''' of jaw data (relative to end of directory)
| 0x04 || int || '''dataStart''' || Offset of jaw data (relative to end of directory)
|-
|-
| 0x08 || int || '''Size''' of jaw data (in bytes)
| 0x08 || int || '''dataLength''' || Size of jaw data (in bytes)
|}
|}


After the directory are the entries themselves. Each entry is 4-byte aligned and padded with null (0) bytes. The offsets in the directory are calculated based on this alignment, and the sizes do not include the padding. Each entry has the following format:
After the table are the entries themselves. Each entry is 4-byte aligned and padded with null (0) bytes. The offsets in the table are calculated based on this alignment, and the sizes do not include the padding. Each entry has the following format:


{| class="wikitable"
{| class="wikitable"
! Offset !! Type !! Description
! Offset !! Type !! Description
|-
|-
| 0x00 || int || '''Length''' of jaw data in frames (?) (size - 4). This is little-endian on all platforms.
| 0x00 || int || '''Length''' of jaw data in frames (?) (dataLength - 4). This is little-endian on all platforms.
|-
|-
| 0x04 || byte[Length] || '''Jaw data'''. Each byte represents the speaker's mouth position at the current point in time, from 0 (fully closed) to 255 (fully open).
| 0x04 || byte[Length] || '''Jaw data'''. Each byte represents the speaker's mouth position at the current point in time, from 0 (fully closed) to 255 (fully open).
Line 31: Line 37:


{{Assets}}
{{Assets}}
{{AutoGameNavs}}


[[Category:Asset]]
[[Category:Asset]]

Latest revision as of 22:42, 15 September 2022

JAW
Jaw Data Table
TypeBinary
Games usedBattle for Bikini Bottom

The SpongeBob SquarePants Movie

Rise of the Underminer
Source codexJaw.h

A jaw data table defines the lip-sync movement for the player/NPCs to use when speaking voicelines. It maps one or more sounds to an array of open/close mouth positions, which can be generated from the waveform of the sound itself.

Format

The asset data starts with an int which defines the amount of entries in the jaw data table, then a table containing each entry's offset and size. Each table entry has the following format:

xJawDataTable

Offset Type Variable Description
0x00 AssetID soundHashID (Sound/Streaming Sound)
0x04 int dataStart Offset of jaw data (relative to end of directory)
0x08 int dataLength Size of jaw data (in bytes)

After the table are the entries themselves. Each entry is 4-byte aligned and padded with null (0) bytes. The offsets in the table are calculated based on this alignment, and the sizes do not include the padding. Each entry has the following format:

Offset Type Description
0x00 int Length of jaw data in frames (?) (dataLength - 4). This is little-endian on all platforms.
0x04 byte[Length] Jaw data. Each byte represents the speaker's mouth position at the current point in time, from 0 (fully closed) to 255 (fully open).