IllusionMods / AnimationLoader

GNU General Public License v3.0
25 stars 4 forks source link

KKS port #20

Closed IDontHaveIdea closed 2 years ago

IDontHaveIdea commented 2 years ago

Koikatsu Sunshine port of AnimationLoader (no Studio for now):

The plugin has some behavior differences from KK.

  1. The animations are available gradually they depend of the girls experience. The native code handles the selection of how and which buttons to show. In sonyu is less apparent because the majority of the animations have the same donor (2 [Doggy]) which is available from the start. I'm working on this to make them available gradually so the integration is more like KKS works.

  2. There is no grid UI if it's needed it I can be work on it. Again native code manage the buttons UI.

  3. Text scrolling is managed by native code.

  4. Studio is not showing the animations. This part of the code is untouched but I cannot load any kind of animations even on freshly reinstalled version with no mods. Is this really working on KKS? I'll seek help in discord. I disabled the loading of the plugin in Studio since it considerably increases load time and the animations still won't work.

  5. The manifest is game dependent now. KKS has more options to work with so it will be limited if only one manifest is use for both KK and KKS.

Until I get some input on Studio will continue working on different donor combinations and position adjustment. Some animations primarily some desk ones start in the middle of the desk so de characters have to be moved to a new position. The position I can try and correct programmatically. The problem animations are commented out of the current manifest until I do more testing of the position correction. All adjustment will be based on Chikarin as standard.

I will be posting pre-release versions so the animations can be tested with the positions adjustments and all. So any issues found can be work on as soon as possible. The number of plugins I use are on the low side problems with plugins interactions may not show up.

I tagged this a draft bacause of Studio not showing the animations. The AnimationLoader logs show that they load.

The plugin for KKS and the mods are available here:

https://github.com/IDontHaveIdea/AnimationLoader/releases/tag/preview

Please comment on the code refactoring. Changes:

PS. As of late I program mainly in python and "The Python Way" is very granular short code files representing logical units. Complex code: one or more subfolders containing small code files representing logical units etc, ... With time you tend to think that this way is better for debugging.

IDontHaveIdea commented 2 years ago

The one for the animation bundles ([katarsys] KPlug Animation Bundles 2.8.2.zipmod ~650+ MB) is the same for both the one that is different is the one with the mainfest.xml ([katarsys][KKS] KPlug Animations v1.2.3.zipmod ~4 kb)with the configuration for the animators. The animation bundles even work with the current manifest file [katarsys] KPlug Animations v1.2.1.zip as it is a superset of the previous version. Changing the format I think it won't be that difficult to merge the configuration into one manifest.xml if it really needs to be that way. The current format makes KK limit KKS I improved some animations using configuration only possible in KKS. That is the reason of the manifest been game specific. If you prefer the manifest to be one file for both will have to wait a little while until I get the KK game I don't have it and the one that got me into this and does the testing on KK is moving and changing jobs. He bought KKS for me so I could not use that as an excuse to say no.

In the code I see TODO: MotionIKData. I started to look into that but haven't found something like a guide to work on this.

Right now working on some animations that can be improved moving the characters.

IDontHaveIdea commented 2 years ago

UPDATE: The new format is optional. The animator decides to continue using the format without signaling in which game should be used.

Manifest.xml format:

I will use the animation with studio ID 28

Description of the donor in KK template.xml

id, mode, nameAnimation, posture, numCtrl, kinfHoushi, houshiLoopActionS
39, houshi, Standing BJ (One Hand), 2, 1, 1, 5

Description of the donor in KKS template.xml

Entries 53 to 65 are new on Koikatsu Sunshine

id, mode, nameAnimation, posture, numCtrl, kinfHoushi, houshiLoopActionS, isFemaleInitiative, lstCategory, paramFemale.fileSiruPaste
39, houshi, Stand 1H Blowjob (立ち片手フェラ), 2, 1, 1, 5, False," { 0, 1, 6, 7, 8 }", siru_t_khh_39
.
.
.
42, houshi, Stand No Hands BJ (立ちノーハンドフェラ), 2, 1, 1, 5, False," { 0, 1, 6, 7, 8 }", siru_t_khh_42
.
.
.
55, houshi, Sitting Footjob (椅子足コキ), 1, 0, 0, 6, False," { 2, 3, 4, 5 }", siru_t_khh_55

The animation configuration in the manifest.xml for KK is this:

<Animation>
    <StudioId>28</StudioId>
    <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
    <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
    <ControllerFemale>khh_f_87</ControllerFemale>
    <ControllerMale>khh_m_87</ControllerMale>
    <AnimationName>Standing Deepthroat</AnimationName>
    <Mode>houshi</Mode>
    <kindHoushi>Mouth</kindHoushi>
    <categories>
        <category>Stand</category>
        <category>LieDown</category>
    </categories>
    <DonorPoseId>39</DonorPoseId>
</Animation>

For KKS I propose this:

<Animation>
    <StudioId>28</StudioId>
    <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
    <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
    <ControllerFemale>khh_f_87</ControllerFemale>
    <ControllerMale>khh_m_87</ControllerMale>
    <AnimationName>Standing Deepthroat</AnimationName>
    <Mode>houshi</Mode>
    <kindHoushi>Mouth</kindHoushi>
    <categories>
        <category>Stand</category>
        <category>LieDown</category>
    </categories>
    <DonorPoseId>42</DonorPoseId>
    <NeckDonorId>55</NeckDonorId> <!--This does not exist for KK -->
</Animation>

There are more possibilities to provide a better animation in KKS than KK. As can be seen even the names of the corresponding animations are not the same. This is why I made the mod that have the manifest.xml with the configuration for the animations game specific in that I have more donors id's in KKS that would not work for the KK configuration. For KK the animation would not load with a warning of no donor found with the KKS configuration.

The file with the animation asset bundles

is the same for both games. The file even works with [katarsys] KPlug Animations v1.2.1.zip because is a superset of [katarsys] KPlug Animation Bundles 2.6.0.zip.

I don't see why not to use the new resources provided by KKS.

If only one file

[katarsys] KPlug Animations v1.2.3.zipmod

is preferred the change in the format I suggest is put the version for each game in the same file using node keys for each

<AnimationLoader>

    <Koikatu>
    <!-- 2.5 houshi -->
            .
            .
            .
        <Animation>
            <StudioId>28</StudioId>
            <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
            <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
            <ControllerFemale>khh_f_87</ControllerFemale>
            <ControllerMale>khh_m_87</ControllerMale>
            <AnimationName>Standing Deepthroat</AnimationName>
            <Mode>houshi</Mode>
            <kindHoushi>Mouth</kindHoushi>
            <categories>
                <category>Stand</category>
                <category>LieDown</category>
            </categories>
            <DonorPoseId>39</DonorPoseId>
        </Animation>
            .
            .
            .
    </Koikatu>

    <KoikatsuSunshine>
    <!-- 2.5 houshi -->
            .
            .
            .
        <Animation>
            <StudioId>28</StudioId>
            <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
            <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
            <ControllerFemale>khh_f_87</ControllerFemale>
            <ControllerMale>khh_m_87</ControllerMale>
            <AnimationName>Standing Deepthroat</AnimationName>
            <Mode>houshi</Mode>
            <kindHoushi>Mouth</kindHoushi>
            <categories>
                <category>Stand</category>
                <category>LieDown</category>
            </categories>
            <DonorPoseId>39</DonorPoseId>
        </Animation>
            .
            .
            .
    </KoikatsuSunshine>

<AnimationLoader>

The plugin would read the corresponding node for each game and the configuration would be in one file. There is nothing really new at this stage.

What would be new is that some animations can look better if the character are repositioned. For example this animation:

<Animation>
    <StudioId>15</StudioId>
    <PathFemale>anim_imports/kplug/female/01_53.unity3d</PathFemale>
    <PathMale>anim_imports/kplug/male/01_53.unity3d</PathMale>
    <ControllerFemale>khh_f_74</ControllerFemale>
    <ControllerMale>khh_m_74</ControllerMale>
    <AnimationName>Desk Buttjob</AnimationName>
    <Mode>houshi</Mode>
    <kindHoushi>Hand</kindHoushi>
    <categories>
        <category>SchoolDesk</category>
        <category>Desk</category>
    </categories>
    <DonorPoseId>0</DonorPoseId>
    <FileSiruPaste>KKSButt</FileSiruPaste>
</Animation>

In KKS this animation stars with the characters right in the middle of the desk/table. The characters need to be repositioned and that I can do with code and the information of what to do have to be saved somewhere. If the node can be extended with this information new animations that need to move the characters can be done by anybody with the instructions of how to make the plugin do the movement. The ones that need repositioning now are on the same plane and both characters need to move so a floating point number that represent a factor in the direction of movement can be use to do it.

But there can be left/right up/down so a tuple representing the x, y, z axis (x, y, z) each a float sign number. Lastly may one character needs to move so one tuple for each.

(left/right, up/down, forward/backwards)

<Move>
    <Heroine>(x, y, z)</Heroine>
    <Player>(x, y, z)</Player>
</move>

To fix this animation the configuration will look like this:

<Move>
    <Heroine>(0.0,  0.0,  -1.0)</Heroine>
    <Player>(0.0, 0.0,  -1.0)</Player>
</move>

This is backwards compatible because no movement no entry. Is additional information used when needed only. To get the (x, y, z) values there is the plugin that I have been using to learn c# and KKS modding. Simple H character movement or KKS_HCharaAdjustmentX (KKS_HCharaAdjustment knock-off) that uses buttons to move the characters individually using discrete steps and when you move forward/backwards the characters stay aligned. The interface is really a proof of concept still I will take this in consideration to make it easier to get the the (x, y, z) factors.

Tech:

The (x, y, z) are applied by multiplying the normalized (magnitude 1.0) vectors ChaControl.transform.forward z and ChaControl.transform.right x. For y up/down the factor is added y(axis) + y, y starts at 0.0.

I hope with this I explained my self better.

Keelhauled commented 2 years ago

I just wanted to say you dont need to ask us for any permission to make any commits. If this even is you asking. If you just wanna make some notes don't mind me.

GeBo1 commented 2 years ago

What about doing something like this? It would stay backward compatible with existing animations and just need manifest updates for new features.

<Animation>
    <StudioId>28</StudioId>
    <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
    <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
    <ControllerFemale>khh_f_87</ControllerFemale>
    <ControllerMale>khh_m_87</ControllerMale>
    <AnimationName>Standing Deepthroat</AnimationName>
    <Mode>houshi</Mode>
    <kindHoushi>Mouth</kindHoushi>
    <categories>
        <category>Stand</category>
        <category>LieDown</category>
    </categories>
    <DonorPoseId>39</DonorPoseId>
    <GameSpecificOverrides>
        <!-- anything in here overrides/replaces equivalent entries  -->
        <KoikatsuSunshine>
            <DonorPoseId>42</DonorPoseId>
            <NeckDonorId>55</NeckDonorId> 
        </KoikatsuSunshine>
    </GameSpecificOverrides>
</Animation>
IDontHaveIdea commented 2 years ago

I was setting on something like this and is optional the animators can continue to use the current format. I changed the game logic only.

<AnimationLoader>

    <Animation>
        <!--Read both games current configuraton-->
        <StudioId>27</StudioId>
        <PathFemale>anim_imports/kplug/female/01_64.unity3d</PathFemale>
        <PathMale>anim_imports/kplug/male/01_64.unity3d</PathMale>
        <ControllerFemale>khh_f_86</ControllerFemale>
        <ControllerMale>khh_m_86</ControllerMale>
        <AnimationName>Pitjob</AnimationName>
        <Mode>houshi</Mode>
        <kindHoushi>Hand</kindHoushi>
        <categories>
            <category>Stand</category>
            <category>LieDown</category>
        </categories>
        <DonorPoseId>0</DonorPoseId>
        <NeckDonorId>12</NeckDonorId>
    </Animation>

    <Kokiatu>
        <!--Red only by Koikatu-->
        <Animation>
            <StudioId>28</StudioId>
            <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
            <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
            <ControllerFemale>khh_f_87</ControllerFemale>
            <ControllerMale>khh_m_87</ControllerMale>
            <AnimationName>Standing Deepthroat</AnimationName>
            <Mode>houshi</Mode>
            <kindHoushi>Mouth</kindHoushi>
            <categories>
                <category>Stand</category>
                <category>LieDown</category>
            </categories>
            <DonorPoseId>39</DonorPoseId>
        </Animation>
    </Kokiatu>

    <KokiatsuSunshine>
        <!--Red only by Koikatsu Sunshine-->
        <Animation>
            <StudioId>28</StudioId>
            <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
            <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
            <ControllerFemale>khh_f_87</ControllerFemale>
            <ControllerMale>khh_m_87</ControllerMale>
            <AnimationName>Standing Deepthroat</AnimationName>
            <Mode>houshi</Mode>
            <kindHoushi>Mouth</kindHoushi>
            <categories>
                <category>Stand</category>
                <category>LieDown</category>
            </categories>
            <DonorPoseId>42</DonorPoseId>
            <NeckDonorId>55</NeckDonorId>
        </Animation>
    </KokiatsuSunshine>

    <Kokiatu>
        <!--Koikatu exclusive-->
        <Animation>
            <StudioId>29</StudioId>
            <PathFemale>anim_imports/kplug/female/01_66.unity3d</PathFemale>
            <PathMale>anim_imports/kplug/male/01_66.unity3d</PathMale>
            <ControllerFemale>khh_f_88</ControllerFemale>
            <ControllerMale>khh_m_88</ControllerMale>
            <AnimationName>Ball Massage</AnimationName>
            <Mode>houshi</Mode>
            <kindHoushi>Hand</kindHoushi>
            <categories>
                <category>Stand</category>
                <category>LieDown</category>
            </categories>
            <DonorPoseId>33</DonorPoseId>
            <NeckDonorId>12</NeckDonorId>
            <FileSiruPaste>TitsPussy</FileSiruPaste>
        </Animation>
    <Kokiatu>

<AnimationLoader>

For the plugin standpoint this is easier but for the user your suggestion I think is easier to follow. Also you can do this which easily solves the issue I'm having of the naming that is different for the games.

<Animation>
    <StudioId>28</StudioId>
    <PathFemale>anim_imports/kplug/female/01_65.unity3d</PathFemale>
    <PathMale>anim_imports/kplug/male/01_65.unity3d</PathMale>
    <ControllerFemale>khh_f_87</ControllerFemale>
    <ControllerMale>khh_m_87</ControllerMale>
    <AnimationName>Standing Deepthroat</AnimationName>
    <Mode>houshi</Mode>
    <kindHoushi>Mouth</kindHoushi>
    <categories>
        <category>Stand</category>
        <category>LieDown</category>
    </categories>
    <DonorPoseId>39</DonorPoseId>
    <GameSpecificOverrides>
        <!-- anything in here overrides/replaces equivalent entries  -->
        <KoikatsuSunshine>
            <AnimationName>Stand Deepthroat</AnimationName> <!--This name is for Koikatsu Sunshiine-->
            <DonorPoseId>42</DonorPoseId>
            <NeckDonorId>55</NeckDonorId> 
        </KoikatsuSunshine>
    </GameSpecificOverrides>
</Animation>

I will incorporate this in the Animation logic.

:thumbsup:

IDontHaveIdea commented 2 years ago

Closing since I started working on a branch in the repo.