From 876da099371b304bdfd096914910725d422b3a66 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 2 Jan 2024 21:46:44 -0800 Subject: [PATCH] Nearly finish CCharInfo --- CAudioSoundEffect.bt | 2 +- CCharInfo.bt | 247 ++++++++++++++++++++++++++++++++++++++++++- CGameAreaResource.bt | 53 ++++++++-- MaterialArchive.bt | 2 +- 4 files changed, 288 insertions(+), 16 deletions(-) diff --git a/CAudioSoundEffect.bt b/CAudioSoundEffect.bt index 32feeb4..8d5714c 100644 --- a/CAudioSoundEffect.bt +++ b/CAudioSoundEffect.bt @@ -76,7 +76,7 @@ typedef struct CAudioMetaSample { STimelineEvent timelineEvents[timelineEventCount]; uint unk27; float unk28; - CMayaSpline spline5; + CMayaSpline lowPass; CVector3f unk29; SFilterSettings filterSettings1; SFilterSettings filterSettings2; diff --git a/CCharInfo.bt b/CCharInfo.bt index 46c0453..971c0bf 100644 --- a/CCharInfo.bt +++ b/CCharInfo.bt @@ -1,6 +1,8 @@ #ifndef _CCHARINFO #define _CCHARINFO +#include + local int charinfoi = 0; struct SNodeSet { @@ -298,6 +300,207 @@ struct SSubCharData { } }; +struct SAnimParamNode { + CGuid guid; + uint unk1; + // CPASDatabase +}; + +struct CAnimCollisionPrimSet { + CStringFixed something; // CStringHashedCase + uint unk1; + CStringFixed strings[unk1]; // CStringHashedCase +}; +struct CAnimCollisionPrim { + uint unk1; + uint unk2; + char unk3[unk2]; + uint evalDataLen; + CEvalId evalId; + CGuid guid; + char evalData[evalDataLen]; +}; + +struct SObjectTag { + int type; + CGuid guid; +}; + +struct CAnimCollisionPrimData { + uint primCount; + if (primCount) { + CAnimCollisionPrim prims[primCount]; + } + uint setCount; + if (setCount) { + CAnimCollisionPrimSet collisionPrimSet[setCount]; + } + + uint unk1; + if (unk1) { + CGuid guids2[unk1]; + } +}; + +struct CParamSet32 { + uint unk1; + uint unk2; + uint unk3; + + char data[-(unk1 >> 3 & 1) & 0xffffffc0 | (unk1 & 0xf) << 2]; + char data2[(unk1 & 0xf | unk2 << 4) / 8]; +}; + +struct CEffectState { + ushort unk1; + ushort unk2; + if (unk1) { + SObjectTag tags[unk1]; + } + if (unk2) { + CParamSet32 paramSets[unk2]; + } +}; + +struct CActionStream { + short unk1; + uchar actionFunc; + if (unk1) { + char data[unk1]; + } +}; + +struct CActionInfo { + short unk1; + short unk2; +}; + +struct CActionData { + int unk1; + short unk2; + int unk3; + int unk4; + int unk5; + uchar unk6; + uchar unk7; + uchar unk8; + uchar unk9; + if (unk1 > 0) { + CActionStream streams[unk1] ; + CActionInfo info[unk1] ; + } + + if (unk3 > 0) { + int unkInts[unk3]; + } + + if (unk2 > 0) { + uchar eventIds[unk2 * 8]; + } + + if (unk4) { + char unk[unk4 * 4]; + char unk[unk2]; + } +}; + +struct CAnimTrans { + uchar type; + switch(type) { + case 0: + break; + case 1: + uint unk1; + float unk2; + break; + case 2: + float unk1; + break; + case 3: + uint unk1; + break; + case 4: + uint unk1; + char data1[unk1 * 4]; + char data1[(unk1 + 12) * 4]; + break; + } +}; + +struct CAnimTransFade { + float unk1; + float unk2; + int unk3; +}; +struct CTransAnimLink { + short unk1; + short unk2; + short unk3; + short unk4; + uchar unk5; +}; + +struct CAnimTransTarget { + uint unk1; + ushort unk2; + uchar unk3; + uchar unk4; + if (unk2) { + CTransAnimLink links[unk2]; + } +}; + +struct CAnimTransFadeTarget { + short unk1; + short unk2; + short unk3; +}; + +struct STransData { + ushort unk1; + ushort unk2; + ushort unk3; + ushort unk4; + short unk5; + short unk6; + short unk7; + short unk8; + if (unk1 > 0) { + CAnimTrans trans[unk1] ; + } + if (unk2 > 0) { + CAnimTransFade transFades[unk2] ; + } + + if (unk3 > 0) { + CAnimTransTarget transTargets[unk3] ; + } + + if (unk4 > 0) { + CAnimTransFadeTarget transFadesTargets[unk4] ; + } + + if (unk7 > 0) { + float unk9[unk7]; + } + + if (unk8 > 0) { + CGuid guids[unk8]; + } +}; + +struct SNode { + short unk1; + short unk2; + char data[unk2]; +}; + +struct CEventStreamDataSet { + uint unk1; + if (unk1 > 0) + SNode nodes[unk1] ; +}; + struct CCharInfo { if (!isDKCTF) @@ -352,21 +555,18 @@ struct CCharInfo } uint16 unk10; - if (unk6 != 0) { - - } if (unk6) { CAnim anims[unk6] ; } if (unk5 != 0) { - struct { + struct SAnchorInfo { uint16 unk1; uint16 unk2; uint32 unk3; uint32 unk4; - } unk11[unk5]; + } anchors[unk5]; } if (unk3 != 0) { @@ -376,6 +576,43 @@ struct CCharInfo SSubCharData subCharData; int16 unk12; uint16 unk13; + + char unkData[-((unk12 >> 15) & 1) & ~0x3FFFF | (unk12 & 0xFFFF) << 2]; + char unkData2[unk13]; + uint unk14; + uint unk15; + uchar unkData3[unk14 * 8]; + uchar unkData4[unk15]; + if (unk7) { + SAnimParamNode paramNodes[unk7]; + } + if (unk6) { + CGuid guids[unk6]; + uint unk16[unk6]; + } + uchar hasCollisionPrimitives; + if (hasCollisionPrimitives) { + CAnimCollisionPrimData collisionPrimData; + } + + uchar hasEffectState; + if (hasEffectState) { + CEffectState effectState; + } + uchar hasActionData; + if (hasActionData) { + CActionData actionData; + } + + uchar hasTransData; + if (hasTransData) { + STransData transData; + } + + uchar hasEffectStreamDataSet; + if (hasEffectStreamDataSet) { + CEventStreamDataSet effectStreamDataSet; + } } }; diff --git a/CGameAreaResource.bt b/CGameAreaResource.bt index efb0fb5..96c689f 100644 --- a/CGameAreaResource.bt +++ b/CGameAreaResource.bt @@ -3,6 +3,7 @@ #include "CDataEnumObject.bt" #include "SAtlasLookup.bt" +#include "CMayaSpline.bt" typedef enum { EntityProperties = 0x749749f1, @@ -1254,10 +1255,8 @@ struct ScriptDataHeader { uint32 instanceDataCount; uint32 dataLen; CGuid guids[dataLen]; - struct { - uint32 a; - uint32 b; - } unk[dataLen]; + uint32 propertiesIndices[dataLen]; + uint32 instanceDataIndices[dataLen]; }; typedef struct { @@ -1326,11 +1325,39 @@ struct SLdrPatterned_MP1Typedef { ComponentProperty properties[numProperties]; }; +struct SLdrProjectedShadowDataMP1 { + uint16 numProperties; + ComponentProperty properties[numProperties]; +}; + typedef struct { uint32 propertyId ; uint16 propertySize; local uint64 start = FTell(); switch (propertyId) { + // SLdrRidleyMP1 + case 0x81979F27: + SLdrProjectedShadowDataMP1 data; + break; + case 0x0C71158E: + CGuid breastPlateXRay; + break; + case 0x8DB1624F: + CGuid crotchModel; + break; + case 0x89201C97: + CGuid id; + break; + // SLdrProjectedShadowDataMP1 + case 0x6496C677: + int width; + break; + case 0x3ac546bc: + int height; + break; + case 0xEF3C8E9E: + CMayaSpline data; + break; case 0x934a89f3: SLdrVector_MP1Typedef data; break; @@ -1371,6 +1398,7 @@ struct ComponentProperties { EGOComponentType typeId; switch (typeId) { case GarBeetleMP1: + case RidleyMP1: case ModCon: uint16 propertyCount; ComponentProperty properties[propertyCount]; @@ -1406,10 +1434,16 @@ typedef struct { typedef struct { // SConnection::ComputeSizeFromStream - byte skip0[0x1a]; + uint unk1 ; + uint unk2 ; + CGuid guid1; + ushort unk7; SizeofAllocations eventCriteriaSldr; SizeofAllocations actionPayloadSldr; - byte skip1[0x13]; + byte b1; + byte b2; + byte b3; + CGuid guid2; } SConnection ; typedef struct { @@ -1576,13 +1610,14 @@ struct SGameAreaMetaData(uint64 fileStart) { if (envVarCount > 0) { SEnvironmentVar envVar[envVarCount]; } + uint32 unkCount; if (unkCount > 0) { struct { CGuid id; - uint32 count; - // TODO - } unkStruct[unkCount]; + uint unk; + CStringFixed name; + } unkStruct[unkCount] ; } uint32 byteCount; if (byteCount > 0) { diff --git a/MaterialArchive.bt b/MaterialArchive.bt index c44f0e8..d6d7696 100644 --- a/MaterialArchive.bt +++ b/MaterialArchive.bt @@ -72,7 +72,7 @@ struct CShaderDefines { }; struct CShaderVariable { - + ushort unk1; }; struct SShaderImportDesc { if (!isDKCTF)