Jump to content

EvilEngine/SHRP: Difference between revisions

no edit summary
m (Seil moved page SHRP to EvilEngine/SHRP)
No edit summary
 
Line 14:
==Format (Headers)==
===zShrapnelAsset===
<source lang=cpp>
struct zShrapnelAsset
{
int fassetCount;
unsigned int shrapnelID;
void(*initCB)(zShrapnelAsset*, xModelInstance*, xVec3*, xVec3*, void(*)(zFrag*, zFragAsset*));
};
</source>
The asset data starts with a 0xC byte header:
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x00 || ints32 || '''fassetCount''' || Amount of frag entries
|-
| 0x04 || [[AssetID]] || '''sharpnelID''' || This asset
|-
| 0x08 || intp32 || colspan="2"- || Unknown, alwaysAlways 0
|}
 
After that, there's an array of shrapnel entries, as defined in the header. Each entry is of variable size:
 
* '''Type 1 '''(Group)'''
* '''Type 2 '''(Shrapnel)'''
* '''Type 3 '''(Particle)'''
** BFBB - 0x1D4
** TSSM -RatProto 0x1F8- 0x1F4
* '''Type 4 '''(Projectile)'''
** BFBB - 0x90
** TSSM/Incredibles - 0x110
** ROTU/RatProto - 0x158
* '''Type 5 (Lightning)'''
* Type 5 '''(Lightning)'''
** BFBB - 0x68
** TSSM-RatProto - 0x70
* '''Type 6 '''(Sound)'''
** BFBB - 0x4C
** TSSM-RatProto - 0x44
* '''Type 7 '''(Shockwave)'''
** TSSMBFBB-RatProto - 0x54
* '''Type 8 '''(Explosion)'''
** TSSM-RatProto - 0x48
* '''Type 9 '''(Distortion)'''
** TSSM-RatProto - 0x5C
* '''Type 10 '''(Fire)'''
** TSSM/Incredibles - 0x5C
** ROTU/RatProto - 0xB4
 
* Type 11 '''(Light)'''
===zFragAsset===
** ROTU/RatProto - 0x60
The entries have the following structure:
* Type 12 '''(Smoke)'''
{| class="wikitable"
** ROTU/RatProto - 0x50
! Offset !! Type !! Variable !! Description
* Type 13 '''(Goo)'''
|-
** ROTU/RatProto - 0x88
| 0x00 || int || '''type''' ||
* 0 = eFragInactive
* 1 = eFragGroup
* 2 = eFragShrapnel
* 3 = eFragParticle
* 4 = eFragProjectile
* 5 = eFragLightning
* 6 = eFragSound
* 7 = eFragShockwave
* 8 = eFragExplosion
* 9 = eFragDistortion
* 10 = eFragFire
|-
| 0x04 || [[AssetID]] || '''id''' ||
|-
| 0x08 || [[AssetID]] || '''parentID''' ||
|-
| 0x0C || [[AssetID]] || '''parentID2''' ||
|-
| 0x10 || float || '''lifetime''' ||
|-
| 0x14 || float || '''delay''' ||
|}
 
===zFragLocation===
Every entry/frag (except shockwave) has this header at a different position.<br>
Sometimes it only has 0xCD padding bytes.
<source lang=cpp>
struct zFragLocation
{
zFragLocType type;
zFragLocInfo info;
float rand_radius; // Not present in BFBB
};
</source>
<source lang=cpp>
enum zFragLocType
{
eFragLocBone,
eFragLocBoneUpdated,
eFragLocBoneLocal,
eFragLocBoneLocalUpdated,
eFragLocTag,
eFragLocTagUpdated,
eFragLocCount,
eFragLocForceSize = 2147483647
};
</source>
<source lang=cpp>
union zFragLocInfo
{
zFragBone bone;
xModelTag tag;
};
 
struct zFragBone
{
int index;
xVec3 offset;
};
 
struct xModelTag
{
xVec3 v;
unsigned int matidx;
float wt[4];
};
</source>
 
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x00 || uintzFragLocType[u32] || '''type''' ||
* 0 = eFragLocBone
* 1 = eFragLocBoneUpdated
Line 94 ⟶ 122:
* 5 = eFragLocTagUpdated
|-
! colspan="4" | [Frag] Bone onlyzFragBone
|-
| 0x04 || ints32 || '''index''' ||
|-
| 0x08 || [[Vector3]] || '''offset''' ||
|-
| 0x0C || uintu32[4] || colspan="2" | Padding - 0xCD bytes, 4-byte alignment
|-
! colspan="4" | [Model] Tag onlyxModelTag
|-
| 0x04 || [[Vector3]] || '''v''' ||
|-
| 0x10 || uintu32 || '''matidx''' ||
|-
| 0x14 || floatf32[4] || '''wt''' || Always 0xCD padding bytes?
|-
! colspan="4" |
|-
| 0x24 || floatf32 || '''rand_radius''' || '''Not present in BFBB'''
|}
 
===zFragLightInfo===
Sometimes used in The Incredibles:ROTU and Ratatouille Prototype
<source lang=cpp>
struct zFragLightInfo
{
_xFColor lightColor;
float radius;
float fadeUpTime;
float fadeDownTime;
float duration;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x00 || [[Vector4]] || '''lightColor''' ||
|-
| 0x10 || f32 || '''radius''' ||
|-
| 0x14 || f32 || '''fadeUpTime''' ||
|-
| 0x18 || f32 || '''fadeDownTime''' ||
|-
| 0x1C || f32 || '''duration''' ||
|}
 
 
==Format (Frags)==
===Type 3 - ParticlezFragAsset===
Every frag inherits from following structure:
====BFBB====
<source lang=cpp>
struct zFragAsset
{
zFragType type;
unsigned int id;
unsigned int parentID[2];
float lifetime;
float delay;
};
 
enum zFragType
{
eFragInactive,
eFragGroup,
eFragShrapnel,
eFragParticle,
eFragProjectile,
eFragLightning,
eFragSound,
eFragShockwave,
eFragExplosion, // Not present in BFBB
eFragDistortion, // Not present in BFBB
eFragFire, // Not present in BFBB
eFragLight, // Only present in ROTU and RatProto
eFragSmoke, // Only present in ROTU and RatProto
eFragGoo, // Only present in ROTU and RatProto
eFragCount,
eFragForceSize = 2147483647
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x00 || zFragType[u32] || '''type''' ||
! 0x18 || colspan="3" | [[#zFragLocation|zFragLocation]] source
* 0 = Inactive
* 1 = Group
* 2 = Shrapnel
* 3 = Particle
* 4 = Projectile
* 5 = Lightning
* 6 = Sound
* 7 = Shockwave
* 8 = Explosion
* 9 = Distortion
* 10 = Fire
* 11 = Light
* 12 = Smoke
* 13 = Goo
|-
| 0x04 || [[AssetID]] || '''id''' ||
! 0x3C || colspan="3" | [[#zFragLocation|zFragLocation]] vel
|-
| 0x08 || [[AssetID]][2] || '''parentID''' ||
| 0x60 || uint[91] || colspan="2" | Padding - 0xCD bytes, 4-byte alignment
|-
| 0x10 || f32 || '''lifetime''' ||
|-
| 0x14 || f32 || '''delay''' ||
|}
 
====Type 3 (Particle)====
=====BFBB=====
<source lang=cpp>
class zFragParticleAsset : public zFragAsset
{
public:
zFragLocation source;
zFragLocation vel;
xParEmitterCustomSettings emit;
unsigned int parEmitterID;
zParEmitter* parEmitter;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x18 || [[#zFragLocation|zFragLocation]] || '''source ''' ||
|-
| 0x3C || [[#zFragLocation|zFragLocation]] || '''vel''' ||
|-
| 0x60 || xParEmitterCustomSettings || '''emit''' || Padding - 0xCD bytes
|-
| 0x1CC || [[AssetID]] || '''parEmitterID''' ||
|-
| 0x1D0 || uintp32 || '''parEmitter''' || Always 0
|}
 
====Movie=TSSM-RatProto=====
<source lang=cpp>
class zFragParticleAsset : public zFragAsset
{
public:
zFragLocation source;
zFragLocation vel;
xParEmitterCustomSettings emit;
unsigned int flags; // Only present in TSSM
unsigned int parEmitterID;
zParEmitter* parEmitter;
}
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
!| 0x18 || colspan="3" | [[#zFragLocation|zFragLocation]] || '''source''' ||
|-
!| 0x40 || colspan="3" | [[#zFragLocation|zFragLocation]] || '''vel''' ||
|-
| 0x68 || byte[388]xParEmitterCustomSettings || '''dummyemit''' ||
|-
| 0x1EC || uintu32 || '''dummy0flags''' || ?'''Only present in TSSM'''
|-
| 0x1F0 || [[AssetID]]u32 || [[PARE]]'''parEmitterID''' ||
|-
| 0x1F4 || uintp32 || '''dummy1parEmitter''' || ?Always null
|}
 
----
===Type 4 (Projectile)===
 
====BFBB====
====Type 4 (Projectile)====
=====BFBB=====
<source lang=cpp>
class zFragProjectileAsset : public zFragAsset
{
public:
unsigned int modelInfoID;
RpAtomic* modelFile;
zFragLocation launch;
zFragLocation vel;
float bounce;
signed int maxBounces;
unsigned int flags;
unsigned int childID;
zShrapnelAsset* child;
float minScale;
float maxScale;
unsigned int scaleCurveID;
xCurveAsset* scaleCurve;
float gravity;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
Line 156 ⟶ 316:
| 0x18 || [[AssetID]] || '''modelInfoID''' || [[MODL]]
|-
| 0x1C || uintp32 || '''modelFile''' || Always 0
|-
!| 0x20 || colspan="3" | [[#zFragLocation|zFragLocation]] || '''launch''' ||
|-
!| 0x44 || colspan="3" | [[#zFragLocation|zFragLocation]] || '''vel''' ||
|-
| 0x68 || floatf32 || '''bounce''' ||
|-
| 0x6C || ints32 || '''maxbouncesmaxBounces''' ||
|-
| 0x70 || uintu32 || '''flags''' ||
|-
| 0x74 || [[AssetID]] || '''childID''' || [[SHRP]] - Child shrapnel ID. Always 0?
|-
| 0x78 || zSharpnelAsset*p32 || '''child''' || Always 0?
|-
| 0x7C || floatf32 || '''minScale''' ||
|-
| 0x80 || floatf32 || '''maxScale''' ||
|-
| 0x84 || [[AssetID]] || '''scaleCurveID''' || Always 0?
|-
| 0x88 || xCurveAsset*p32 || '''scaleCurve''' || Always 0?
|-
| 0x8C || floatf32 || '''gravity''' ||
|}
 
====Movie=TSSM-RatProto=====
<source lang=cpp>
class zFragProjectileAsset : public zFragAsset
{
public:
unsigned int modelInfoID;
RpAtomic* modelFile;
zFragLocation launch;
zFragLocation vel;
zFragLocation velPlusMinus;
zFragLocation rot;
zFragLocation rotPlusMinus;
zFragLocation initRot; // Only present in ROTU and RatProto
float bounce;
signed int maxBounces;
unsigned int flags;
unsigned int childID;
zShrapnelAsset* child;
float minScale;
float maxScale;
unsigned int scaleCurveID;
xCurveAsset* scaleCurve;
float gravity;
zFragLightInfo lightInfo // Only present in ROTU and RatProto
};
</source>
{| class="wikitable"
! Offset !! Offset (ROTU) !! Type !! Variable !! Description
|-
| 0x18 || 0x18 || [[AssetID]] || '''modelInfoID''' || [[MODL]]
|-
| 0x1C || RpAtomic*0x1C || p32 || '''modelFile''' || Always 0?
|-
!| 0x20 || colspan="3"0x20 || [[#zFragLocation|zFragLocation]] || '''launch''' ||
|-
!| 0x48 || colspan="3"0x48 || [[#zFragLocation|zFragLocation]] || '''vel''' ||
|-
!| 0x70 || colspan="3"0x70 || [[#zFragLocation|zFragLocation]] || '''velPlusMinus''' ||
|-
!| 0x98 || colspan="3"0x98 || [[#zFragLocation|zFragLocation]] || '''rot''' ||
|-
!| 0xC0 || colspan="3"0xC0 || [[#zFragLocation|zFragLocation]] || '''rotPlusMinus''' ||
|-
| - || 0xE8 || float[[#zFragLocation|zFragLocation]] || '''bounceinitRot''' || '''Only present in ROTU/RatRroto'''
|-
| 0xEC0xE8 || int0x110 || f32 || '''maxBouncesbounce''' ||
|-
| 0xF00xEC || int0x114 || s32 || '''flagsmaxBounces''' ||
|-
| 0xF40xF0 || [[AssetID]]0x118 || u32 || '''childIDflags''' || [[SHRP]] - Child shrapnel ID. Always 0?
|-
| 0xF80xF4 || zShrapnelAsset*0x11C || [[AssetID]] || '''childchildID''' || Always[[SHRP]] - Child shrapnel 0?ID
|-
| 0xFC0xF8 || float0x120 || p32 || '''minScalechild''' || Always 0
|-
| 0x1000xFC || float0x124 || f32 || '''maxScaleminScale''' ||
|-
| 0x1040x100 || [[AssetID]]0x128 || f32 || '''scaleCurveIDmaxScale''' || Always 0?
|-
| 0x1080x104 || xCurveAsset*0x12C || [[AssetID]] || '''scaleCurvescaleCurveID''' || Always 0?
|-
| 0x10C0x108 || float0x130 || p32 || '''GravityscaleCurve''' || Always 0
|}
 
===Type 5 (Lightning)===
====BFBB====
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
! 0x18 || colspan="3" | [[#zFragLocation|zFragLocation]] start
|-
! 0x3C || colspan="3" | [[#zFragLocation|zFragLocation]] end
|-
| 0x600x10C || uint0x134 || f32 || '''startParentIDgravity''' || all bytes are 0xCD?
|-
| 0x64- || uint0x138 || [[#zFragLightInfo|zFragLightInfo]] || '''endParentIDlightInfo''' || all'''Only bytespresent arein 0xCD?ROTU/RatRroto'''
|}
 
----
====Movie====
 
====Type 5 (Lightning)====
<source lang=cpp>
class zFragLightningAsset : public zFragAsset
{
public:
zFragLocation start;
zFragLocation end;
unsigned int startParentID;
unsigned int endParentID;
};
</source>
{| class="wikitable"
! Offset (BFBB) !! Offset !! Type !! Variable !! Description
|-
!| 0x18 || colspan="3"0x18 || [[#zFragLocation|zFragLocation]] || '''start''' ||
|-
!| 0x400x3C || colspan="3"0x40 || [[#zFragLocation|zFragLocation]] || '''end''' ||
|-
| 0x60 || 0x68 || uint[[AssetID]] || '''startParentID''' || all bytes are 0xCD?
|-
| 0x64 || 0x6C || uint[[AssetID]] || '''endParentID''' || all bytes are 0xCD?
|}
 
----
===Type 6 (Sound)===
 
====BFBB====
====Type 6 (Sound)====
=====BFBB=====
<source lang=cpp>
class zFragSoundAsset : public zFragAsset
{
public:
unsigned int assetID;
zFragLocation source;
float volume;
float innerRadius;
float outerRadius;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
Line 256 ⟶ 456:
| 0x18 || [[AssetID]] || '''assetID''' || [[SND]]/[[SNDS]]
|-
!| 0x1C || colspan="3" | [[#zFragLocation|zFragLocation]] || '''source''' ||
|-
| 0x40 || floatf32 || '''volume''' ||
|-
| 0x44 || floatf32 || '''innerRadius''' ||
|-
| 0x48 || floatf32 || '''outerRadius''' ||
|}
 
====Movie=TSSM-RatProto=====
<source lang=cpp>
class zFragSoundAsset : public zFragAsset
{
public:
unsigned int assetID;
zFragLocation source;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
Line 271 ⟶ 479:
| 0x18 || [[AssetID]] || '''assetID''' || [[SGRP]]
|-
!| 0x1C || colspan="3" | [[#zFragLocation|zFragLocation]] || '''source''' ||
|}
 
----
===Type 7 (Shockwave)===
 
====Type 7 (Shockwave)====
<source lang=cpp>
class zFragShockwaveAsset : public zFragAsset
{
public:
unsigned int modelInfoID;
float birthRadius;
float deathRadius;
float birthVelocity;
float deathVelocity;
float birthSpin;
float deathSpin;
float birthColor[4];
float deathColor[4];
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
Line 280 ⟶ 505:
| 0x18 || [[AssetID]] || '''modelInfoID''' || [[MODL]]
|-
| 0x1C || floatf32 || '''birthRadius''' ||
|-
| 0x20 || floatf32 || '''deathRadius''' ||
|-
| 0x24 || floatf32 || '''birthVelocity''' ||
|-
| 0x28 || floatf32 || '''deathVelocity''' ||
|-
| 0x2C || floatf32 || '''birthSpin''' ||
|-
| 0x30 || floatf32 || '''deathSpin''' ||
|-
| 0x34 || [[Vector4]] || '''birthColor''' ||
Line 297 ⟶ 522:
|}
 
----
===Type 8 (Explosion)===
 
====Type 8 (Explosion)====
<source lang=cpp>
class zFragExplosionAsset : public zFragAsset
{
public:
unsigned int type;
zFragLocation loc;
unsigned int flags;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x18 || [[AssetID]]?u32 || '''type''' || Unknown
|-
!| 0x1C || colspan="3" | [[#zFragLocation|zFragLocation]] || '''loc''' ||
|-
| 0x44 || uintu32 || '''flags''' ||
|}
 
----
===Type 9 (Distortion)===
 
====Type 9 (Distortion)====
<source lang=cpp>
class zFragDistortionAsset : public zFragAsset
{
public:
unsigned int type;
zFragLocation loc;
unsigned int flags;
float radius;
float duration;
float intensity;
float freq;
float repeat_delay;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x18 || [[AssetID]]?u32 || '''type''' ||
|-
!| 0x1C || colspan="3" | [[#zFragLocation|zFragLocation]] || '''loc''' ||
|-
| 0x44 || uintu32 || '''flags''' ||
|-
| 0x48 || floatf32 || '''radius''' ||
|-
| 0x4C || floatf32 || '''duration''' ||
|-
| 0x50 || floatf32 || '''intensity''' ||
|-
| 0x54 || floatf32 || '''freq''' ||
|-
| 0x58 || floatf32 || '''repeat_delay''' ||
|}
 
----
===Type 10 (Fire)===
 
====Type 10 (Fire)====
=====TSSM/The Incredibles=====
<source lang=cpp>
class zFragFireAsset : public zFragAsset
{
public:
zFragLocation loc;
unsigned int flags;
float radius;
float scale;
float fuel;
float heat;
float damage;
float knockback;
};
</source>
 
=====ROTU/RatProto=====
<source lang=cpp>
struct zFragFireAsset : zFragAsset
{
zFragLocation loc;
unsigned int flags;
float radius;
float scale;
float fuel;
float heat;
property_set props;
};
 
struct property_set
{
float damage;
float knockback;
float heat_magnify;
float height;
xEnt* driver;
xBound damageBound;
};
</source>
 
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
!| 0x18 || colspan="3" | [[#zFragLocation|zFragLocation]] || '''loc'''
|-
| 0x40 || u32 || '''flags''' ||
|-
| 0x44 || f32 || '''radius''' ||
|-
| 0x48 || f32 || '''scale''' ||
|-
| 0x4C || f32 || '''fuel''' ||
|-
| 0x50 || f32 || '''heat''' ||
|-
| 0x54 || f32 || '''damage''' ||
|-
| 0x58 || f32 || '''knockback''' ||
|-
! colspan="4" | ROTU/RatProto only
|-
| 0x5C || f32 || '''heat_magnify''' ||
|-
| 0x60 || f32 || '''height''' ||
|-
| 0x64 || p32 || '''driver''' ||
|-
| 0x68 || xBound || '''damageBound''' || <!--TODO-->
|}
 
----
 
====Type 11 (Light)====
<source lang=cpp>
struct zFragLightAsset : zFragAsset
{
zFragLocation loc;
zFragLightInfo lightInfo;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x18 || [[#zFragLocation|zFragLocation]] || '''loc''' ||
|-
| 0x40 || [[#zFragLightInfo|zFragLightInfo]] || '''lightInfo''' ||
|}
 
----
 
====Type 12 (Smoke)====
<source lang=cpp>
struct zFragSmokeAsset : zFragAsset
{
unsigned int parEmitterID;
zFragLocation loc;
float rate;
float radius;
zSmokeEmitter* parEmitter;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x18 || [[AssetID]] || '''parEmitterID''' ||
|-
| 0x1C || [[#zFragLocation|zFragLocation]] || '''loc''' ||
|-
| 0x44 || f32 || '''rate''' ||
|-
| 0x48 || f32 || '''radius''' ||
|-
| 0x4C || p32 || '''parEmitter''' || Always 0
|}
 
----
 
====Type 13 (Goo)====
<source lang=cpp>
struct zFragGooAsset : zFragAsset
{
unsigned int dropModelInfoID;
RpAtomic* dropModelFile;
unsigned int splatModelInfoID;
RpAtomic* splatModelFile;
unsigned int splatSndID;
zShrapnelAsset* splatSnd;
zFragLocation loc;
zFragLocation vel;
float minScale;
float maxScale;
};
</source>
{| class="wikitable"
! Offset !! Type !! Variable !! Description
|-
| 0x18 || [[AssetID]] || '''dropModelInfoID''' ||
|-
| 0x1C || p32 || '''dropModelFile''' || Always 0
|-
| 0x20 || [[AssetID]] || '''splatModelInfoID''' ||
|-
| 0x400x24 || intp32 || '''flagssplatModelFile''' || Always 0
|-
| 0x440x28 || float[[AssetID]] || '''radiussplatSndID''' ||
|-
| 0x480x2C || floatp32 || '''scalesplatSnd''' || Always 0
|-
| 0x4C0x30 || float[[#zFragLocation|zFragLocation]] || '''fuelloc''' ||
|-
| 0x500x58 || float[[#zFragLocation|zFragLocation]] || '''heatvel''' ||
|-
| 0x540x80 || floatf32 || '''damageminScale''' ||
|-
| 0x580x84 || floatf32 || '''knockbackmaxScale''' ||
|}
 
2,081

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.