don't click here

Issue 1: Sonic Adventure PC and DC model formats

Discussion in 'Engineering & Reverse Engineering' started by SANiK, Dec 14, 2004.

Thread Status:
Not open for further replies.
  1. SANiK

    SANiK

    Tech Member
    413
    0
    16
    In hopes of getting more beginners interested in next gen hacking, I am going to be releasing my notes on the model formats and later on other formats. Do note, the point of these issues is to hopefully show that SEGA used the SAME format from game to game. The format first appeared in the game NiGHTs, then it got updated and was used in Sonic Adventure, to be updated and used again in the Dreamcast BIOS, then in SA2, then in PSO, etc. Due bear in mind that some notes may have errors and some are incomplete.

    Issues that I will be releasing:
    • Issue 1: Sonic Adventure PC and DC model formats (version 2 of format)
    • Issue 2: Nights model format (version 1 of format)
    • Issue 3: Sonic Adventure 2 model format (version 3 of format)
    Memory sizes that I use:
    • byte = 1 byte
    • word = 2 bytes
    • dword = 4 bytes
    • ----------------
    • sbyte = 1 byte (signed)
    • sword = 2 bytes (signed)
    • sdword = 4 bytes (signed)
    • ----------------
    • float = 4 bytes
    • pointer = 4 bytes
    Hopefully that clears up how the structure works.
    *gets to work on describing the Sonic Adventure 2 and NiGHTs model format*

    *Refer to the Cult for newer versions of this guide if you think something might have been fixed up*
     
  2. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Then you can tell me, what 3D interface do Sonic Adventure for DC use?

    QUADS? That's OpenGL right?
     
  3. SANiK

    SANiK

    Tech Member
    413
    0
    16
    Well, the models CAN support quads, but it's never used.

    Sonic Adventure DX uses Direct-X due to Microsoft and SEGA teaming up in designing the Dreamcast. When they did this, they made a package to allow programming of DC games on the PC and then to easily port them to the DC with no changes. This is why SEGA (if they want) can easily make a PC port of Sonic Adventure 2.
     
  4. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Cool.

    But how do you port SA DX to Gamecube and Playstation 2?
     
  5. SANiK

    SANiK

    Tech Member
    413
    0
    16
    SADX was never on the PS2...
    As for the Gamecube, they probably made another library/package to port the game. This btw is not rare at all in the game industry.
     
  6. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Okay. I actually don't know much about 3-D worldspace coordinates and camera settings but I would like to learn.



    And I noticed this:
    Code (Text):
    1. dword material; //Material struct was cracked by Dude, waiting for info for it. (This is actually a pointer to data)
    should be dword*

    And I would not mix up struct OBJECT and OBJECT. Put it like this:
    Code (Text):
    1. typedef struct _OBJECT
    2. {
    3.   struct _OBJECT *child;
    4. } OBJECT;
     
  7. SANiK

    SANiK

    Tech Member
    413
    0
    16
    Well, there's nothing much to it except that instead of the X and Y axis, you have the Z axis. A float is used to store fractional numbers (e.g. 100.23 )for anyone that didn't know.

    Nice that you noticed, but the reason it's a dword is because I don't have a structure to attach it to. (Dude needs to finish cracking the rest)
    If Dude does finish the material struct, it would become this then:
    MATERIAL *material; //Points to a material structure

    But doing dword material will prevent someone from mistakenly pointing to unknown regions.

    Hope that helped to clear that up.

    Well, you can do that, but it really makes no difference. The other way is accepted also because it's part of the standard.

    Keep asking questions. I'll gladly try to answer them!
     
  8. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    veeery incompleteness

    Material Struct - Hacked by Dude
    ================================
    Dword Start; // Always B2 B2 B2 FF
    Byte BlueLight;
    Byte GreenLight;
    Byte RedLight;
    void (3 bytes) UnID1;
    Byte UnID2; // seems to be 30 in most cases
    Byte UnID3; // seems to be 41 in most cases
    Byte TexID;
    Byte SomethingImportant; // crashes when put to FF
    void (3 bytes) UnID4;
    Byte unID5; // seems to be Ax (x being a variable)
    Byte Spheremap; // 29 = normal; 69 = spheremap
    Byte EndOfStruct; // always 94
     
  9. Lostgame

    Lostgame

    producer/turnablist. homebrew dev. cosplayer. Oldbie
    4,134
    58
    28
    Toronto, ON
    The O.I.C.
    Well, is there a way to get textures on to these things in 3DS format? I wanna import the models for Tails into a game with the textures...
     
  10. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Not yet. The UVW format is quirky
     
  11. ICEknight

    ICEknight

    Researcher Researcher
    Just wondering... Are the Sky Chase low-quality Sonic & Tails models using the same format than the rest of the SA graphics, or an older version?
     
  12. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    SA uses the oldest 3d graphics in the ninja format anyway. I don't think there's any oddities. Though you should keep in mind that the sky chase models are low poly due to the sheer amount of polygons in that area.
     
  13. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Does that mean optimized models to show less polygons, or a special set of models for the scene?
     
  14. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Just for that scene. Dynamic resolution models didn't come in until sa2
     
  15. LOst

    LOst

    Tech Member
    4,891
    8
    18
    I don't understand how cameras work in 3-D world space. I have an Direct3D 9 engine that I use, but I have no light, and no 3-D at all. I use special 2-D vertices... Not transformed and not lit I guess. X and Y are screen coordinates. No perspectives.
     
Thread Status:
Not open for further replies.