don't click here

SADX/SA1 Hacking/Modding

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

  1. DustArma

    DustArma

    Member
    1,337
    10
    18
    Santiago, Chile
    Learning Python.
    Time Eater in Sonic the Hedgehog 1
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    My latest shocking discovery: all versions of SA1 use (roughly) the same save file format. Of course, the SADX saves have some new values for missions and stuff somewhere, and the GC version is byteswapped, but I was able to locate Sonic's event flags at the same location after the header in each of them. Strangely enough, the SA1 save is the biggest.
    Note that just because you know where the data is does not mean you can edit it, because all of them are checksum protected, and the function I extracted from SADXPC only works for SADXPC.
    Header sizes:
    DC: 0x480 (.VMS)
    GC: 0x1480 (.GCI)
    PC: 0x0 (.SNC)
    General save file info is at SCHG:Sonic Adventure DX: PC/Save Files
     
  3. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Right, so I know I'm supposed to be working on this sprite mappings editor (even though I never said I was definitely going to), but for some reason I decided instead that now is an excellent time to go through the save file, document it all in SCHG:Sonic Adventure/Main Save File, and also make a webpage to show the contents of save files in table format. I'm also considering making it into an editor, I just have to figure out the rest of the file, and obtain a clean SA1 save file to use as a template.
     
  4. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    So I'm trying to use SADXMDL to change the in game models to those used from Generations. Only problem is I don't know what I'm doing. The Generations models I have are in a .model format. How can I change them to fit with the formats used in the SADXMDL program? Any conversion tools out there?
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SADXMDL accepts .obj models, which most 3D programs can export. So it's just a matter of you finding a program that can import .model.
    --------
    I have released a new version of SADXsndSharp, which adds support for opening and saving the .dat files from the 2010 port, which have a different header string, and use ADX instead of WAV (the files are still named .wav though).
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    My Sonic Adventure Save File Info page has been completed, and now serves as an editor and converter as well. It accepts Dreamcast (.VMS), Gamecube (.GCI), and PC (.SNC) files, and can create Gamecube (.GCI) or PC (.SNC) files. If somebody could get me a blank save file (create file then quit) for SADXGC EU, SADXGC JP, SA1 US, SA1 EU, and SA1 JP, that would help me greatly.
     
  7. I've been keeping an eye on Sonic Adventure modding for a while, but I have a problem that stops me from utilizing other people's mods, much less my own (save for sounds and textures). I have no idea what causes the glitch but I've seen that quite a few people suffer the same thing as I. The problem is that creating custom character models crashes the game at the character select screen - or on level beginning if you choose Metal Sonic (even on a morph-target code-killed exe). Upon looking into the problem as best I can - as I'm no programmer - I've noticed that the majority of people affected are Windows Vista users, like myself, and that the problem seems to center around mods created using SADXMDL (I tested this one myself - simply changing an exisitng character's texture in SADXMDL causes a CTD). Clearly it's no programming flaw in SADXMDL or any other program - as it works fine for quite a few people, so it seems to be something system-specific. Since Vista does not seem to give any detailed information on a crash (unlike Windows XP), I have no idea what actually causes it to do so, but I'd be willing to act as a guinea pig should anybody ever try to solve this problem.

    It might be that MainMemory's SADXLVL2 could solve this problem altogether. We'll have to wait and see.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Something you can try: get Cheat Engine, open the sonic.exe process when you have a modified chrmodels.dll opened (but before it crashes), open the Memory View, go to View -> Enumerate DLL's and Symbols, find chrmodels in that window, and tell me what is next to it. I have a feeling that some other DLL may be injecting itself into sonic.exe's address space at 0x10000000 and forcing chrmodels.dll to load at another address.
     
  9. 07600000 is the number next to that entry - quite the bit before it's supposed to be by the looks of things. Upon reloading, it's moved to 07000000.

    Something called eNetHook takes up the space at 0x10000000. According to my computer, it's an ACER laptop DLL, used by ACer eNet Management service (a legitimate process on my laptop)
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    The only ways to fix this are either uninstalling the offending software (which it sounds like you don't want to do) or figure out a way to build a brand new chrmodels.dll for mods and get everyone to use that.
     
  11. It's a shame there's no way to patch it by removing the module from the memory or by switching it with the chrmodels module. Unfortunately, as far as I can tell, I need the application the DLL is associated with. It seems to only inject two actions in: StartSwWatching at 10001220 and StopSwWatching at 100012D0 (it leaves a lot of empty space in memory that would presumably be occupied with).

    The resolution for the time being, rather than uninstalling it outright might be to change its permissions (it's automatically started by the system so it might change if I change it to manual start)

    EDIT: Fixed it. You were half right. I looked up enethook.dll, and where it was wasn't where it was supposed to be. According to the info, it's a useless dll file placed inside the System32 folder that can inject itself into applications. Here, it injected itself into SADX. Fixing it removed the error. Thanks for all the help. Now to find a way round obj2nj's crashing, then I can get new models ingame.
     
  12. I was starting to plan out things to do with Sonic Adventure, and even downloaded a PC copy even though I already own a GameCube version. Anyways, I wanted to know a couple of things before I start planning anything around them.

    1: Can you remove certain characters outright? I know that absolutely nobody liked Big's storyline, and I figured removing it from the game entirely would be a benefit.

    2: Does each character have their own level data, or do they all just go to the same level, but different parts of the level. Basically, I want to rework certain levels for some characters without changing them for others (example: editing Twinkle Park for Amy, but leaving it intact for Sonic)

    3: Since this is the PC version of the game, can I add new levels instead of just replacing existing ones? I know that hacking a console game generally means that you have to replace more rather than adding completely new things, but I wasn't sure if a PC game was the same way.

    4: Can I remove the Adventure fields and just have things go straight from level to level like in Sonic Adventure 2? I didn't really like how you had to mess around there rather than just go straight to the next level.

    5: Can I change the mission goals for certain characters? I would like to give Knuckles simple "get to the goal" levels, and possible replace Amy's "Escape Zero" missions with something like "Catch Sonic" or give her racing levels like Tails. Having her chasing Sonic or trying to beat him to a specific location seems more into her character. Plus, having to find efficient routes to make up for her much slower speed would make a good challenge.

    6: Final question (for now), is it possible to port features from Sonic Adventure 2 into Sonic Adventure DX? I don't exactly recall if they were already in, but I would like to add grind rails (just not go overboard with them, light use like in City Escape) and possibly the skateboard from City Escape. It moves forward automatically, so I was thinking it could be used as a similar (but less frustrating) version of the high-speed segments in Sonic '06. I'm starting to think it might just be the same as the snowboard or sand-board in DX already, but I don't remember if you can have a getting-off part so it's not taking up the entire level.
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    1. The best you can do right now is provide a default save file with all of Big's emblems collected and his character selection locked.

    2. You can change objects around for each character individually, but the geometry is constant (this is why Sonic and Knuckles have separate segments for the Chaos 6 fight).

    3. I don't think I've found all the tables that would need editing to add a new level slot yet.

    4. It would probably require a bunch of ASM edits in various places, but it could theoretically be done.

    5. You can add a Prison Capsule to any of Knuckles' levels, which will end the level when activated, and remove the Emerald Shards. You might be able to modify the "2P Sonic" object to load for Amy and use different routes than Tails' levels.

    6. Adding grinding would require a ton of ASM edits, and a new object. The snow/sand board does have a method to disable it (you get off it at the end of Ice Cap). Can't remember if it's an object or if it's hardcoded right now though.
     
  14. I wonder if the Chaos Emeralds can be replaced with a Goal Ring since they share a similar characteristic to end the level when approached... it'd remove the need to the Prison Capsules.

    Shame I can't actually get a Goal Ring in to test though.
     
  15. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    What other player gimmicks can be put in exactly? Can ZERO, the E-Series bosses or even Froggy be put in?

    The latter would be ideal for a gag hack. Big fishing in all eleven levels. :v:

    Hmm, for separate level slots, does Sand Hill have multiple character slots? I suppose it may have potential to be edited into a full level for someone other than Sonic/Tails, depending on how compatable it's level construction is.
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    All three of those are objects that can be placed in any level. However I think the E-Series bosses are programmed to go to the location that they're fought at in the original levels.

    Sand Hill doesn't have any other segments, so the most you could do is different object layouts and start positions per character.
     
  17. E-122-Psi

    E-122-Psi

    Member
    2,470
    612
    93
    Hmm, is it possible to edit water into levels, along with fish? If so, imagine the possibilities. :v:

    Ah, I see, shame, would be neat to make a full desert level out of it's textures and objects, especially since it was apparently planned at some point.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    You can make any part of the level's geometry behave as water, but generally the visible part is an object specific to each level.
     
  19. Turbohog

    Turbohog

    Member
    923
    117
    43
    I've got a quick question myself. I imported Green Hill's landtable from SA2 into Emerald Coast a while back using your level extractor, and I successfully changed the textures for the objects and background, but I still can't seem to figure out the textures for the actual level. All of the land itself is invisible when I play it, but it's all perfectly visible in SAMDL and SADXLVL2. From what I've gathered, this has to do with the materials and obviously, the textures...replacing Beach01.pvm with the Green Hill pvm doesn't fix this either...

    I don't really know where to go and I'm honestly tired of blindly trying things...any advice?
     
  20. By any chance, do the names of the textures themselves have to match the textures used in the original Emerald Coast, not just the PVM name?