opl- / beatsaber-http-status

Live game status over web sockets.
MIT License
105 stars 36 forks source link

Endless Mode Plugin And This Plugin #28

Open Gamic opened 4 years ago

Gamic commented 4 years ago

Currently, Endless Mode (https://github.com/MatrikMoon/EndlessMode) and this plugin don't quite work together to produce a satisfying result. When playing a song in Endless Mode, and it switches to a new song, the result is that the name of the song and some other details are not changed (or, they don't appear to be). This leads to incorrect details being displayed in overlays in OBS (and other apps). This appears to be because the endless mode plugin is not triggering a new scene change event, and is instead clearing out the old map data and inserting the new map data.

I have tried hooking into the event that the Endless mode plugin provides, but as it is not actually switching scenes there are (ofcourse) some notable problems. I found that note blocks become uninteractable using this approach after the song switched. Clearly, I caused this issue, and can revert the changes (and install both plugins again).

If possible, we may need to have some agreed way to pull from the game that the song has changed that can work for both projects. Not entirely sure where the best place for that is at the moment. Just noting this down here so that either someone else can think about it, or so that I can come back to this later.

opl- commented 4 years ago

The way Endless Mode does what it does is... Hacky. I can see it being incompatible with more than just this mod, as essentially any mod that wants to perform actions when the song ends will miss that event for all but the last song. This might for example cause issues with a mod accumulating some state (ex. missed note count) over several songs unless it also hooks into Endless Mode.

Ideally instead of replacing all of the game's state and hoping it won't cause any issues it should instead detect the end of the song as handled by the game and hijacking the transition from the game scene to the menu at the appropriate stage, immediately transferring back to the next song after one is finished using the same mechanisms that the game uses. The experience might not be as smooth for the user (with perhaps a slightly longer delay?), but certainly more compatible with other plugins and less prone to game updates and errors.

So, all that being said, personally I believe that this incompatibility should be fixed by the Endless Mode plugin, not HTTP Status. Tagging @MatrikMoon for their input on this.

MatrikMoon commented 4 years ago

Haihai! Moon here, can definitely agree that the way I did this was hacky :stuck_out_tongue_closed_eyes:

The thing started out, as all my projects do, as just a personal proof of concept to become more familiar with note spawn and audio loading for another plugin idea. This is why I didn't take the easy route of "hijacking" a scene switch. Eventually, though, someone saw it and asked why it wasn't on the mod installer, so that brings us to the mess that is EndlessMode today.

I agree that, if it is to remain on BeatMods, it should definitely be more compatible with other mods. After thinking about it, I think I like the idea of changing it to work with a scene switch as @opl- suggested, but for my own sake leave an option in the settings to use the legacy mode, if the user doesn't want to be bothered with the fade-to-black-and-reload every time a song ends.

My problem now is that I do not have time to do this; between TournamentAssistant and my personal life, all my time is currently occupied. I will put this on my long, long, list of things to do though, and in the meantime I'd be thrilled to accept PR's to EndlessMode which do the above.

Sorry for the inconvenience, guys.