The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

!![REP/REP+]Music Mod Callback
cybershadow95  [developer] 9 Mar, 2023 @ 9:53pm
Antibirth+++ and All Antibirth Jingles compatibility
-
Last edited by cybershadow95; 10 Mar, 2023 @ 10:20am
< >
Showing 1-7 of 7 comments
cybershadow95  [developer] 10 Mar, 2023 @ 10:19am 
The issue didn't seem obvious after a few minutes of testing. Specifically which tracks are not playing the intro?
It could be that your mods are out-of-date (I've found Steam workshop's update detection to be spotty), so check that as well.
Blizz 10 Apr, 2023 @ 1:35pm 
Hi, I'm using the same mod combination and I noticed there's a significant delay before the floor tracks actually start playing, as opposed to before I installed MMC. I don't think it skips the song intros, but it definitely feels very off.

Also, MMC appears to overwrite the secret room found jingle from the Antibirth Music++ mod, using the default Rebirth jingle instead.


Edit: I was looking at other reports here and I can confirm I'm also experiencing the issue with the Void music resetting. I'll try to explain how the standalone Antibirth Music++ mod handles the Void music, maybe it'll help with debugging.

Whenever the game switches tracks on the floor (entering a boos room, secret room, etc.) and you return to the actual floor where the Void music is supposed to be playing, Antibirth Music++ picks a random "starting point" for the song by using multiple files. This appears to mess with MMC, since MMC thinks switching rooms counts as the song switching, so it picks a random file from the Void tracks whenever you switch between ANY room.
Last edited by Blizz; 10 Apr, 2023 @ 1:51pm
cybershadow95  [developer] 11 Apr, 2023 @ 9:01am 
Thank you for the reply. In the coming weeks, I will set aside some time to try to make these mods compatible. I think it will be possible, but I can't say with total certainty.
cybershadow95  [developer] 20 Apr, 2023 @ 9:56pm 
Alright, I've been working on this for a bit. It's important to understand that the Music Mod Callback was never intended to be used with Antibirth++, and that Music Mod Callback functions as a base mod to be built upon, which is why the mod's name has two exclamation points to make sure it is defined early in the mod order. When Music Mod Callback conflicts with another mod, the most efficient solution is to add code to the other mod to make it MMC-compatible, rather than build a hacky solution within MMC that only addresses one particular mod. I'll be addressing each of the three problems discussed above in separate replies.
Last edited by cybershadow95; 20 Apr, 2023 @ 10:26pm
cybershadow95  [developer] 20 Apr, 2023 @ 10:00pm 
The Void music restart issue is solved by adding this code to the end of main.lua in the Antibirth++ mod directory:

if MMC then MMC.AddMusicCallback(antibirthmusicplusplus, function() if Game():GetLevel():GetStage() == LevelStage.STAGE7 then return 0 end end, Music.MUSIC_VOID) end

For anyone who wants this problem fixed, kindly request that the authors for either Antibirth++ or Antibirth+++ add this to the end of the main.lua file. Because the MMC is defined before Antibirth++ in the mod load order, MMC cannot detect the presence of Antibirth++ and behave differently when Antibirth++ is on. (Note that for Antibirth+++, the mod variable abm3p must be used instead of antibirthmusicplusplus)
Last edited by cybershadow95; 20 Apr, 2023 @ 10:04pm
cybershadow95  [developer] 20 Apr, 2023 @ 10:13pm 
The MMC replaces the Antibirth jingles with the Rebirth versions because of the way MMC had to be coded. The affected jingles are Secret Room, Treasure Room, and Strange Door (note that the two start jingles are NOT included). In the unmodded game, the jingles are played as sound effects without interrupting the music, but this is done on the back end in a way that is not clear. The solution we use in MMC is to add new .wav files for the jingles and play them as sound effects. This means that the .ogg files for the jingles are not used at all when MMC is on.

To solve this issue, either play with the All Antibirth Item Room Jingles mod by kittenchilly, or convince the authors of Antibirth++/Antibirth+++ to make their sound effects compatible with MMC. The second option wouldn't be difficult to accomplish codewise, but isn't simple to explain, and since using the All Antibirth Item Room Jingles mod seems to be the main reason to use MMC and Antibirth++ concurrently, I'm not sure it's worth the effort. If someone still wants me to spell out the steps to achieve sound effect compatibility with MMC, I will do it for them.
Last edited by cybershadow95; 20 Apr, 2023 @ 10:37pm
cybershadow95  [developer] 20 Apr, 2023 @ 10:25pm 
Regarding the delay in playing stage music after the start jingle, this is something I feared would happen when I coded the logic for starting the stage music on game start. The start jingle is played as a music track, and there isn't a way to determine when the actual music has ended. MusicManager():GetCurrentMusicID() will be the start jingle ID until other music is played; that is, when the jingle ends, the current music ID doesn't change to zero. So we had to determine a way to time the length of the jingle.

We ended up measuring time in number of MC_POST_RENDER callbacks. This works wonderfully on my computers, but through experimentation, I discovered that the number of MC_POST_RENDER callbacks per second is not entirely consistent! So either machine speed, or perhaps the amount of code being run every render, affects the length of time between the end of the start jingle and the start of the stage music playing.

I'm curious, for anyone reading this who has issues with a long delay in between the start jingle and stage music, are you playing with dozens of large mods turned on? If so, this would be evidence that the amount of code run per render will lower the number of MC_POST_RENDER callbacks per second.

In any case, when I get another chance, I might look into another method of keeping track of time in Lua that doesn't rely on the rate of MC_POST_RENDER callbacks.
Last edited by cybershadow95; 20 Apr, 2023 @ 10:26pm
< >
Showing 1-7 of 7 comments
Per page: 1530 50