EvilEngine/Assets: Difference between revisions

From Heavy Iron Modding
Content added Content deleted
m (ROTU cutscene support)
m (Redirect CSSS to Sound Format page)
Line 144: Line 144:
{{AutoAssetTableRow|CSN|Unused in ROTU (cutscenes are FMV's), but still supported.}}
{{AutoAssetTableRow|CSN|Unused in ROTU (cutscenes are FMV's), but still supported.}}
{{AutoAssetTableRow|CSNM|Unused in ROTU, but still supported.}}
{{AutoAssetTableRow|CSNM|Unused in ROTU, but still supported.}}
|-
{{AutoAssetTableRow|CSSS}}
| align=center | [[EvilEngine/Sound_Format|CSSS]]
|| Cutscene Streaming Sound
|| [[Binary]]
| align=center | -
|| || || ✔ || ✔ || || ||
{{AutoAssetTableRow|CTOC|Unused in ROTU, but still supported.}}
{{AutoAssetTableRow|CTOC|Unused in ROTU, but still supported.}}
{{AutoAssetTableRow|DEST}}
{{AutoAssetTableRow|DEST}}

Revision as of 20:13, 7 January 2023

Heavy Iron games store all of their data for each scene in assets, which can be different formats such as models, textures, animations, object placement information, and many others. Assets are defined by AHDR sections in the HIP archives and uniquely identified by their Asset ID. It is not yet known what all different asset types do.

Classes of Assets

There are many different asset types, but they can be grouped into classes that have similar properties.

RenderWare Streams

These are assets whose data is composed of a RenderWare binary stream, with the tree structure commonly found in them. These assets can be opened in RW Analyze. They are: BSP, JSP, MODL, RWTX.

Base Assets

Many assets extend from Base Assets (also referred to as object assets), which define objects in the level that can interact with each other by using links. Base assets start with an 8 byte header, defined by the xBaseAsset struct:

struct xBaseAsset
{
    unsigned int id;
    unsigned char baseType;
    unsigned char linkCount;
    unsigned short baseFlags;
}
Offset Variable Description
0x00 id Asset ID of entry. Should match the asset ID of the asset in the AHDR.
0x04 baseType Unique to each base asset type. The asset table below shows the base type for each type.
0x05 linkCount The number of links present at/near the end of the asset.
0x06 baseFlags Common flags represented as a 16-bit bitfield although only the 5 lowest bits are ever used.
  • 0x1 - Enabled - Initial enabled/disabled state. If the object is disabled, it won't receive events.
  • 0x2 - Persistent - If an asset is persistent, it will keep track of its current state and restore it on the next scene prepare (player respawn, level reload, etc.) For example, if you make a button persistent and press it in-game, the next time you load the level the button will automatically re-press itself.
  • 0x4 - Valid - Always 1.
  • 0x8 - Visible During Cutscenes - Whether to keep the object visible or not during cutscenes.
  • 0x10 - Receive Shadows - Whether to receive shadows from the player, NPCs, pickups, etc. Asset types known to use this flag: BUTN, PLAT, SIMP

The data that follows this header differs depending on the asset type. Some base assets are entity assets as well (defined below).

These objects have, at the end of their data, an array of links, with the amount of entries specified in this header. The only exception for this is the PLYR assets, which still has one field after the events.

Entity Assets

Entity assets (also referred to as placeable assets) are base assets which have a 3D placement in the world and the following common header (not all objects with a position follow this, though; for example, MRKR have a position but are not even base assets). They start with a 0x54 byte header, which is defined by the xEntAsset struct (which extends from xBaseAsset):

struct xEntAsset : xBaseAsset
{
    unsigned char flags;
    unsigned char subtype;
    unsigned char pflags;
    unsigned char moreFlags;
    unsigned char pad;
    unsigned int surfaceID;
    xVec3 ang;
    xVec3 pos;
    xVec3 scale;
    float redMult;
    float greenMult;
    float blueMult;
    float seeThru;
    float seeThruSpeed;
    unsigned int modelInfoID;
    unsigned int animListID;
};
Offset Variable Description
0x08 flags Flags stored in a bitfield, most likely related to visibility. Can be changed dynamically mid-game through events. (?)
  • 1 - Visible, used by BOUL, BUTN, DSTR, EGEN, PKUP, PLAT, PLYR, SIMP, TRIG, UI, UIFT, VIL
  • 2 - Stackable. Enabling this will cause the object to fall down and stack on top of other objects. This is mainly used for Destructible Objects, such as a table with a picture on top of it (when the table is destroyed, the picture falls to the ground). Note that this disables PLAT movement. Works with PLAT, BUTN, DSTR, VIL (?), and possibly others. Enabling this on a SIMP will crash the game.
  • 4 - Unused
  • 8 - Unknown, used by PLAT
  • 16 - Unused
  • 32 - Unused
  • 64 - No Shadow, only used by VIL and doesn't affect tikis. Disables shadow rendering.
  • 128 - Unused
0x09 subType Defines the subtype of the asset. Usually 0 except for the asset types listed below.
0x0A pflags Always 0.
0x0B moreFlags Flags stored in a bitfield, most likely related to collision. Can be changed dynamically mid-game through events. (?) Always 0 for BOUL, PLYR, and TRIG.
  • 1 - Unused
  • 2 - Precise Collision. When enabled, the collision shape is the exact shape of the model. When disabled, the collision shape is the bounding box of the model. Used by BUTN, DSTR, EGEN, PKUP, PLAT, SIMP, UI, UIFT, VIL
  • 4 - Unknown, used by EGEN
  • 8 - Unused
  • 16 - Hittable. When enabled, the object detects when it is hit and sends Hit events. It also generates bubbles when hit with the Bubble Spin and destroys the Bubble Bowl and Cruise Bubble immediately upon impact. This flag will automatically enable in-game if the asset is a VIL, DSTR, BUTN, BOUL, or Paddle PLAT, OR if the asset has any Links that receive any of the Hit events.
  • 32 - Animate Collision. When enabled, the collision shape will update during the model's Animation if it has one. Precise Collision must also be enabled, or weird collision effects will occur. Used by PLAT, SIMP
  • 64 - Unused
  • 128 - Ledge Grab. When enabled, the player can ledge grab the object. Precise Collision must also be enabled. Used by PLAT, SIMP
0x0C pad Always null. Not present in some versions of entity assets, mainly beta/unused assets and non-BFBB assets. Those assets only have a 0x50-byte header.
0x10 surfaceID SURF ID for SIMP, PLAT, UI, EGEN, and possibly others.
0x14 ang A (Yaw, Pitch, Roll) rotation vector (in radians).
0x20 pos A (X, Y, Z) position vector.
0x2C scale A (X, Y, Z) scale vector.
0x38 redMult Red color multiplier (0 to 1).
0x3C greenMult Green color multiplier (0 to 1).
0x40 blueMult Blue color multiplier (0 to 1).
0x44 seeThru Alpha color multiplier (0 to 1).
0x48 seeThruSpeed Usually 255.0 in all types.
0x4C modelInfoID MODL/MINF ID for BOUL, BUTN, DSTR, EGEN, HANG, PEND, PLAT, PKUP, PLYR, SIMP, UI and VIL
0x50 animListID ALST/ANIM ID for SIMP, PLAT, DSTR, and possibly others. SND ID for UI.

List of asset types

The following is a list of all asset types found across all 6 games as well as which asset types are present in each game, signified by a checkmark (✔).

Asset Description Type Base Type Scooby BFBB TSSM Incredibles ROTU RatProto Notes

ALST

AnimList Binary -

ANIM

Animation Binary -

ATBL

AnimTable Binary -

ATKT

Attack Table Binary -

BINK

Bink Video Binary -

BOUL

Boulder Entity 0x2F

BSP

BSP RenderWare - BSP level models are unused in BFBB, but still supported.

BUTN

Button Entity 0x18

CAM

Camera Base 0x07

CCRV

Camera Curve Base 0x8D

CNTR

Counter Base 0x16

COLL

Collision Table Binary -

COND

Conditional Base 0x1F

CRDT

Credits Binary -

CSN

Cutscene Binary - Unused in ROTU (cutscenes are FMV's), but still supported.

CSNM

Cutscene Mgr Base 0x28 Unused in ROTU, but still supported.
CSSS Cutscene Streaming Sound Binary -

CTOC

Cutscene TableOfContents Binary - Unused in ROTU, but still supported.

DEST

Destructible Asset Binary -

DPAT

Dispatcher Base 0x1E

DSCO

Disco Floor Base 0x00

DSTR

Destructible Object Entity 0x1B

DTRK

Dash Track Base 0xCD

DUPC

Duplicator Base 0x42

DYNA

Dynamic Base 0x00

EGEN

Electric Arc Generator Entity 0x29

ENV

Environment Base 0x05

FLY

Fly Binary - FLY assets are only used in cutscenes in The Incredibles

FOG

Fog Base 0x24

GRSM

Grass Mesh Base 0xCD

GRUP

Group Base 0x11

GUST

Gust Base 0x1C

HANG

Hangable Entity 0x17

JAW

Jaw Data Table Binary -

JSP

JSP RenderWare -

LITE

Light Base 0x25 LITE assets are unused in BFBB, but are still supported.

LKIT

LightKit Binary -

LOBM

LobMaster Base 0x23

LODT

LOD Table Binary -

MAPR

Surface Mapper Binary -

MINF

Model Info Binary -

MODL

Model RenderWare -

MPHT

Morph Target Binary -

MRKR

Marker Binary -

MVPT

Move Point Base 0x0D

NGMS

Navigation Mesh Base 0x9A
0xCD
Base Type notes:
0x9A is only used in Rise of the Underminer.
0xCD is only used in The Incredibles.

NPC

NPC Entity 0x02

NPCS

NPC Settings Binary -

ONEL

One-Liner Binary -

PARE

Particle Emitter Base 0x26

PARP

Particle Emitter Property Base 0x2E

PARS

Particle System Base 0x27

PEND

Pendulum Entity 0x12 PEND assets are unused in every game past Scooby, but are still supported.

PGRS

Progress Script Base 0x75

PICK

Pickup Table Binary -

PIPT

Pipe Info Table Binary -

PKUP

Pickup Entity 0x04

PLAT

Platform Entity 0x06

PLYR

Player Entity 0x03

PORT

Portal Base 0x10

PRJT

Projectile Base 0x22

RANM

Reactive Animation Base 0x00

RAW

Raw Image Binary -
This page contains information on how textures are stored in the games.

Textures are contained in RWTX assets. Each HOP file (sometimes the HIP) contains multiple RWTX assets, each corresponding to one texture.

RWTX

RWTX
Texture
TypeRenderWare
Games usedNight of 100 Frights

Battle for Bikini Bottom
The SpongeBob SquarePants Movie
The Incredibles
Rise of the Underminer

Ratatouille Prototype
Source coderwcore.h

The data of the RWTX asset is actually a TXD archive containing only one texture. It's unknown if one RWTX asset can contain multiple textures, but this is likely not done in the games.

RW3

.RW3 is not a file format, extension, or texture format, but rather an identifier.

There are two "styles" of RWTX: the ones with .RW3 appended to the end of the texture name, and the ones without. Internally, both are the same, but the textures with .RW3 are the ones used by the game's models for rendering (BSP, JSP and MODL) while the ones without are used in other spaces, usually for rendering on screen space instead of world space (such as inside TEXTs, in UI, UIFT and other asset types).

This works in a system such that, if a texture is named "example_texture", then the model using that texture will contain a reference to a texture named "example_texture", but the RWTX asset of the texture will be named "example_texture.RW3". This must be done in order for the game to find the texture; Industrial Park can do this automatically for you when importing or replacing textures and models.

TEXS

TEXS
Streaming Texture
TypeRenderWare
Games usedThe SpongeBob SquarePants Movie

The Incredibles
Rise of the Underminer

Ratatouille Prototype





TXD

TXD is an archive file format used to contain textures in RenderWare games. One single TXD file can contain multiple textures; RWTX assets are TXDs with only one. Magic.TXD is a tool which can open and edit TXD files.

Industrial Park has a function that allows you to import or export all RWTX assets from a given HIP/HOP archive into a TXD; it does this by merging all RWTXs into one TXD (for export) then separating them into multiple RWTXs (for import). You can choose to do this to only the assets which have .RW3 at the end or only to the ones which don't. This should make it easier for you to edit the textures.

RWTEX

RWTEX is a file format used internally by Magic.TXD to contain only one texture. A RWTEX is a part of a TXD and doesn't function by itself, and it should not be confused with RWTX. You can export and import RWTEXs from Magic.TXD and Industrial Park can also work with this format. RWTEXs do not work by themselves as RWTX assets.

RenderWare Versions

Each game/platform combination will use a different, specific format on its textures, and if it's incorrect, the texture will not load ingame. This format can be changed in Magic.TXD and it's common for it to reset itself (specially if you delete all textures from a TXD before adding new ones), so you might need to set it yourself again.

GameCube XBOX PS2 PC
Scooby-Doo: Night of 100 Frights 3.3.0.2 3.4.0.5 3.1.0.0 -
Battle for Bikini Bottom 3.4.0.3 3.5.0.0 3.5.0.0 -
The SpongeBob SquarePants Movie 3.7.0.2-A -
The Incredibles XBOX
3.7.0.2-A
The Incredibles: Rise of the Underminer 3.7.0.2-A
Ratatouille Prototype 3.7.0.2-A - - -

RWTX

Raw Image Binary -

SCRP

Script Base 0x2A SCRP assets are unused in Scooby and BFBB, but are still supported.
(AR codes, and/or IPS patches are required)

SDFX

Sound FX Base 0x4B

SFX

Sound FX Base 0x13

SGRP

Sound Group Base 0x4A

SHDW

Simple Shadow Table Binary -

SHRP

Shrapnel Binary -

SIMP

Simple Object Entity 0x0B

SLID

Slide Property Base 0x46
SND Sound Binary -
SNDI Sound Info Binary -
SNDS Streaming Sound Binary -

SPLN

Spline Base 0x49

SPLP

Spline Path Base 0x73

SSET

Scene Settings Base 0x54

SUBT

Subtitles Base 0x00

SURF

Surface Base 0x1A

TEXS

Streaming Texture RenderWare -

TEXT

Text Binary -

TIMR

Timer Base 0x0E

TPIK

Pickup Types Base 0x00

TRIG

Trigger Entity 0x01

TRWT

ThrowableTable Base 0x00

UI

UI Entity 0x20

UIFT

UI Font Entity 0x21

UIM

UI Motion Base 0x53

VIL

NPC Entity 0x2B

VILP

NPC Properties Binary -

VOLU

Volume Base 0x1D VOLU is not present in The Incredibles, but there is code for it

WIRE

Wireframe Binary -

ZLIN

Zip Line Base 0x40