IllusionMods / KKManager

Mod, plugin and card manager for games by Illusion that use BepInEx
https://www.patreon.com/posts/41869238
GNU General Public License v3.0
454 stars 70 forks source link

Add Studio Scene support #94

Open bytemask opened 2 years ago

bytemask commented 2 years ago

It would be nice to manage StudioNEO / RoomStudio / CharaStudio scenes within KKManager! If it's not too difficult to do, we should try to add support for them within KK Manager and handle dependencies for each just as we do for character cards.

ManlyMarco commented 2 years ago

It's definitely something that can be added. Scenes will need separate parsers, some changes to the piping, and UI tweaks. The question is if scenes and cards should be treated the same way, or if they should have separate viewer windows.

ManlyMarco commented 7 months ago

Biggest holdup is scenes having a very different file format, with the tag specifying which studio it's for being either near file end or before the extended data if it's saved with an old version of BepisPlugins (only relevant for KK).

If anyone wants to give it a try, card loading code is in https://github.com/IllusionMods/KKManager/tree/master/src/KKManager.Core/Data/Cards

paul0728 commented 5 days ago

May I ask @ManlyMarco for advice on how to read scene data to check if it contains timeline information or required mods? If you could point me to the exact part of the code, that would be even better. I’m planning to write an independent program similar to KKManager but focused on managing scene data. I tried parsing PNG files, but I couldn't obtain any useful information or extract metadata.

ManlyMarco commented 4 days ago

See https://github.com/IllusionMods/BepisPlugins/blob/1036c8b04f68937b0f3f77d0451f801642100135/src/Core_ExtensibleSaveFormat_Studio/Core.ExtendedSave.Hooks.cs#L169

paul0728 commented 4 days ago

See https://github.com/IllusionMods/BepisPlugins/blob/1036c8b04f68937b0f3f77d0451f801642100135/src/Core_ExtensibleSaveFormat_Studio/Core.ExtendedSave.Hooks.cs#L169

I’d like to ask if the reason KKManager hasn’t incorporated this feature is due to some implementation challenges? Since it seems that scene data already has a way to be read.

ManlyMarco commented 3 days ago

It's because reading scene data has a high overhead compared to cards and requires a bunch of extra game-specific code. Basically a lot of work for a very rarely used feature.

paul0728 commented 3 days ago

It's because reading scene data has a high overhead compared to cards and requires a bunch of extra game-specific code. Basically a lot of work for a very rarely used feature.

OK, I see.

paul0728 commented 3 days ago

In addition, I would like to ask about the exact meaning of "MissingPluginMaybe." Does it imply that having this plugin can make the card more complete and better presented, rather than being a mandatory component? What is the logic behind its detection? (Since adding scene data would also require the same detection logic.)

ManlyMarco commented 3 days ago

It checks extended data keys and assumes it's the same as plugin GUID, which is not always the case hence why "maybe".

paul0728 commented 3 days ago

It checks extended data keys and assumes it's the same as plugin GUID, which is not always the case hence why "maybe".

So, does it mean that the keys in the extended data do not correspond to any GUID in the user's plugin? If so, how is this different from a missing plugin?

paul0728 commented 3 days ago

high overhead

If I successfully integrate the functionality to read scene data into KKManager, would you be willing to allow it to be merged? Even though it might cause higher reading overhead.

ManlyMarco commented 3 days ago

Some plugins use different GUID for extended data than for the plugin itself, e.g. the sideloader, so they can not be correlated without writing a lookup by hand or other means.

Yes I would merge it, just keep in mind scenes from different games all have slightly different formats so make sure to test them, you can find scenes from some games on db.bepis.moe and various boorus.

paul0728 commented 3 days ago

Some plugins use different GUID for extended data than for the plugin itself, e.g. the sideloader, so they can not be correlated without writing a lookup by hand or other means.

Yes I would merge it, just keep in mind scenes from different games all have slightly different formats so make sure to test them, you can find scenes from some games on db.bepis.moe and various boorus.

Sorry, I didn’t quite understand. So, do you mean that searching for image data using the plugin name doesn’t yield relevant information because it uses a different name from its GUID? This website can identify plugins from images and is open source. I think its method could be a good reference.

paul0728 commented 3 days ago

Some plugins use different GUID for extended data than for the plugin itself, e.g. the sideloader, so they can not be correlated without writing a lookup by hand or other means.

Yes I would merge it, just keep in mind scenes from different games all have slightly different formats so make sure to test them, you can find scenes from some games on db.bepis.moe and various boorus.

I think trying to handle multiple scenes at once might be a bit too ambitious. At least, let's focus on completing the charastudio scene part first.