Mania Mod Loader

Discussion in 'Utilities' started by MainMemory, Sep 1, 2017.

  1. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Note: Currently the mod loader only works with the September 6th version of the game. For instructions on how to downgrade, go here.

    You can download it here. It works basically the same way as the SADX Mod Loader and SA2 Mod Loader, except this one only does file replacements right now.

    To make a mod, simply create a folder containing a "mod.ini" file like so:
    Code:
    Name=Mod Name Here
    Author=Your Name Here
    Description=Describe mod here.
    Version=v11.q (optional)
    Then, create a "Data" folder in that folder, and place whichever files you want your mod to replace in their relative paths within that folder (ie Data\Sprites\Players\Sonic.bin).

    To use mods, extract it into the folder Sonic Mania is in, run ManiaModManager.exe, click the "Install Loader" button on the bottom, then check the mods you want to enable and hit "Save" or "Save and Play".

    The source code is available on Sonic Retro's GitHub.
     
    Last edited: Oct 5, 2017
    Kissa and Bluestreak like this.
  2. Bluestreak

    Bluestreak Lady in red, living in dread. Member

    Joined:
    Apr 1, 2016
    Messages:
    227
    Location:
    Eastwatch Island
    Will this also deal with the DRM issue in the PC version too? The Denuvo DRM in Sonic Mania is known for its high I/O output and can actually screw up your SDD in your computer I found out. I really don't wanna get the game until a workaround is made. I may just buy the game and only use the pirated version tbh.
     
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It has no interaction with the DRM whatsoever.
     
  4. Bluestreak

    Bluestreak Lady in red, living in dread. Member

    Joined:
    Apr 1, 2016
    Messages:
    227
    Location:
    Eastwatch Island
    Okay. Just wondering.
     
  5. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    I have an SSD and I have experianced no issues so far... from what I have read/watched the DRM killing SSD's is a bit of old wives tale.
     
    Bluestreak likes this.
  6. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    New version of the mod loader, now it supports custom code by loading DLL files. To create a DLL, you'll need the files from the mod loader's include folder, and a C++ file that looks something like this:
    Code:
    #include "ManiaModLoader.h"
    
    extern "C"
    {
       __declspec(dllexport) void Init(const char *path)
       {
           // code to run on init goes here
       }
    
       __declspec(dllexport) ModInfo ManiaModInfo = { ModLoaderVer, GameVer };
    }
    You can also export lists of byte patches, jumps, calls, and pointers to be applied to the game, but I find it's generally simpler to just do that from Init.

    I don't currently have an example mod, but the system is basically identical to SADX mods, so maybe look at those, idk.

    Unfortunately, as Mania is very likely going to be updated in the future, the mod loader and all custom code mods will have to be rebuilt to account for the shifted addresses. I currently have a mechanism in place so the mod loader should detect if the game has been updated and refuse to do anything, and the GameVer setting will be able to detect mods built for other versions of the game as well, since I'll increment it every time I have to update the mod loader for a new version of the game.
     
  7. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    do you have any example mods as i am having trouble figuring this out
     
  8. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I do not. What exactly is giving you trouble?
     
  9. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    just setting it up - I made a mod.ini as a test and it dosnt display in the modloader.
     
  10. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It's in mods\ModNameHere\mod.ini?
     
  11. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Now the mod loader supports cheat codes, OnFrame hooks for mods, and options to start Mania with the console enabled, or at a specific scene. Cheat codes use the same format as the other mod loaders, so you can look at the Codes.xml files from the others for examples, or this document that lists all the code types. It comes with a few basic codes to start with, I may add more in the future, and contributions are certainly welcome.
     
  12. Dark Lips

    Dark Lips Well-Known Member Member

    Joined:
    Nov 14, 2008
    Messages:
    293
    Location:
    Wolverhampton UK
    got it working - thank you MainMemory :) this is awesome... also is there any chance you could add the ability modifer stuff into the cheat codes part of the modloader? That would rock!!!
     
  13. Bluestreak

    Bluestreak Lady in red, living in dread. Member

    Joined:
    Apr 1, 2016
    Messages:
    227
    Location:
    Eastwatch Island
    Weird question: Do you think you may do a Mod Loader for Sonic CD sometime?
     
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    Dark Lips: I will try to add as much as I can.

    Bluestreak: While I suppose it's possible, I have basically no interest in modding that game.
     
    Bluestreak likes this.
  15. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    I've updated the mod loader to be compatible with the newest version of the game. I will also be updating the cheat code list as soon as codenamegamma releases the updated cheat table, so look for that soon-ish. Unless they update the game again.
     
  16. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    New update with more cheat codes taken from codenamegamma's cheat table, because he rushed out a new version even though I told him I was fine with waiting.
    Includes: disable super music, enable insta-shield and drop dash, enable super peel-out for all characters, force character selection for both players, mid-jump ability swapping, making super forms fly, always have shield abilities.

    Also, avoid using the dash move while flying with the ERZ moveset, it crashes the game. I'll see if I can fix it later.
     
  17. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    New version of the mod loader with even more codes:
    • Infinite Flight (Tails)
    • Infinite Insta-Shield Usage
    • Infinite Flame Shield Usage
    • Infinite Lightning Shield Usage
    • Instant Drop Dash
    • Don't Lose Rings While Super
    • Keep Super Forever*
      *Doesn't work between acts/zones, as the game totally resets the player's status.
    • Disable Super Transformation Prompt
    • Never Drown
    • Keep Flame Shield Underwater
    • Keep Lightning Shield Underwater
    • Bubble Shield Won't Save You From Drowning
    • Instantly Drown
    • Ignore Damage
    • Die in One Hit
    • AI Player Dies When Hit
    Also includes a fix for the Insta-Shield + Drop Dash code.
    Also I fixed the mod manager's title.
     
  18. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    It's that time again: new cheat codes!

    • Super Sonic Uses Sonic's Sprites
    • Disable HUD
    • Special Stage: Grass Has No Effect
    • Special Stage: Start At Mach 3
    • Special Stage: Don't Lose Rings With Time
    • Bonus Stage: Only Need One Sphere
    • Bonus Stage: Always Get Gold Medal
    • Bonus Stage: Never Speed Up
    • Bonus Stage: Remove Speed Cap
    • Bonus Stage: Speed Up Twice As Quickly
    • Bonus Stage: Start At Max Speed
    • Bonus Stage: Start At Double Max Speed
     
  19. DigitalDuck

    DigitalDuck Active Member Member

    Joined:
    Apr 27, 2017
    Messages:
    38
    Location:
    Lincs, UK
  20. Royameadow

    Royameadow Welcome to the modern existence. Member

    Joined:
    Feb 21, 2012
    Messages:
    249
    Location:
    Lynn MA, North America
    So, "Sonic Jam Mode" for Blue Sphere stages can finally be a thing, this did not take too long at all; that'll be a breather for many, I honestly loved how it was handled in that version.
    As for the removal of the Blue Sphere stages' Speed Cap, this truly makes me feel bad that there isn't an SMPS~esque driver for Retro Engine titles at the current moment, if only because this would then become more of a physical reality without having to do extensive audio editing to a Vorbis file:

    ~ Theme of Blue Sphere, except it keeps getting faster every thirty seconds (MainMemory):