don't click here

Mania Mod Loader

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Sep 1, 2017.

  1. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    It probably is, but it's still an oversight. Wouldn't mind seeing that changed.

    Also one of the codes I'm using causes some strange side effects in game. In SSZ Act 2 instead of going to Metal Sonic it goes to the Title Screen. In LRZ Act 2 instead of going to Hidden Palace you go to the Continue screen. And in the Special Stages the controls are all screwed up and your model is frozen on one frame of animation (also pausing freezes the game). Anyone know which code it is? Is it the ERZ Super Sonic esq flight?
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    A month and a half later, and I've finally updated the mod loader. Updates are also available for my Random Bonus and SMPS mods.

    http://mm.reimuhakurei.net/misc/ManiaModLoader.7z
    https://github.com/MainMemory/Mania-SMPS-Mod/releases/tag/v3
    https://github.com/MainMemory/ManiaRandomBonus/releases/tag/v3
     
  3. Shade Vortex

    Shade Vortex

    The Black Vortex Member
    567
    40
    28
    USA, WA.
    Twitch Streams
    I'm having an issue where Sonic always has a fire shield. I don't have that code on.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I believe that's because one of your mods uses an older version of the "Player" static object file (Objects\Static\36D61A3DE508B500AE0ECF8D33F32943.bin), which changed formats between versions.
     
  5. Josh

    Josh

    Oldbie
    2,123
    1,087
    93
    USA
    Is there any way to manually fix this? As of yet, it seems like nobody has made a Sonic 2-style palette for the characters in the new format.
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Well, I believe everyone just uses a hex editor to edit the palettes. So I guess compare the modified and unmodified versions of the file from the old version, and find the data in the new file and make the same changes.
     
  7. Kurausukun

    Kurausukun

    Member
    15
    0
    0
    I'm using the mod loader just to replace some musics and the corresponding loop points (I'd been doing it manually until now). Everything works perfectly, except whenever I enter a Blue Spheres bonus stage, the game immediately crashes. It seems like having a modified BlueSpheresSPD.ogg causes crashing maybe? Would you know anything about this?
     
  8. Wafer

    Wafer

    Find me on Twitter instead Member
    255
    75
    28
    At a guess, I'd say that Mania uses some tracker format for Blue Spheres, since it gradually increases in speed without increasing in pitch. If that's the case, it's unlikely you could replace the music in the same way as other levels.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    No, it just has an ogg file with the tempo increases baked in. I don't know why it would crash though, I'd have to test it for myself.
     
  10. Kurausukun

    Kurausukun

    Member
    15
    0
    0
    Sadly I don't have any experience debugging .exes, but I gave it my best shot--debugging with Visual Studio gives me this: Break at 0x005A0B93 in SonicMania.exe: 0xC0000005: Access violation writing location 0x00000000. So for some reason or another it's attempting to write to 0x0, which is always a recipe for disaster. I doubt this will be helpful, but just in case, this is the instruction it crashed on:

    mov byte ptr [edi+ebx],cl

    And checking the values, both EDI and EBX are 0, but I don't really know what the instructions up to that point are doing, so I don't know what it's trying to do or why. Sorry I couldn't be of more help.
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I've managed to recreate and debug the issue on my end, and it's not caused by a bug in the mod loader, or a peculiarity of Blue Spheres, but instead, your music file is too large. As far as I can tell, the game has a set amount of memory reserved for music (indicated by the bar on the dev menu) and if that memory limit is exceeded, the allocation function returns a null pointer, which then crashes when it tries to access it. I don't know what the exact limit is.
     
  12. Kurausukun

    Kurausukun

    Member
    15
    0
    0
    Ah, okay. Thanks for the information. I suppose that's not too surprising since that music file is the longest in the game. All of the other music worked fine even though I was using OGG at ~500kbps so I assumed it was fine. I'll experiment with the size myself.


    EDIT: I'm back, after experimenting with the size myself--I'll post what I found here just in case someone else is also riding the edge on size with their music mods. The biggest file I could get before it crashed was 7.34MB large. The one I tried before that which crashed was 7.63MB. So my ballpark estimate is that you have around 7.5MB of space before the game crashes due to not having enough memory. Given the difference in size between the two, that could be 1MB or so off, of course, but I didn't test down to a certain number of bytes, I just found the highest preset for the OGG encoder that didn't crash.
     
  13. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    I didn't see a Mania hacking thread so I figured I'd just dump this here.

    http://www.youtube.com/watch?v=BPrzG0rWqbo

    Oh no.
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    For reference, the thread is here. You just had to scroll down a bit more.
     
  15. Dark Sonic

    Dark Sonic

    Member
    14,631
    1,610
    93
    Working on my art!
    Shoot, how'd I miss that? I scrolled down the page and couldn't find it, it must have blended in or something. Anyway, thanks!
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Today I realized that while I couldn't get VGMStream support working with Mania, I was able to get SMPS support working because that mod wasn't even trying to cooperate with the game's regular music system. So, I decided to totally ignore the game's music system and handle both VGMStream and OGG music manually. With that mindset, I was able to finally get it working, and as a bonus, I was able to implement tempo changes for speed shoes and Blue Spheres.

    You can now use ADX/AAX/BRSTM/etc files in your mods by simply placing the files in the Data/Music folder with the appropriate name, keeping the file's original extension (eg Data/Music/TitleScreen.adx). VGMStream-based music will ignore the game's loop points in favor of the ones in the file itself.
    You can enable music speedup when you get speed shoes by checking the box in Mania Mod Manager or by including the line SpeedShoesTempoChange=True in your mod's ini file.
    You can enable music speedup in Blue Spheres by checking the box in Mania Mod Manager or by including the line BlueSpheresTempoChange=True in your mod's ini file (although I'm not sure if this one actually works?).
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    So, I've recently been doing some updates to the mod manager, including mod update support and self-updating.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    There is now a WIP build of the mod loader for Mania Plus: https://gamebanana.com/wips/48996
     
  19. Josh

    Josh

    Oldbie
    2,123
    1,087
    93
    USA
    I tried it out, seems to be working fine! None of the character palette mods work, but that's not too surprising.

    Whenever you get to work on the codes, if it's not too difficult, would there be any way at all of disabling the jumping sound effect for the character you're NOT playing as? I'm loving Encore Mode, but it's reminding me why I never played as Sonic & Tails. ESPECIALLY when you use a flyer to get above the other character, and it's just BOING BOING BOING over and over.