don't click here

SADX/SA1 Hacking/Modding

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

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I have no idea how the Chao Garden works in SA2.

    I've started work on a new SADXMDL which supports SA2 models by converting them to SA1 format. So far I've found an Egg Chao model, an Omochao model, and Cream's models (one for each animation frame).
    [​IMG]
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    New SADXPCTools release.
    Now SADXLVL2 uses SA1LVL files instead of INI files, which makes them smaller, and it includes object definitions for the Solid Cube, Springs, Dash Panel, Swinging Spike Ball, Falling Spike Ball, and Ring Group (although it still seems to only work if you click on the first ring).
    [​IMG]

    I've also included a very basic version of SADXMDL2, which can open models from any binary type for SA1, SADX and SA2 and INI files, and save to INI. Other than that, you can't edit the models in any way yet.

    And I'm debating if I should try to include animations in the model file, or just a list of animation files.
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I have figured out enough of the SA2 versions of the LandTable and COL structs to convert them to SA1 format. To aid in that, I've written a program to extract level data from various files into an SA1LVL file used by SADXLVL2. You can download it [url="http://x-hax.cultnet.net/MainMemory/LevelExtractor.7z]here[/url]. Currently I only know that City Escape is at 0xAC774 in STG13.bin, and it uses the SA2 Level key, which is listed in the dropdown menu.

    In case anybody's wondering, the structs:
    Code (Text):
    1. 00000000 LandTable       struc ; (sizeof=0x20)
    2. 00000000 COLCount:       .data.w ?               ; base 10
    3. 00000002 anonymous_1:    .data.w ?               ; base 10
    4. 00000004 anonymous_2:    .data.l ?
    5. 00000008 anonymous_3:    .data.l ?
    6. 0000000C anonymous_4:    .float ?
    7. 00000010 COL:            .data.l ?               ; offset (00000000)
    8. 00000014 Anim:           .data.l ?               ; offset (00000000)
    9. 00000018 TextureFileName:.data.l ?               ; offset (00000000)
    10. 0000001C TextureList:    .data.l ?               ; offset (00000000)
    11. 00000020 LandTable       ends
    12. ---------------------------------------------------------------------------
    13. 00000000 COL             struc ; (sizeof=0x20)
    14. 00000000 Position:       Vector3 ?
    15. 0000000C Radius:         .float ?
    16. 00000010 Model:          .data.l ?               ; offset (00000000)
    17. 00000014 anonymous_3:    .data.l ?
    18. 00000018 anonymous_4:    .data.l ?
    19. 0000001C Flags:          .data.l ?
    20. 00000020 COL             ends
    Edit: Do note that while SADX levels are 1-5MB, City Escape is 49MB.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I've found Green Hill at 4F1E0, and I noticed that neither level has the solid flag set on any models (they're almost all 0x80000000 (Visible)). So either the flags changed meaning, or collision is handled separately in SA2. Also Green Hill is 14.3MB.
     
  5. PicklePower

    PicklePower

    Wiki Sysop
    632
    26
    28
    I know that outside of your findings, MainMemory, there isn't a whole lot of activity in this topic, but I do find this to be one of the most interesting threads on Retro at the moment. Even though I don't know a whole lot on the technical side of things, it's really interesting to see these games taken apart. Particularly fascinating is the idea of looking into SA2 for a change. Videos and pictures are great too. :v:

    Just know that there are some very interested eyes still looking at this topic. :P
     
  6. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    49 mb is kind of ridiculous, that's almost the size of sonic.exe for sadx. Is that just the level, or does it include all the code and item models?
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    That is just the level data, in SA1 format. The original file is 2.26MB for all code and data.

    And I checked my code, and it only saves each unique ATTACH once, based on address.

    Edit: Picture:
    [​IMG]
     
  8. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    So then it is processing instances properly. I wonder what's causing the massive surge in size. Is that 2.26 mb after prs decompression (assuming the original file was compressed)?
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Yes.
     
  10. Turbohog

    Turbohog

    Member
    927
    118
    43
    Just wanted to say how interesting and amazing this is, especially the SA2 model work you've done. I've actually been trying to get an SA2 level in SADXlvl2 or SAMDL for hours now haha. I can do it fine with the level extractor, but whenever I try to do it in SAMDL so I can import the textures and save it as an ini, I get an error. Anyways, keep it up! Your work won't go unappreciated!
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    New SADXPCTools Release

    SADXLVL2 can now export levels to obj, and the graphical issue with Green Hill above is fixed.

    SADXMDL2 has been renamed to SAMDL, as it's not just for SADX (and in fact, neither is SADXMDL).

    split.ini includes the following new files:
    • Level lists for trial mode in Misc/Level List
    • Adventure Field start positions (returning from action stage) in Levels/Start Pos
    • Sound Test lists, with song name and numbers in Misc/Sound Test
    • Music list, you can only edit the existing entries, not add new ones, in Misc/Music List.ini
    • Sound Effect banks for Emerald Coast and Sonic (others coming eventually) in Misc/Sound Effects
    • Character Identifiers for SET/CAM files, in Misc/Character Identifiers.txt
     
  12. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Another SADXPCTools release

    Now I've added SALVL, a clone of SADXLVL designed to work only with .sa1lvl/.sa2lvl files, with the ability to load levels from exe, dll or bin files as well (like SAMDL).

    Additionally split.ini now contains:
    • Which level you go to after completing a level in Adventure/Mission mode, in Misc/Level Order
    • Text for all the cutscenes in all languages, in Misc/Cutscene Text
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    In a particularly egregious case of Sonic Team leaving unused code in the game, the file MOVIE.BIN in the system folder is an SFD player from the Dreamcast version. It is used in the DC version, but in the PC version it's just a useless file full of SH4 code.
    I will note that the copy of MOVIE.BIN from my copy of SA1 does not match SADXPC's, although I'm unsure what version I have, there's probably a version of SA1 somewhere that has an exact match for the file.

    I've also put a partial disassembly in the SADXPC disassembly folder on the SVN.
     
  14. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    That is really cool... although considering the PC version's use of mpeg files I'm willing to wager that move.bin isn't used there, or is a shortcut to some other predefined function.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    MOVIE.BIN is not referenced at all in sonic.exe, Windows Media Player handles video playback in the PC version.
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    I have figured out enough of the FONTDATA0.BIN and FONTDATA1.BIN files to make an editor. 0 is Japanese, 1 is ASCII/European. Left click to draw with white, right click to draw with black.

    This is the text used for subtitles.
     
  17. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    I have always wanted to be able to do that!
     
  18. TorchicBlaziken

    TorchicBlaziken

    Member
    6
    0
    0
    It would be cool if someone managed to hack Super Knuckles into the game.
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,742
    338
    63
    SonLVL
    Yes it would be.

    In other news, SADXPCTools etc

    SADXLVL2 now views and edits Death Zones, and you can change which characters they affect, a feature Sonic Adventure doesn't seem to use.
     
  20. Could this mean that the font could finally be replaced with the one from the DC/GC versions?