Sonic and Sega Retro Message Board: S&KC Mod Loader - Sonic and Sega Retro Message Board

Jump to content

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

S&KC Mod Loader Now with integrated music playback!

#1 User is offline MainMemory 

Posted 28 April 2015 - 12:19 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Someone on SSRG posted a request for help with getting a level they had converted into Sonic & Knuckles Collection, but there was no easy way to do it, so I sought to rectify that.

The S&KC Mod Loader has all the same basic features as the SADX/SA2 Mod Loaders, it can load DLL files containing custom code, it can load data from an INI file, and it has cheat code support. The one thing it doesn't have is file replacement, due to all the game's data other than music and sfx being in the EXE.

Download

To create a mod, create a folder within the "mods" folder of your S&KC install, and add a file named "mod.ini" within that folder containing the following lines:
Name=Mod Name
Description=Mod Description
Author=Your Name


Additionally you can add a DLLFile line pointing to a DLL file to load, and an EXEData line pointing to an INI file listing data to be replaced in the EXE.

The S&KC disassembly has been updated to include more split data files, all the levels in SonLVL's INI, and an example INI file for the mod loader's EXEData setting.

Note that I have only done minimal testing with unedited AIZ1 files.
This post has been edited by MainMemory: 04 March 2018 - 12:04 AM

#2 User is offline PsychoSk8r 

Posted 28 April 2015 - 04:54 PM

  • HighKnights
  • Posts: 2580
  • Joined: 11-July 07
  • Gender:Male
  • Location:Walsall, UK
  • Project:30 Day Project: Revisited.A New Release!
  • Wiki edits:19
Could this potentially make possible in future a mod to display from high colour graphics rather than limited pallete (if developed)? perhaps even higher resolution tilesets?

#3 User is offline MainMemory 

Posted 28 April 2015 - 06:52 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Anything's possible.

But it would require a lot more research than has been done so far, and a lot of recoding things.

#4 User is offline MainMemory 

Posted 03 March 2018 - 07:21 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I've finally made an update for this thing. Now it has self-update support, mod update support, save file redirection, and a custom music playback engine with support for MIDI, SMPS (Megadrive), VGMStream (ADX, BRSTM, etc), and other music file formats. There is a configuration tool for the music player included in the "Music" folder. Mods can also include their own Music folder to override the base settings, allowing for easier switching of music.

The music player will default to using the SMPS music from the original Megadrive version of the games. There is a mod included that switches to the MIDI music from the PC release. Unfortunately (or fortunately, depending on how you feel about it), the MIDI playback method used by the mod loader requires the use of a soundfont file, so the MIDI music will not sound exactly the same as it normally would. The selected soundfont can be changed in the music configuration tool.

If you had the old SMPS Player or HQ Music mods, you should remove them, as this has the functionality of both, and is incompatible with those mods. Additionally, if you've injected custom MIDI data into the game's MIDIOUT.DLL, you will have to export them to MIDI files and use the mod loader's music configuration to play them, as it ignores the original MIDIOUT.DLL entirely.

I've also made a Mania Music mod as an example of the new system.

#5 User is offline Blue Spikeball 

Posted 05 March 2018 - 01:11 AM

  • Posts: 352
  • Joined: 29-October 16
  • Gender:Male

View PostMainMemory, on 03 March 2018 - 07:21 PM, said:

I've finally made an update for this thing. Now it has self-update support, mod update support, save file redirection, and a custom music playback engine with support for MIDI, SMPS (Megadrive), VGMStream (ADX, BRSTM, etc), and other music file formats. There is a configuration tool for the music player included in the "Music" folder. Mods can also include their own Music folder to override the base settings, allowing for easier switching of music.

The music player will default to using the SMPS music from the original Megadrive version of the games. There is a mod included that switches to the MIDI music from the PC release. Unfortunately (or fortunately, depending on how you feel about it), the MIDI playback method used by the mod loader requires the use of a soundfont file, so the MIDI music will not sound exactly the same as it normally would. The selected soundfont can be changed in the music configuration tool.

If you had the old SMPS Player or HQ Music mods, you should remove them, as this has the functionality of both, and is incompatible with those mods. Additionally, if you've injected custom MIDI data into the game's MIDIOUT.DLL, you will have to export them to MIDI files and use the mod loader's music configuration to play them, as it ignores the original MIDIOUT.DLL entirely.

I've also made a Mania Music mod as an example of the new system.

I decided to give the new feature a shot, but I can't seem to get the game to use custom tracks :v:
I open the music config tool, assign an mp3 on my hard drive to AIZ on both All and S3&K by clicking the "File..." button, and it still plays the SMPS AIZ1 theme. Checking the Music.ini file confirms that the track was properly added to the ini file. I even tried using one of the music tracks from your Mania music mod and nothing.

If I click "List..." and, say, assign the HCZ1 theme to AIZ1, it gets properly replaced with SMPS HCZ1.

What am I doing wrong?
This post has been edited by Blue Spikeball: 05 March 2018 - 01:20 AM

#6 User is offline MainMemory 

Posted 05 March 2018 - 01:16 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Sounds like it's failing to read the sound file. I should probably have it display that in the log. Either you're using an unsupported format, or I screwed something up.

#7 User is offline Blue Spikeball 

Posted 05 March 2018 - 01:44 AM

  • Posts: 352
  • Joined: 29-October 16
  • Gender:Male
It couldn't be an unsupported format, I tried the music files from your Mania Music mod.

#8 User is offline MainMemory 

Posted 05 March 2018 - 01:49 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Oh, wait. You used files from outside the Music folder, didn't you. The mod loader just dumbly adds the relative path to the folder in question to each file, so if you have a full path, it ends up becoming invalid.

#9 User is offline Blue Spikeball 

Posted 05 March 2018 - 02:00 AM

  • Posts: 352
  • Joined: 29-October 16
  • Gender:Male
Oh, that was it! Now it works as a charm, thank you :)

Nice to see that your mod manager is compatible with Korama's patches, the S&KC HD Audio patch conflicted with them. Any plans for adding FLAC support and/or MD sound effects?

Edit: Bug report - I've noticed that the speed shoes slow down the music if you're using the SMPS audio, but work properly with custom tracks.
This post has been edited by Blue Spikeball: 05 March 2018 - 02:16 AM

#10 User is offline MainMemory 

Posted 05 March 2018 - 09:31 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
FLAC, sure I guess. MD sound effects would require ValleyBell to add support for them to SMPSPlay, and would require me to figure out how I can replace the game's sound effect playback.

#11 User is offline Blue Spikeball 

Posted 06 March 2018 - 11:31 PM

  • Posts: 352
  • Joined: 29-October 16
  • Gender:Male
Thanks for adding FLAC support.

As for the SFX. Well, I suppose SMPS isn't a requirement; I would be happy with just being able to replace the sound effects with custom audio files, that way it would be possible to replicate the MD SFX by using rips. But I'll understand if you're not planning to look into the matter any time soon, since this mod loader is probably not a priority for you compared with the ones for the other games. I'll just say that I appreciate the community fixing Sega's shoddy ports one step at a time.

Edit: The newest version of the mod loader is missing the music config tool. Also, FLAC playback isn't working for me for some reason, even though I put the track in the Music folder and properly edited the .ini file.
This post has been edited by Blue Spikeball: 06 March 2018 - 11:52 PM

#12 User is offline MainMemory 

Posted 07 March 2018 - 01:14 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
This is why it's important to at least test that your code builds before you ship it. Not only was it missing the music config tool, it was missing the mod loader and mod manager too. Now that the mod loader is actually in the update, if FLAC support doesn't work, I have no explanation, I'm pretty sure I'm loading the plugin properly.

As for sound effects, I would be totally up for implementing SMPS if the opportunity became available. As for using better recordings, that's entirely possible now. SKCsnd can be used to import sound effects at any chosen quality level, and if you want to make the game play them, a small C++ or cheat code mod could easily do it. It's just a matter of someone taking the time to organize and rip all the sound effects.

#13 User is offline Blue Spikeball 

Posted 07 March 2018 - 09:31 AM

  • Posts: 352
  • Joined: 29-October 16
  • Gender:Male
Oh, it's working now. A minor thing, though: You forgot to add the .flac extension to the open dialog in the music config tool.

A glitch I found: If I have a custom track set to Invincibility or Super Sonic, place 4 or more Super monitors with debug mode, break them to go Hyper and get 200+ rings, then grab a ring (thus gaining a life), the 1up jingle starts playing endlessly. It doesn't occur with 100 rings, or if I had previously gained a life, or if I'm using the SMPS invincibility tune.
If I attempt to replicate the glitch with the Mania Music mod, the 1up jingle plays only once as expected, but then the bgm stops playing.

Another minor one is that the mod loader breaks the menu sound test: it cannot play SMPS music, and custom tracks play but the Stop button doesn't work. Not a huge deal though, and the level select sound test still works.

Oh, I thought using the SKCsnd method restricted you to a lower sound quality than the original MD version?
This post has been edited by Blue Spikeball: 07 March 2018 - 09:42 AM

#14 User is offline MainMemory 

Posted 07 March 2018 - 10:09 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4166
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
By default, it does. But there are options to change the quality.

I've attempted to fix the 1up issue. As for the sound test, I can't imagine why it doesn't work properly, but perhaps I can replace it with my own eventually.

Also, I've released a mod that makes the game's palette more accurate to the MD version: https://gamebanana.com/gamefiles/6489

Edit: oops I made the 1up handling worse on accident.
This post has been edited by MainMemory: 07 March 2018 - 02:55 PM

#15 User is offline Blue Spikeball 

Posted 08 March 2018 - 06:59 PM

  • Posts: 352
  • Joined: 29-October 16
  • Gender:Male
Are you talking about the hex edit hack to the executable to tweak the bgm sample rate?

The 1up jingle and sound test issues seem to be fixed now, good job :thumbsup:

Nice, I didn't realize S&KC had slightly darker colors. It's subtle, but it looks better with the mod.
While we're on the subject of possible fixes to the port, there are the tiles of the Rolling Jump background, which seem to be incorrectly flipped or something, as they give it a saw-like look:
Posted Image
Perhaps you would like to look into that?
This post has been edited by Blue Spikeball: 08 March 2018 - 07:12 PM

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

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