EvilEngine/SHRP: Difference between revisions
no edit summary
m (Seil moved page SHRP to EvilEngine/SHRP) |
EnergyDrink (talk | contribs) 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 ||
|-
| 0x04 || [[AssetID]] || '''sharpnelID''' || This asset
|-
| 0x08 ||
|}
After that, there's an array of shrapnel entries, as defined in the header. Each entry is of variable size:
*
*
*
** BFBB - 0x1D4
** TSSM
*
** BFBB - 0x90
** TSSM/Incredibles - 0x110
** ROTU/RatProto - 0x158
* Type 5 '''(Lightning)'''
** BFBB - 0x68
** TSSM-RatProto - 0x70
*
** BFBB - 0x4C
** TSSM-RatProto - 0x44
*
**
*
** TSSM-RatProto - 0x48
*
** TSSM-RatProto - 0x5C
*
** TSSM/Incredibles - 0x5C
** ROTU/RatProto - 0xB4
* Type 11 '''(Light)'''
** ROTU/RatProto - 0x60
* Type 12 '''(Smoke)'''
** ROTU/RatProto - 0x50
* Type 13 '''(Goo)'''
** ROTU/RatProto - 0x88
===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 ||
* 0 = eFragLocBone
* 1 = eFragLocBoneUpdated
Line 94 ⟶ 122:
* 5 = eFragLocTagUpdated
|-
! colspan="4" |
|-
| 0x04 ||
|-
| 0x08 || [[Vector3]] || '''offset''' ||
|-
| 0x0C ||
|-
! colspan="4" |
|-
| 0x04 || [[Vector3]] || '''v''' ||
|-
| 0x10 ||
|-
| 0x14 ||
|-
! colspan="4" |
|-
| 0x24 ||
|}
===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)==
===
Every frag inherits from following structure:
<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''' ||
* 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''' ||
|-
| 0x08 || [[AssetID]][2] || '''parentID''' ||
|-
| 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 ||
|}
====
<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
|-
|-
|-
| 0x68 ||
|-
| 0x1EC ||
|-
| 0x1F0 ||
|-
| 0x1F4 ||
|}
----
====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 ||
|-
|-
|-
| 0x68 ||
|-
| 0x6C ||
|-
| 0x70 ||
|-
| 0x74 || [[AssetID]] || '''childID''' || [[SHRP]] - Child shrapnel ID
|-
| 0x78 ||
|-
| 0x7C ||
|-
| 0x80 ||
|-
| 0x84 || [[AssetID]] || '''scaleCurveID''' ||
|-
| 0x88 ||
|-
| 0x8C ||
|}
====
<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 ||
|-
|-
|-
|-
|-
|-
| - || 0xE8 ||
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|}
----
====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
|-
|-
|-
| 0x60 || 0x68 ||
|-
| 0x64 || 0x6C ||
|}
----
====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]]
|-
|-
| 0x40 ||
|-
| 0x44 ||
|-
| 0x48 ||
|}
====
<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]]
|-
|}
----
====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 ||
|-
| 0x20 ||
|-
| 0x24 ||
|-
| 0x28 ||
|-
| 0x2C ||
|-
| 0x30 ||
|-
| 0x34 || [[Vector4]] || '''birthColor''' ||
Line 297 ⟶ 522:
|}
----
====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 ||
|-
|-
| 0x44 ||
|}
----
====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 ||
|-
|-
| 0x44 ||
|-
| 0x48 ||
|-
| 0x4C ||
|-
| 0x50 ||
|-
| 0x54 ||
|-
| 0x58 ||
|}
----
====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
|-
|-
| 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''' ||
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|-
|
|}
|