SADX/SA1 Hacking/Modding

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 15, 2009.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    Which version it works for depends on the tool in question, and the available information.
    Here's a general rundown:
    • SADXLVL and SADXTweaker work for the US and EU releases of SADXPC2004.
    • SADXMDL works with any version of SA1 or SADXPC, but only SA1 US and SADXPC2004 US/EU have addresses on the SCHG.
    • SA1LVL works with the US version of SA1.
    • SETedit works with any version of SA1, SADXPC or SA2, and with SETswitch, can be used with SADXGC and SA2B as well.
    • split, build, SADXTweaker2 and SADXLVL2 work with the US release of SADXPC2004.
    • SALVL and SAMDL work with any version of SA1, SADXPC, SA2 or SA2B, but only SA1 US, SADXPC2004 US/EU, and SA2 US have addresses on the SCHG. These tools cannot save data back into the files they read from however, a separate tool (like build) is needed.

    I should note that the versions of SADXPC released by Mastertronic and Sold-Out Software are not supported by anything.
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    SADXPCTools update:
    • Added "sa1model" and "sa2model" types to split/build.
    • Model and level files use a new chunk-based metadata format, rather than adding a pointer to the header for each type of metadata. Metadata types include LABL (labels), AUTH (author), DESC (description), TOOL (tool used to generate file), ANIM (animations; models only), MORF (morph targets; models only).
    • LevelExtractor has additional fields for specifying author and description.
    • SALVL has an additional info window with fields for texture file name, texture list, author, and description.
    I have also noticed that there is no real reason why SADXLVL2 can't support SA1 as well, the only thing missing is support for non-PE files in the split tool. SA2 support may also be possible, if I can figure out how to manage the two SET files it requires. However, an equivalent build tool may not be possible.
     
  3. PkR

    PkR

    Member
    191
    24
    18
    SADX Dreamcast Conversion, The Emeralds' Awakening
    Has anyone been able to extract level lighting data from SA1 levels? I'm trying to reimport Dreamcast landtable files into SADX (thanks to MainMemory for the hint on the texture list pointer) and it works for the most part except that the lighting is messed up. Any ideas on how to get this to work?
    Ice Cap with Dreamcast landtable in SADX looks like this:
    [​IMG]
    While it should look like this:
    [​IMG]
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    Unfortunately PkR, I do not know if it is even possible to recreate the lighting from SA1 in SADXPC. I also know very little about lighting (if I knew more, SADXLVL2 would have better lighting).

    For anyone interested, I have documented the SA1MDL format my tools use. The SA2MDL, SA1LVL and SA2LVL formats are basically the same, only changing the Magic value and type of data stored at the "Model" pointer (SA2 OBJECT, SA1 LandTable and SA2 LandTable respectively).
     
  5. Alonguy

    Alonguy

    私はここで何をしているんだ?もう10年も前のことなのに... Member
    5
    0
    1
    Long Beach, California
    Alonguy - 3D Action-RPG
    Hey guys, I have a quick question. I was wondering if it's currently possible to edit the draw distance in SADX? I already saw (and applied) a hack earlier in this thread to get it to render in 24-bit mode, but I was wondering if anyone knows/has figured out how one might change the draw distance? I've searched for something on it for quite some time. Any help would be greatly appreciated, thanks.
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    Unfortunately I have not yet found a way to increase the draw distance. Objects can have their loading distance increased but the level models are stuck with the default.
     
  7. Alonguy

    Alonguy

    私はここで何をしているんだ?もう10年も前のことなのに... Member
    5
    0
    1
    Long Beach, California
    Alonguy - 3D Action-RPG
    Ah, that's a bummer. That's like, the one thing that bugs me about SADX PC. If I recall correctly, the "preview" prototype for Gamecube had an option to change something like that... or I could be wrong. Haven't played with that disc for almost a year now. But then again, that was a prototype - everything was prolly pretty open. I would try to find it myself, but unlike the amazing people here, I don't have nearly as much skill or patience with this kinda thing. XD
    Thanks for the info. Oh, and while I'm at it... do you know a place I could possibly get the latest version of Nettapu's PVM tools? I've only found one place to download it, and this version's repacked archives crash the game. I even tried unpacking/repacking a clean PVM with no modifications, still crashed on loading. So I know it's not my photoshop plugin.... I'm sorry if I'm a bother, it's just frustrating not to be able to do hi-res texture mods anymore.
     
  8. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Draw distance is a per-level value. The only one that has been released to the public so far are the ones for Emerald Coast.

    Code (Text):
    1.  
    2. Some of this data appears to be synonymous with data available in the sadx preview debugger, like skybox and viewport clipping parameters.
    3.  
    4. [cliplevel=0]
    5. 11115743 - X scale for the skybox in seg 0 (float); default is 1.45
    6. 11115748 - y scale for the skybox in seg 0 (float); default is 1.23
    7. 11115752 - z scale for the skybox in seg 0 (float); default is 1.11
    8.  
    9. [cliplevel=1]
    10. 11115756 - X scale for the skybox in seg 0 (float); default is 0.72500002
    11. 11115760 -Y scale for the skybox in seg 0 (float); default is 0.61500001
    12. 11115764 - Z scale for the skybox in seg 0 (float); default is 0.55500001
    13.  
    14. [cliplevel=2]
    15. 11115768 - X scale for the skybox in segment 0 (float); default is 0.43500003
    16. 11115772 - Y scale for skybox in seg 0 (float); default is 0.36900002
    17. 11115776 - Z scale for skybox in seg 0 (float); default is 0.333
    18.  
    19. Somewhere in this random mess of floats between 11115852 and 11116704 lies the view distance data, and the information that dictates how the skybox and water levels move in relation to eachother. Start zeroing out stuff for weird effects.
    20.  
    21. 11115780 - ??? (float);
    22. 11115784 - ??? (float);
    23. 11115788 - ??? (float;)
    24.  
    25. 11115936 - ??? (float)
    26. 11115940 - ??? (float)
    27.  
    28.  
    29. [cliplevel=0]
    30. 11115852 - negative view limiter
    31. 11115856 - View distance (negative, default is -4569)
    32. 11115860 - skybox floor setting (default is -1, -20 will have the skybox's floor at sonic's feet)
    33.  
    34. 11115924 - Sonic rendering layer (default is -1, -2 makes sonic partially invisible, -20 puts sonic below water)
    35.  
    36. [cliplevel=2]
    37. 11115944 - x view distance (negative float)
    38. 11115944 - (-1)
    39. 11115952 - y view distance (negative)
    40.  
     
  9. Alonguy

    Alonguy

    私はここで何をしているんだ?もう10年も前のことなのに... Member
    5
    0
    1
    Long Beach, California
    Alonguy - 3D Action-RPG
    Ah, that's quite interesting... I'm going to play with these, thanks.
    Everything in SADX is so packed down and hardcoded. XD
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    Wow I totally forgot about the other two per-act per-cliplevel settings. They are both stored as three sets of two floats, the first always being -1 (changing it makes weird stuff happen), and the second being a negative draw distance. The first set appears to affect the skybox, while the second affects everything else. The first structure is loaded to 3ABDCA0, and the second to 3ABDC70. However simply increasing the drawing distance is not quite as simple as making the value a larger negative number, because even with the default draw distance, models often end up running into the skybox, so you won't be able to see them unless you enlarge or remove the skybox.
     
  11. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    This isn't mine but it's really cool:

    http://www.youtube.com/watch?v=I-aNHU81YFI&feature=g-all-lik
     
  12. MykonosFan

    MykonosFan

    MODE CHANGE. Moderator
    3,746
    550
    93
    It also doesn't exist, apparently. :v:
     
  13. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    It's a stupid board filter. The auto 'I' capitalization feature =/
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    At 5131F0 are the "Level A" target times for the first 13 levels as Sonic, followed by the same for Knuckles, Amy and Gamma. Each item is a 32-bit (4 byte) integer indicating the number of frames (1/60 second) that your time has to be under (over for Gamma). For example, at 5131F4 is Sonic's target time for Emerald Coast, 7200 / 60 = 120 seconds / 60 = 2 minutes. Changing the time listed here does not change the texture displayed at the start of the level, that's all done in code elsewhere.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    I have updated SADXPCTools with support for splitting data from SA1 and SA2:
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    SADXPCTools update, fixes a whole bunch of bugs with animations.
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    I have been trying lately to add support for the Xbox 360, PS3 and Steam versions of SADX to my save file editor SASave. I've got the Steam version figured out, and the 360 version mostly figured out, except for four bytes that got added to the start of the file, with a value of 1. It's not included in the checksum, and it also does not exist in the Steam version's save, so I'm thinking it's a toggle for the DLC? If somebody without the DLC could send me a save file (or just try switching byte 3 to 01 in your save), and someone with the PS3 version send me a file as well, I could add full support for these versions.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,744
    338
    63
    SonLVL
    So today I heard about that did you know gaming thing where they asserted that Tikal was once playable because the moonjump code made her jump. I had already thought that Tikal and Eggman might have been playable because they both have slots in the character list, SET file suffixes, and textures listed with the other characters'.

    So, I tried switching the code to load the regular characters to load them instead:
    http://youtu.be/YGebZNZ2QEI
    http://youtu.be/08nS4gJFLZs

    They both have only the most basic movement functions, walking and jumping. They can't hurt or get hurt by enemies and obstacles, and cannot run on wind paths and some loops. Pressing the Action button (A on keyboard) activates the free movement mode which is normally only active when debug is on.
     
  19. Interesting... this definitely adds weight to the theory they were to be playable. I wonder, one day, if/when we figure SADX out completely, if we can add those characters back in completely.
     
  20. This might sound stupid, but is it possible that this was simply something like a simple way to get cutscenes to work? Have the computer control the characters identically to how the player controls Sonic, and the cutscenes are worked by telling the computer to walk the character forward like on a speedrun video file you play on an emulator? (runs the "video" by telling the emulator to play itself)

    I kind of get the feeling that I'm not explaining this correctly, so I hope this is getting across right.