Jump to content

Resources/ObjectWorld / GEdit: Difference between revisions

From HEModdingWiki
Ashrindy (talk | contribs)
No edit summary
Ashrindy (talk | contribs)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Object World''' ''(more well known as GEdit)'' is the set object data format for Hedgehog Engine 2 games.
{{Infobox Resource|type=[[Resources#Set Objects|Set Objects]]|extension=.gedit|games=* [[Sonic Forces|Sonic Forces]]
* [[Sonic Origins|Sonic Origins]]
* [[Sonic Frontiers|Sonic Frontiers]]
* [[Shadow Generations|Shadow Generations]]|tools=* [[Tools/Blendhog Level Creator|Blendhog Level Creator]]
* [[Tools/DevTools|DevTools]]
* [[Tools/HedgeSet|HedgeSet]]
* [[Tools/Restoration Issue Pocketknife|Restoration Issue Pocketknife]]|status=Done|container=BINA|name=Object World}}
'''Object World''' ''(more well known as GEdit)'' is the set object data format for Hedgehog Engine 2 games. Set object data is a list of objects that should spawn in the stage, such as Springs, Rings, Goal Rings and more.
 
== File Format ==
It's made up of a list of objects using '''[[Resources/Reflection|Reflection]]''' for their parameters.
 
Each object containing:
 
- '''GUID''', unique for every object as its their identifier
 
- '''Parent GUID''', the object its parented to, referenced by a GUID
 
- '''Object Name''', the name of the object
 
- '''Type Name''', name of the object type
 
- '''Position''', the position of the object
 
- '''Rotation''', the rotation of the object
 
- '''Components''', a list of Game Object Components ''(more known as tags),'' they are used to spawn GOComponents for the Game Object such as GOCActivator (RangeSpawning), to determine the Game Objects spawning distance
 
- '''Parameters''', these are just the parameters of the object, every Object Type has a set of their own, e.g. Springs have a parameter for the velocity for when the player touches them. These are using [[Resources/Reflection|Reflection]]. The reflection resources are included in their entirety (minus BinaryFile container), but the parameter pointer points directly to the data. I.e., in games that use Reflection v2, which contains a small header, the headers are included in the gedit resource, but the pointers point to the internal data object.
 
== Technical info ==
Structs taken from [https://www.github.com/angryzor/universal-csl universal-csl]<syntaxhighlight lang="c++">
struct ComponentData {
    unsigned long long unk1;
    const char* type;
    unsigned long long size;
    void* data; // reflection
};
</syntaxhighlight><syntaxhighlight lang="c++">struct ObjectTransformData {
    Position position;
    Position rotation;
};
 
struct ObjectId {
    // Forces
    unsigned int id{};
 
    // Frontiers and onward
    uint64_t objectId{};
    uint64_t groupId{};
};
 
struct ObjectData {
    enum class Flag : unsigned int {
        DEALLOCATE,
        DEALLOCATE_SPAWNER_DATA,
    };
 
    Bitset<Flag> flags;
    const char* gameObjectClass;
    VariableString name; // const char* in Forces
    ObjectId id;
    ObjectId parentID;
    ObjectTransformData transform;
    ObjectTransformData localTransform;
    Array<ComponentData*> componentData;
    void* spawnerData; // reflection
};</syntaxhighlight><syntaxhighlight lang="c++">
struct ObjectWorldData {
    unsigned int unk1;
    unsigned int unk2;
    unsigned char flags;
    Array<ObjectData*> objects;
};
</syntaxhighlight>

Latest revision as of 10:23, 27 January 2025

Object World
Resource TypeSet Objects
File Extension.gedit
Used In Games
Container FormatBINA
Editing Tools
Reverse Engineering StatusDone

Object World (more well known as GEdit) is the set object data format for Hedgehog Engine 2 games. Set object data is a list of objects that should spawn in the stage, such as Springs, Rings, Goal Rings and more.

File Format[edit | edit source]

It's made up of a list of objects using Reflection for their parameters.

Each object containing:

- GUID, unique for every object as its their identifier

- Parent GUID, the object its parented to, referenced by a GUID

- Object Name, the name of the object

- Type Name, name of the object type

- Position, the position of the object

- Rotation, the rotation of the object

- Components, a list of Game Object Components (more known as tags), they are used to spawn GOComponents for the Game Object such as GOCActivator (RangeSpawning), to determine the Game Objects spawning distance

- Parameters, these are just the parameters of the object, every Object Type has a set of their own, e.g. Springs have a parameter for the velocity for when the player touches them. These are using Reflection. The reflection resources are included in their entirety (minus BinaryFile container), but the parameter pointer points directly to the data. I.e., in games that use Reflection v2, which contains a small header, the headers are included in the gedit resource, but the pointers point to the internal data object.

Technical info[edit | edit source]

Structs taken from universal-csl

struct ComponentData {
    unsigned long long unk1;
    const char* type;
    unsigned long long size;
    void* data; // reflection
};
struct ObjectTransformData {
    Position position;
    Position rotation;
};

struct ObjectId {
    // Forces
    unsigned int id{};

    // Frontiers and onward
    uint64_t objectId{};
    uint64_t groupId{};
};

struct ObjectData {
    enum class Flag : unsigned int {
        DEALLOCATE,
        DEALLOCATE_SPAWNER_DATA,
    };

    Bitset<Flag> flags;
    const char* gameObjectClass;
    VariableString name; // const char* in Forces
    ObjectId id;
    ObjectId parentID;
    ObjectTransformData transform;
    ObjectTransformData localTransform;
    Array<ComponentData*> componentData;
    void* spawnerData; // reflection
};
struct ObjectWorldData {
    unsigned int unk1;
    unsigned int unk2;
    unsigned char flags;
    Array<ObjectData*> objects;
};