don't click here

SA2/SADX Mod Loader

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 4, 2013.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SA Tools now has a Struct Converter program which loads a data ini generated by the split tool and allows you to export various data as a mod loader compatible C file.
    Currently some types of lists won't get entries in the pointers array because when I was still editing the exe directly I had the brilliant idea to update the list header that was already there, rather than appending a new list header to the end of the exe and changing the pointer, which doesn't work very well with this setup.
    Additionally SAMDL and SALVL can now export C data files themselves.

    The SADXModLoader.h and SA2ModLoader.h files were also updated because I was missing a few structs and enums.

    Edit: Fixed some bugs.
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SA2 Mod Loader update: now it should ACTUALLY BE ABLE TO REPLACE MUSIC. Also I removed a redundant variable and allowed it to detect paths that use / instead of \.
     
  3. The mod loaders work great! I especially like the "install" feature.

    I have a hopefully small request. For the SADX Mod Manager, would it be possible to add support for the custom resolution 1440x1080? I ask because the full 16:9 1920x1080 cuts off the top and bottom of the FOV, and 1440x1080 is the 4:3 resolution that uses the entire y-axis of a 1080p monitor.

    Thank you for all the work you've put into the games.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    The SADX mod loader doesn't support specific resolutions, it merely allows you to specify a resolution, which is passed directly to SADX. If the resolution you want doesn't work, there's really nothing I can do about it because I have no clue how SADX's renderer works.
     
  5. Caverns 4

    Caverns 4

    Member
    346
    0
    16
    Sonic: Retold
    Okay, I have a question about this.

    You remember how I was interested in tweaking the character physics before?

    Would it be possible to make it a mod pack rather than something built into an EXE? I like the idea of having them be togglable rather than using several EXE's.
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I do not remember, but either way modifying the characters' physics is relatively simple in a mod.
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I've updated both mod loaders with some new features accessible from mod.ini files:
    • An EXEFile entry can be used to specify an alternative executable file (must be in the same folder as the original exe). The mod manager will run the specified exe instead of the default one when "Save and Play" is clicked, and the mod loader dll will show a warning if you use the wrong exe.
    • An IgnoreFiles section. In this section, you may list one file per line, and any accesses to files appearing in this section will be redirected to "nullfile".
    • A ReplaceFiles section. In this section, you may list a file name, an equals sign, and the name of the file you want to be read instead of the first file. For example, system\\sounddata\\bgm\\wma\\title.wma=system\\sounddata\\bgm\\wma\\sonic.wma will cause "It Doesn't Matter" to play on the main menu.
    • A SwapFiles section. This section behaves similarly to ReplaceFiles, except that the replacement happens both ways. So if you put the previous example in this section, it would also cause Sonic's credits to play the main menu song.

    A couple reminders about INIs:
    Section header names are enclosed in square brackets (for example, [ReplaceFiles]).
    My INI parser uses backslashes (\) for escape sequences. \n is a newline, \r is a carriage return, \\ is a backslash, and any other character following a backslash will be interpreted as a literal character. So if you want to put an = in a key or value, you must type \=.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I've uploaded a new version of the mod loaders that scan the mod folders for file replacements once on startup rather than every time a file is read. Should improve performance a little. Also the Init function in the ModInfo struct now has a const char *path parameter, which contains the mod's folder path.

    I was going to try to add save file redirection like CPKREDIR, but I don't see a way to make that happen without completely rewriting the save file code.
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Something I'm working on:
    [​IMG]
     
  11. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    Fantastic stuff right there. Also I'm not sure how difficult this would be but how hard would it be to make a mod that disables the music but not the sound effects?
     
  12. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Should be extremely easy, just have to write a retn instruction to the start of the PlayMusic function. A single byte edit that could be done with a code even.
     
  13. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    Ah, excellent then. With the music gone I can either play another song in the background or watch a show on another monitor.
     
  14. SpaceyBat

    SpaceyBat

    Member
    2,034
    289
    63
    United States
    Freedom Planet 2
    Good stuff!

    I'd love to see a mod that converts all of Tails' stages into Sonic's version by changing his starting maps and locations accordingly for each stage. Is that something that's possible through the mod loader or would the .exe itself have to be altered?
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    1. Um, what? I'm not following. 2. Anything that can be done by editing the exe can be done (usually better) with the mod loader.
     
  16. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    Idk how feasible this idea is but I think it'd be a great idea if it could be implemented in conjunction with the A to moon jump/float code (I assume that's how it works). A code along the lines of "Hold D-pad down to disable all collision" would be a great code for other characters to navigate levels they aren't supposed to play. For example, there are many somersault gates in Sonic and Shadow's levels that can't be passed by Knuckles or Tails or what have you, so being able to float through them would at least allow you to get past (sometimes there are invisible walls above the door, so climbing isn't possible. City Escape is a huge offender of this).
     
  17. Fred

    Fred

    Taking a break Oldbie
    1,563
    117
    43
    Portugal
    Sonic 3 Unlocked
    MainMemory: I think he's talking about SADX, and making it so Tails plays through an entire stage instead of just the usual racing segment.
     
  18. SpaceyBat

    SpaceyBat

    Member
    2,034
    289
    63
    United States
    Freedom Planet 2
    ^ This. Assuming you were confused about my post instead of Dark Sonic's.
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    The problem with that is that I don't know how collision works. What I could do is add a code to enable free movement (probably with an Fn key on the keyboard), but then that doesn't work for hunting characters...

    I suppose it could be possible. I'll look into it.
     
  20. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    So there's a free movement function that only works for shooting and speed characters but not hunting characters?

    Sega you were just all over the place with this game weren't you.