Sonic and Sega Retro Message Board: SA2/SADX Mod Loader - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 14 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

SA2/SADX Mod Loader I am the best at names

#1 User is offline MainMemory 

Posted 03 August 2013 - 09:29 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
SA2 Mod Loader
SADX Mod Loader


After seven days of work (mostly on the mods) the first version of SA2 Mod Loader is done. It's rather similar to SonicGMI/CPKREDIR, except while those are designed to replace data files, the SA2 Mod Loader is designed to inject custom C++ code into the game. It does this by replacing Data_DLL.dll with a custom DLL, requiring no modification to the sonic2app.exe file. In fact, it should work even with the original encrypted exe from Steam.

Download SA2 Mod Loader. The archive should be extracted to your SA2 install folder.

In the root folder you'll find SA2ModManager.exe (and some additional files for debugging and stuff). When you run it, it looks something like this:
Posted Image
This allows you to enable and disable mods, change the order they're loaded in, install or uninstall the loader dll, and play the game. You can also enable a console window, which will print the build version and date, the list of mods loaded, any mods that failed to load, and anything a mod writes to stdout, for example with printf or cout.
You may replace SA2's Launcher.exe with this if you have no need to configure SA2 (you should probably back it up though).

The archive also contains a folder named "mods", which is where mods will go, each in their own folder with a "mod.ini" file and at least one DLL. It also contains SA2ModLoader.dll which is copied to SA2's Data_DLL.dll when you install. If I update the loader you can replace this copy of the dll and the manager will detect the change and ask if you want to copy it over the currently installed version.

Finally there's a "programming" folder, which contains the header files that define the mod API, several important variables, functions, structures and enums in SA2, and a couple convenience functions and macros. You will also find a copy of the Character Randomizer mod's source code as an example.

There are currently three mods, all made by me:

This post has been edited by MainMemory: 09 August 2013 - 11:41 AM

#2 User is offline Josh 

Posted 03 August 2013 - 09:43 PM

  • TGC Warrior
  • Posts: 1228
  • Joined: 22-January 08
  • Gender:Male
  • Location:USA
  • Wiki edits:1
Woah, awesome work dude! I'll give it a try the next time I play SA2. We really need a dedicated database for SA2 and SG mods...
This post has been edited by Josh: 03 August 2013 - 09:44 PM

#3 User is offline MainMemory 

Posted 04 August 2013 - 09:26 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Update:
  • Mods can now specify overrides for data exported from Data_DLL.dll in the ModInfo structure via a list of structures containing the string name of the export to override, and the data to replace it with.
  • File redirection is now possible. Any time SA2 reads from the resource\gd_PC folder, all mod folders will be searched for a matching file in a gd_PC subfolder. For example, if SA2 loads resource\gd_PC\PRS\missiontex_am.pak, and your mod contains a file mods\modfolder\gd_PC\PRS\missiontex_am.pak, it will load the file from your mod's folder instead of SA2's folder.
  • There is now an option to reactivate SA2's removed debug printing function, allowing you to see its messages in the console.


#4 User is offline Caverns 4 

Posted 05 August 2013 - 03:01 PM

  • Posts: 321
  • Joined: 07-December 12
  • Gender:Male
  • Project:Sanik Quest: Journey To The Right
I noticed a little bit of what might be an issue.

I tried using it, and it seems to work perfectly, and then I went to the Chao Garden using the chao key after playing as Tails instead of Eggman.

Posted Image

Weeeelp.
This post has been edited by Caverns 4: 05 August 2013 - 03:01 PM

#5 User is offline MainMemory 

Posted 06 August 2013 - 11:10 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
So I've converted the main functions of the SA2 mod loader for SADX, and I'm releasing it now, without any mods and hardly anything in the .h file because it has some unique features:
  • Fixes the window size to match the selected resolution.
  • Disables the CD check.
  • Allows you to enter a custom resolution (be warned, many nonstandard resolutions cause SADX to abruptly exit).


Download SADX Mod Loader.

You should note that, like everything else I do for SADXPC, this only works with the 2004 US version.

Edit: And I should inform you, that the SADX mod loader's file redirection function does not work for music or videos, as those are handled by Windows Media Player, which I have tried and failed to override. This has been fixed.

Edit 2: I forgot to mention, it also makes SADX check the depth buffer settings in order from highest to lowest, rather than lowest to highest like it normally does.
This post has been edited by MainMemory: 19 August 2013 - 09:56 AM

#6 User is offline Strife 

Posted 07 August 2013 - 03:37 PM

  • Posts: 1715
  • Joined: 19-October 11
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet 2
So, the mod loader should fix the quirk with SADX where the window stretches beyond the specified resolution? If so, then it's not working for me. I've tried different versions of the .exe as well.
I'd definitely like to try and get it working, since on my widescreen monitor the game is horizontally stretched to a rather ugly degree unless I switch to fullscreen.

#7 User is offline MainMemory 

Posted 07 August 2013 - 06:17 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
You're sure you clicked the "Install loader" button?
This post has been edited by MainMemory: 07 August 2013 - 06:18 PM

#8 User is offline Strife 

Posted 08 August 2013 - 04:38 AM

  • Posts: 1715
  • Joined: 19-October 11
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet 2
Nope. To be specific, I set the resolution to be 640x480. While it matches the width, the height of the window ends up being just a few measley pixels, so I can't see anything. I can tell the game is running fine though since I can make out the fading transitions.
This post has been edited by Strife: 08 August 2013 - 04:38 AM

#9 User is offline MainMemory 

Posted 08 August 2013 - 09:29 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
It definitely shouldn't be doing that. Are you using a US EXE, such as the one on my website?

#10 User is offline Strife 

Posted 08 August 2013 - 10:04 AM

  • Posts: 1715
  • Joined: 19-October 11
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet 2
Yeah, that's the one I'm trying to use. My OS is Windows XP with Service Pack 3, and everything I can conceivably update has been updated for a while.

#11 User is offline MainMemory 

Posted 08 August 2013 - 10:40 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I made a minor update, try downloading it again.

#12 User is offline Strife 

Posted 08 August 2013 - 11:53 AM

  • Posts: 1715
  • Joined: 19-October 11
  • Gender:Male
  • Location:United States
  • Project:Freedom Planet 2
Works perfectly now. Thanks!

#13 User is offline MainMemory 

Posted 09 August 2013 - 11:45 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I have now made the first loader compatible SADX mod. It's a remake of an older mod, which allowed me to test some things with model exporting and replacement.

#14 User is offline MainMemory 

Posted 13 August 2013 - 09:11 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Update for the SADX mod loader which allows mods to overwrite read-only data, and a new mod which required such functionality:
A Metal Sonic mod. It replaces Sonic with Metal Sonic everywhere but in cutscenes and the Perfect Chaos fight (that'll come later). It also includes his missing voice clips from the GC version in case you don't have them, and it imports his physics data from Sonic Adventure 2 Battle.


#15 User is offline MainMemory 

Posted 19 August 2013 - 05:20 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3722
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Apparently SADX isn't the only one with music issues, for some reason SA2 uses the full path for music, video and voice files. The loader has been updated to accommodate this, and also makes the read-only data writable.

  • 14 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users