Jump to content

Resources/Particle Location: Difference between revisions

From HEModdingWiki
Ashrindy (talk | contribs)
No edit summary
Ashrindy (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
* [[Sonic Origins|Sonic Origins]]
* [[Sonic Origins|Sonic Origins]]
* [[Sonic Frontiers|Sonic Frontiers]]  
* [[Sonic Frontiers|Sonic Frontiers]]  
* [[Shadow Generations|Shadow Generations]]|tools=* [[Tools/AshDumpTool|AshDumpTool]]|status=Done|container=BINA|name=Particle Location}}'''Particle Location''' ''(also known as effdb and Particle Locator)'' is the so called Effect Database format that coincides with the '''[[Resources/Animation State Machine|Animation State Machine]]''' format as it contains an array containing every state.
* [[Shadow Generations|Shadow Generations]]|tools=* [[Tools/AshDumpTool|AshDumpTool]]|status=Done|container=BINA|name=Particle Location}}'''Particle Location''' ''(also known as effdb and Particle Locator)'' is the so called Effect Database format that's used to spawn particles and sound effects for any Animation State. It coincides with the '''[[Resources/Animation State Machine|Animation State Machine]]''' format as it contains an array for every state in that file.


Every state can have any amount of [[Resources/Cyan Effect|particles]] and/or sounds ''(in [[Sonic Forces]] only one sound can be used per state)'' attached to it, every particle can have its own offset in terms of position, rotation and scale.
Every state can have any amount of [[Resources/Cyan Effect|particles]] and/or sounds ''(in [[Sonic Forces]] only one sound can be used per state)'' attached to it, every particle can have its own offset in terms of position, rotation and scale.
Line 36: Line 36:


- '''Scale''', a scale offset it should attach with, won't be used if the Use Scale is set to false
- '''Scale''', a scale offset it should attach with, won't be used if the Use Scale is set to false
== Technical info ==
<syntaxhighlight lang="c++">
struct Particle {
    enum class Flag : unsigned char {
        IGNORE_RELATIVE_POSITION,
        USE_POSITION,
        USE_ROTATION,
        USE_SCALE,
    };
    bool attachedToBone;
    Bitset<Flag> flags;
    const char* particleName;
    const char* boneName;
    Vector3 position;
    Quaternion rotation;
    Vector3 scale;
};
</syntaxhighlight><syntaxhighlight lang="c++">
struct State {
    const char* stateName;
    int particleCount;
    Particle particles*;
    int soundNameCount;
    const char** soundNames; // in Forces const char*
};
</syntaxhighlight><syntaxhighlight lang="c++">
struct EffdbData{
    unsigned int magic;
    unsigned int version;
    int stateCount;
    State* states;
};
</syntaxhighlight>

Latest revision as of 10:05, 27 January 2025

Particle Location
Resource TypeEffects
File Extension.effdb
Used In Games
Container FormatBINA
Editing Tools
Reverse Engineering StatusDone

Particle Location (also known as effdb and Particle Locator) is the so called Effect Database format that's used to spawn particles and sound effects for any Animation State. It coincides with the Animation State Machine format as it contains an array for every state in that file.

Every state can have any amount of particles and/or sounds (in Sonic Forces only one sound can be used per state) attached to it, every particle can have its own offset in terms of position, rotation and scale.

File Format[edit | edit source]

It's made up of a list of states each containing a list of particles and sounds.

Each state containing:

- State name, the name of the state it should add onto

- Particles, list of the particles that should be added

- Sounds, list of the sounds that should be used, a simple list of sound names, (in Sonic Forces this is not an array but just a singular sound name)

Now, each particle contains:

- Attached to bone, decides whetever it should be attached to a bone

- Use Position, decides if it should use the position value

- Use Rotation, decides if it should use the rotation value

- Use Scale, decides if it should use the scale value

- Particle Name, the name of the particle (.cemt) it should use

- Bone name, the name of the bone it should attach to, won't be used if the Attached to bone is set to false

- Position, a position offset it should attach with, won't be used if the Use Position is set to false

- Rotation, a rotation offset it should attach with, won't be used if the Use Rotation is set to false

- Scale, a scale offset it should attach with, won't be used if the Use Scale is set to false

Technical info[edit | edit source]

struct Particle {
    enum class Flag : unsigned char {
        IGNORE_RELATIVE_POSITION,
        USE_POSITION,
        USE_ROTATION,
        USE_SCALE,
    };

    bool attachedToBone;
    Bitset<Flag> flags;
    const char* particleName;
    const char* boneName;
    Vector3 position;
    Quaternion rotation;
    Vector3 scale;
};
struct State {
    const char* stateName;
    int particleCount;
    Particle particles*;
    int soundNameCount;
    const char** soundNames; // in Forces const char*
};
struct EffdbData{
    unsigned int magic;
    unsigned int version;
    int stateCount;
    State* states;
};