EvilEngine/HIP (File Format): Difference between revisions

no edit summary
(Add new info, reorganize things, improve wording)
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 4:
 
==File Format==
There are three known revisions of the HIP archive format: the first one used in [[:Category:Scooby|Scooby-Doo! Night of 100 Frights]], a second one used in [[:Category:BFBB|SpongeBob SquarePants: Battle For Bikini Bottom]] and a third one which is used in [[:Category:TSSM|The SpongeBob SquarePants Movie]], [[:Category:Incredibles|The Incredibles]] and, [[:Category:ROTU|The Incredibles: Rise of the Underminer]] and [[:Category:RatProto|Ratatouille Prototype]].
<pre>
PKR: HIP file version update history
Version 1:
- baseline
Version 2:
- Compatible version support information
- Asset data checksum
- Layer data checksum
- Creation/Modification date
Version 3:
- HIP Layers represent asset memory placement
- Layers are not compacted to reduce waste
- Loading is based on layers (was by asset)
- Added asynchronous loading support
</pre>
 
===Integers===
Line 27 ⟶ 42:
 
* [[#HIPA|HIPA]]
* [[#PACK|PACK]] (Package)
** [[#PVER|PVER]] (PackageVersion)
** [[#PFLG|PFLG]] (PackageFlags)
** [[#PCNT|PCNT]] (PackageCount)
** [[#PCRT|PCRT]] (PackageCreated)
** [[#PMOD|PMOD]] (PackageModified)
** [[#PLAT|PLAT]] (PackagePlatform) '''[Not present in Scooby)]'''
* [[#DICT|DICT]] (Dictionary)
** [[#ATOC|ATOC]] (AssetTableOfContents)
*** [[#AINF|AINF]] (AssetInfo)
*** [[#AHDR|AHDR]]+ (AssetHeader) '''[Multiple can be present)]'''
**** [[#ADBG|ADBG]] (AssetDebug)
** [[#LTOC|LTOC]] (LayerTableOfContents)
*** [[#LINF|LINF]] (LayerInfo)
*** [[#LHDR|LHDR]]+ (LayerHeader) '''[Multiple can be present)]'''
**** [[#LDBG|LDBG]] (LayerDebug)
* [[#STRM|STRM]] (AssetDataStream)
** [[#DHDR|DHDR]] (AssetDataHeader)
** [[#DPAK|DPAK]] (AssetDataPackage)
 
===Assets===
Assets are the most important part of HIP archives; they're like the files in ZIP archives. Assets hold all of the raw data for textures, models, sounds, and even objects within a level. Assets also have a name, as well as a unique ID (which is generated from the name using a [[Data Types#AssetID|hash algorithm]]). The ID is used by the game to find/identify assets. Assets also have a type ID that tells the game how to interpret the asset's raw data. The asset's data is stored at a specified offset in the [[#DPAK|DPAK]] block. HIP archives do not use any compression for asset data.
 
Each asset entry is represented by an [[#AHDR|AHDR]] block in HIP archives.
 
====Types====
A list of all known asset types can be found here: [[Asset#List of asset types|List of asset types]]
 
===Layers===
Layers are used by HIP archives to group assets of specific types together. Layers have a type ID that specifies what "category" of asset types they contain. For example, <code>TEXTURE</code> layers contain all of the [[RWTX]] assets in a HIP archive and, <code>MODEL</code> layers contain all of the [[MODL]] assets., Assetsand in<code>DEFAULT</code> thelayers samecontain layer have their raw data stored next to each other in the [[#DPAK|DPAK]] block. This is mainly used to optimize themany memorydifferent layouttypes of assets in-game, as well as enforce the order in which assets are loaded (e.g.most <code>TEXTURE.HIP</code> layersfiles musthave beall storedtheir beforeassets in the <code>MODELDEFAULT</code> in order for textures to be applied to models properlylayer).
 
Assets in the same layer have their raw data stored next to each other in the [[#DPAK|DPAK]] block. This is mainly done to optimize the memory layout of assets in-game, as well as enforce the order in which assets are loaded (e.g. <code>TEXTURE</code> layers must be stored before <code>MODEL</code> in order for textures to be applied to models properly).
 
Each layer entry is represented by an [[#LHDR|LHDR]] block in HIP archives.
 
====Types====
The following table lists all known layer types and their corresponding type IDs in each game. An empty cell means the layer type is not present in the game.
 
{| class="wikitable"
! Name !! [[:Category:Scooby|Scooby]] !! [[:Category:BFBB|BFBB]] !! [[:Category:TSSM|TSSM]] !! [[:Category:Incredibles|Incredibles]] !! [[:Category:ROTU|ROTU]] !! [[:Category:Ratatouille_prototypes|RatProto]]
|-
| DEFAULT || 0colspan="6" || 0style="text-align:center" || 0 || 0 || 0
|-
| TEXTURE || 1colspan="6" ||style="text-align:center" 1 || 1 || 1 || 1
|-
| TEXTURE_STRM || |colspan="2" | || 2colspan="4" ||style="text-align:center" 2 || 2
|-
| BSP || colspan="2" style="text-align:center" || 2 || 3colspan="4" ||style="text-align:center" 3 || 3
|-
| MODEL || 3colspan="2" style="text-align:center" || 3 || colspan="4" ||style="text-align:center" 4 || 4
|-
| ANIMATION || 4colspan="2" style="text-align:center" || 4 || 5colspan="4" ||style="text-align:center" 5 || 5
|-
| VRAM || 5colspan="2" style="text-align:center" || 5 || 6colspan="4" ||style="text-align:center" 6 || 6
|-
| SRAM || 6colspan="2" style="text-align:center" || 6 || 7colspan="4" ||style="text-align:center" 7 || 7
|-
| SNDTOC || 7colspan="2" style="text-align:center" || 7 || 8colspan="4" ||style="text-align:center" 8 || 8
|-
| CUTSCENE || 8colspan="2" style="text-align:center" || 8 || 9colspan="4" ||style="text-align:center" 9 || 9
|-
| CUTSCENETOC || 9colspan="2" style="text-align:center" || 9 || 10colspan="4" ||style="text-align:center" 10 || 10
|-
| JSPINFO || || 10style="text-align:center" || 1110 || 11colspan="4" style="text-align:center" || 11
|}
 
Line 177 ⟶ 202:
| TEXTURE || 3 || HOP: [[RWTX]]
|-
| TEXTURE_STRM || 1 || HIP: [[BINK]], [[TEXS]], [[WIRE]]
|-
| BSP || 3 || HOP: [[JSP]] (RpClump)
Line 187 ⟶ 212:
| ANIMATION || 1 ||
|-
| DEFAULT || 1 || HIP: [[ALST]], [[ATBL]], [[ATKT]], [[BOUL]], [[BUTN]], [[CAM]], [[CNTR]], [[COND]], [[CSNM]], [[DPAT]], [[DUPC]], [[DYNA]], [[ENV]], [[FOG]], [[GRUP]], [[LKIT]], [[MINF]], [[MRKR]], [[MVPT]], [[NPCS]], [[ONEL]], [[PGRS]], [[PICK]], [[PLAT]], [[PLYR]], [[PORT]], [[RANM]], [[RAW]], [[SCRP]], [[SDFX]], [[SGRP]], [[SIMP]], [[SLID]], [[SPLP]], [[SSET]], [[SURF]], [[TIMR]], [[TPIK]], [[TRIG]], [[TRWT]], [[UIM]], [[VIL]], [[WIRE]], [[ZLIN]]
 
HOP: [[ANIM]], [[COLL]], [[DEST]], [[DTRK]], [[GRSM]], [[LODT]], [[MAPR]], [[NGMS]], [[PIPT]], [[SHRP]], [[SPLN]]
Line 212 ⟶ 237:
| TEXTURE || 3 || HOP: [[RWTX]]
|-
| TEXTURE_STRM || 1 || HIP: [[TEXS]], [[WIRE]]
 
HOP: [[BINK]]
Line 224 ⟶ 249:
| ANIMATION || 1 || HOP: [[ANIM]]
|-
| DEFAULT || 1 || HIP: [[ALST]], [[ATBL]], [[BOUL]], [[CAM]], [[CCRV]], [[CNTR]], [[COND]], [[DPAT]], [[DYNA]], [[ENV]], [[FOG]], [[GRUP]], [[LKIT]], [[MINF]], [[MRKR]], [[MVPT]], [[NPCS]], [[PARE]], [[PARP]], [[PARS]], [[PGRS]], [[PICK]], [[PLAT]], [[PLYR]], [[PORT]], [[RAW]], [[SCRP]], [[SDFX]], [[SGRP]], [[SIMP]], [[SPLN]], [[SURF]], [[TIMR]], [[TPIK]], [[TRIG]], [[TRWT]], [[UIM]], [[VOLU]], [[WIRE]]
 
HOP: [[COLL]], [[DEST]], [[JAW]], [[LODT]], [[MAPR]], [[NGMS]], [[PIPT]], [[SHRP]], [[SPLN]]
Line 262 ⟶ 287:
'''subVersion''' is 2 in all games.
 
'''clientVersion''' is 0x00000001 in Scooby-Doo PS2 prototype, 0x00040006 (4.6) in Scooby-Doo final, and 0x000A000F (10.15) in all other games.
 
'''compatVersion''' is 1 in all games.
Line 274 ⟶ 299:
* In all games, this value always includes 0x2E in the flags. Its meaning is unknown.
* In BFBB, every file except font2.HIP has some extra flags:
** 0x2900000x140000 is used in GCGerman USPS2 hipsHIP's
** 0x2A00000x290000 is used in XboxUS hipsGC HIP's
** 0x2C00000x2A0000 is used in PS2US hipsXbox HIP's
** 0x2C0000 is used in US PS2 HIP's
** 0x510000 is used in GC mn-pal/mnu3.HIP and mn-pal/mnu3.HOP
** 0x02000000 is used in all BFBBUS hipsHIP's except font2.HIP
** 0x03000000 is used in all German PS2 HIP's
 
====PCNT====
Line 429 ⟶ 456:
'''filename''' is the asset's source filename if the <code>SOURCE_FILE</code> flag is set in the parent [[#AHDR|AHDR]] block.
 
'''checksum''' is the checksum of the asset's data. The algorithm to calculate the checksum is currently[https://opensource.apple.com/source/CommonCrypto/CommonCrypto-60074/libcn/crc32-mpeg-2.c.auto.html unknown,CRC-32/MPEG-2]. but itIt's unused by the game anyways.
 
====LTOC====
Line 462 ⟶ 489:
</pre>
 
This value is unknown in Scooby-Doo PS2 prototype and always -1 (0xFFFFFFFF) in all other games.
 
===STRM===
This block organizes all of the data for the assets in the HIP archive. It contains no data and 2 child blocks: [[#DHDR|DHDR]] and [[#DPAK|DPAK]]. Some Incredibles PC archives (mainly localized ones) are known to have an incorrect section/block size value in this block. This could be due to the additional used padding bytes, even though the assets are the same length as in the US version. However, blocksize values in this block are ignored by the game anyway.
 
====DHDR====
This block is unused by the game.
Line 496 ⟶ 522:
 
There is padding between the start of the block and the beginning of the asset data. The amount of padding is calculated from the fixed layer alignment size (described above), minus the first 4 bytes which is reserved for '''paddingAmount'''. It specifies how many padding bytes will follow.
 
'''Scooby-Doo PS2 Prototype:''' Those HIP archives do not have padding bytes at the beginning of this block. They also use <code>0x00</code> as pad byte instead of <code>0x33</code>.
 
==Tools==
[[HipHopFile]] is a C# library which can be used to work with HIP files.
 
==External links==
2,079

edits