Skip to content

ObjectFileStruct

Rena Kunisaki edited this page Aug 16, 2020 · 2 revisions

This is the structure of entries in OBJECTS.bin. OBJECTS.tab gives the offset of the beginning of each entry. Many fields are guessed/unknown.

Offset Type Name Description
000000 float copied to shadow field 0
000004 float scale
000008 u32* pModelList -> list of model IDs
00000c pointer
000010 pointer
000014 pointer
000018 ObjSeq* offset_0x18 [OPTIONAL] a file containing functions
00001c u16* pSeq [OPTIONAL] -> seq IDs
000020 pointer pEvent [OPTIONAL] offset into the file. changed to pointer on load
000024 pointer pHits [OPTIONAL]
000028 pointer pWeaponDa [OPTIONAL]
00002c AttachPoint* attachPoints
000030 short* pModLines ignored in file (zeroed on load)
000034 int ignored in file (zeroed on load)
000038 int
00003c void*
000040 AButtonInteraction* aButtonInteraction [OPTIONAL] count in field 0x72 -> something 0x12 or 0x18 bytes per model
000044 ObjFileStructFlags44 flags
000048 ObjFileStruct_ShadowType shadowType
00004a s16 shadowTexture
00004c ?
00004d ?
00004e short
000050 s16 dll_id if not -1, load this DLL; func 0 is a model callback
000052 ?
000053 ?
000054 ?
000055 byte nModels
000056 byte numPlayerObjs if > 0, objAddObjectType(obj, 8)
000057 u8 never read?
000058 u8 nAttachPoints
000059 byte count59 count of sth 0x10 bytes
00005a u8 numVecs count of something 0x12 bytes; crashes if reduced
00005b ?
00005c byte modLinesSize ignored in file
00005d s8 modLinesIdx
00005e u8 numSeqs
00005f ObjFileStructFlags5F flags_0x5f
000060 byte
000061 byte crash if 0; hitbox related
000062 byte hitboxSize
000063 byte
000064 ? hitboxField6B
000065 byte hitboxFlags_0x65 8=has something 0x1C8 bytes
000066 byte
000067 byte hasHitbox
000068 short hitboxField5C Created by retype action
00006a word shadowVar6A > 0x169 = no shadow; also hitbox related
00006c short
00006e short
000070 byte hitboxVar70 related to hitbox (height?)
000071 u8 flags_0x71 related to hitbox
000072 byte count72 count of something 0x18 bytes; changing crashes
000073 byte stateVar73 1=translucent; 3=invincible - not flags
000074 ?
000075 ?
000076 ObjectFileStructFlags76 flags76 1=animated
000077 byte
000078 s16 map crashes loudly if invalid
00007a ?
00007b ?
00007c GameTextId[4] helpTexts one per model
000084 ?
000086 ?
000088 float lagVar88 causes lag at ~65536.0; GPU hang at much more; related to shadow; maybe causing excessive map loads?
00008c byte nLights
00008d byte lightIdx
00008e byte related to textures; 1=dark, 2=default, 3+=corrupt, 77=crash, 0=normal
00008f ?
000090 byte hitboxVar90 < 0xE = invincible
000091 char[11] name only used for debug print
00009c varies - additional data depending on object

Offsets are relative to the beginning of the structure and will be converted to pointers when the object is loaded.

ObjFileStruct_ShadowType

Val Description
0x0 None
0x1 Big box
0x2 Geometric shadow, generated from the object's model
0x3 Crash (requires some extra data?)
0x4 Blue glowing rectangle

ObjFileStructFlags44

Value Description
00000001 Has models
00000010 Different light color
00000020 Related to models
00000040 Has children
00000400 Enable culling
00000800 Use different model loading
00080000 Different culling
00200000 Keep hitbox when invisible
00400000 Has event
00800000 Did load models (set at runtime)

ObjFileStructFlags5F

Val Description
0x01 Crazy translucent effect (meant for jellyfish?)
0x02 Shadow does not use a texture
0x04 Shadow uses depth testing
0x08 Related to matrices
0x10 No shadow; force depth test if 0x01 also set
0x20 Visible
0x80 Different textures (very dark)

Help Texts

Four text IDs, one for each of the object's model. If the ID for the current model is not 0xFFFF, standing next to the object will display that text on the PDA.

AttachPoint

Offset Type Name Description
000000 vec3f pos Position offset from bone
00000C vec3s rot Rotation offset from bone
000012 s8 bone Bone index, or -1
000013 s8 ? Always equals bone index? Changing has no effect?
000014 s8 ? Always equals bone index? Changing has no effect?
000015 s8 ? Always 0xCD?
000016 s8 ? Always 0xCD?
000017 s8 ? Always 0xCD?

These define points on the object's model that can be referenced by animations. For example, the staff is placed at point 2 when on Fox's back, and point 0 when in his hand. The position and rotation of the point is added to those of the bone to determine the staff's position and rotation.

The bone index can be -1; in that case, the point isn't attached to a bone, and is offset from the model's origin instead.

Clone this wiki locally