Project Sugar Cake v0.2 DEV Released! (BETA) [Palworld Mod]


“I can finally move to smaller updates” I said with such confidence! I wasn’t lying, I ‘could’ have moved to smaller updates but that certainly didn’t happen here! I hit all my goals for 0.2 DEV and much more with a lot of exciting discoveries and breakthroughs! Built up a massive changelog again, originally it was just going to be an update with persistence figured out and a new saving function for existing stuffs, but it was a “just one more thing” situation (even while writing this doc I was like “OH, just… just one more thing!” This isn’t the best habit). But hey, maybe this is how updates to SCake will go, large updates with a lot of new stuffs?

IMPORTANT NOTICE!
This update changed the .json format, make sure to update your animation packs or else they may fail to update! On the Discord I've already posted updated .json files for all packs if you need a quick place to grab them. ^-^ (and I think everyone that's released a pack has updated their posts with the update .json files).
 - - - - -
Some major changes made it into this update thanks to some fun discoveries. Let’s start with the first major change, the .json format has been updated and old .json files will fail to load so they need to be updated (I’ll be distributing my own updated .json files and have even updated the old ScakeBasics pak specifically for this, since I haven’t gotten the new animation back going yet). I’ve already spoken with those I know of who’ve made animation packs available so this isn’t ‘sudden’ or unexpected (I even asked for feedback on the changes! ^-^) and they should be updating their packs officially when they can.
Ok, so quickly, let’s run down the new major features list, Persistence is figured out! So now SCake creates save files in the .json format within the AnimJSON folder, which was the main feature planned for this update. Inside the AnimJSON folder of the install is a new “__Create_Load_List__.bat” file that automatically fills the _LoadList.json so you can just run this and no longer need to manually fill the list (hoping this reduces people being confused by a good amount, but probably not X.x). New custom stat tracking system is fully in-place with new methods allowing tracking of characters that are not even active in-game. New “Sexual Heat” system, heat builds up over time and makes characters aroused with affect on sexual pleasure during erotic animations, toggles between rising and falling depending on recent activities, such as having an orgasm will switch heat to begin resetting back to zero. Support for Morph Targets which integrates into the new Heat system; this requires models to support it but if a Morph Target on the mesh is called “Aroused” then SCake will automatically change that Morph Target depending on Heat and for Animation Events. Added a new animation progression mode, “Pleasure Progression Mode” allows animations to progress through stages depending on the average Sexual Pleasure of participants! I also quickly added the changing of eyes/mouths displayed on pals during Animation Events! Quite a hefty update!

Download Links!
GDrive Folder : https://drive.google.com/drive/folders/1vYfgMom7UJs2OmJ5B4FGQTMYEOR0n9Vr?usp=drive_link
Mega Folder : https://mega.nz/folder/9hZQ2IIR#Ou77tq4qQxw9UBQsozh6zg

- Project Sugar Cake -
- Full Changelog -
SCake Version 0.2.0 DEV (Beta)

Note : This updated the format and data for .json files, all animation packs must be updated to the new format (I already contacted anim-pack creators, view the new templates to see the changes and format)
Note : This update adds persistence! If the new _SCake_Save_.json files are not saving/loading properly, let me know!
Note : This update adds support for MorphTarget Models to modify 'bodies' dynamically based on the new Sexual Heat system and for animations!

Added : New "__Create_Load_List__.bat" file in AnimJSON which updates the _LoadList.json when activated (May only work on Windows, skips files starting with an underscore)
Added : API Function "SCake_AdjustAnimCamPos" which adjusts the camera postion for the player while in an animation
Added : API Function "SCake_TraceForPal" which uses the camera position and rotation to scan for pals, useful for debug code (Not always accurate so other methods are recommended for proper selections or interactions with pals)
Added : API Dispatcher "SCake_ED_EventOrgasm" and "SCake_ED_PalOrgasm" which trigger when an Animation Event / Character triggers climax/orgasm
Added : API Dispatcher "SCake_ED_PalAroused" which triggers when a character reaches enough 'Heat' to become properly aroused (Horny status ^.-)
Added : API Dispatcher "SCake_ED_TrackPalEnabled" and "SCake_ED_TrackPalDisabled" which trigger when a pal is either enabled or disabled in the new tracking system (Note : Pals do not instantly start tracking or instantly stop tracking when they become valid/invalid, do not use this for validity checks! Use 'IsValid' through UE naively instead!)
Added : Holding the camera control keys during animations now repeats, making adjustments easier
Added : Report for failed JSON load now shows the json entry that failed to load
Added : Setting "Invulnerable During Anims" which makes characters unable to be harmed during Animation Events until the end, enabled by default
Added : Automatic CharacterID conversions for compatible pals (This means animation compatibiltiy can now define the base pal CharacterID and all variables that are compatible should be detected, input CharacterIDs for variants can still be registered with default size detection)
Added : When animations are started characters will now move to the ground
Added : Register now also shows fail count similar to success counts
Added : Settings will now save into a .json file within the ~mods folder allowing them to be saved and loaded between sessions (The file name should be _SCake_SaveSystem.json)
Added : Global camera adjustment to save file so it persists between sessions (individual camera adjustments will be added in the future when persistence/cache is set up for it)
Added : Character Stats now track Sexual Encounter counts (Increases if there are more than 1 characters in an erotic animation)
Added : Character Stats now track Orgasm counts (increases every time the character has an orgasm)
Added : New dynamic pal stat tracking, all active pals should now be captured and have SCake's stats applied (Mostly just Sexual Pleasure and Heat for now)
Added : Pal SCake Stats will now save into a .json file within the ~mods folder, enabling persistence (should save as _SCake_SavePal.json, the amount of memory this system takes over long play sessions will need to be monitored, but shouldn't be too bad)
Added : Sexual Heat system, this affects the desire and sensitivity to sexual activity (slowly increases until orgasm is eventually reached or a heat reduction event occurs, then decreases rapidly to 0 then begins rising again with values over 100% increasing much slower)
Added : "Aroused" Morph Target to framework, the "Aroused" morph increases as Heat increases, and sets to 100% when in erotic animations, useful for erections or arousal based body modifiers (morphtarget names could potentially become editable in the future)
Added : Sexual Pleasure gained in erotic animations is now affected by Heat (Heat acts as a multiplier with an offset, at 0% Heat gain is at 80%, 100% = 100%, 200% = 120%, 300% = 140%)
Added : Facial expression control to Animation Player, changes expression for supported characters while animations play (Currently sets a static expression but will be configurable by animations in future versions)
Added : "Pleasure Stage Progression" SCake Setting, while enabled stages will also progress through average sexual pleasure from all participants based on duration weight
Added : "Pleasure Progression Mode" to the Animation Player and SCake Settings, when enabled stages in animations are allowed to progress when the average Sexual Pleasure reaches a threshold calculated from duration weight of each stage (defaults on, only tries to progress looping animations, Max Event Duration is still respected and will progress regardless of this setting)

Changed : The Animation UI should now show the player's display name instead of "Player"
Changed : The Animation UI should now show all players as "Player" instead of "Character" (useful in multiplayer)
Changed : The Animation UI should now attempt to find the proper in-game name to display if no nickname is set for a pal
Changed : Made major changes to the .json structure for easier creation, optimize parsing, and removing some variables that will go unused, old .json files will fail to register (Simplified the structure to run off order dependent arrays, so params still require slot specifications if they can contain multiple entries per-slot, check included templates to adjust your own .json files)
Changed : JSON parser improvements/optimizations, let me know of any weirdness or fails when it shouldn't
Changed : Limited the number of json registers per frame (will only try to load and pass 10 json sets per frame, this will slow down the register but ensures HDD users won't experience stutter when we start loading thousands of animations, register still only processes 1 animation/event per frame, this only affects sending to the register when we load the .json files)
Changed : Register automatic start time reduced to 3 seconds (was 8 before, can be changed in the _SCake_SaveSystem_.json)
Changed : Animation Events that fail to start animations will now immediately destroy themselves instead of waiting (optimization)
Changed : Overhauled stats handling backend, now runs based on game time and defaults were updated to reflect this
Changed : Pals now start with random Sexual Pleasure (No more than 20%)
Changed : Animation Player now uses the new stats tracking system to apply and track stats like pleasure, this makes effects based on Game-Time just like other stats, Sexual Pleasure defaults was adjusted for this
Changed : Adjusted some setting descriptions and displays to better align with systems and changes
Changed : "Event Duration" is now "Max Event Duration", though the behavior is effectively the same but will make more sense as more features are added

Removed : "ByName" variables when registering animations (The intended system didn't work and using CharacterID instead just makes a lot more sense)

Fixed : "Hold Down (K key) to start anim with summoned pal" now properly disables when disabling Debug Input
Fixed : Characters in animations should no longer become eligible for another animation if multiple start anim events are triggered on them
Fixed : Instances where animations took too long to process their start function and would fail to set all parameters properly
Fixed : JSON loader failing to load files from the LoadList if they had .json in the entry
Fixed : Menu scrolling offset being slightly off allowing a slow drift downward
Fixed : Report text that shows up should now properly wrap when the text extends too far
Fixed : Project Sugar Cake should no longer run any logic while in the Main Menu or outside a saved game (Only starts up the UI, though the API should be accessible)
Fixed : Characters who orgasm once will not properly have their sexual pleasure checked in subsequent orgasm checks
Fixed : Animation Player getting stuck in an orgasm loop if pleasure gain was set too high
Fixed : FootIK interupting normal animation flow when animating certain sections of certain characters (FootIK should be disabled during anims now)
Fixed : Slopes causing characters to tilt while animating, causing alignment issues (Looks a bit odd given characters will now float a bit more in some situations, but much better than alignment not working)
Fixed : Stages "Speed Mod" value should now properly affect the duration of non-looping animations
Fixed : Climaxes not adjusting duration properly if no climax variant was included with the animation
Fixed : General optimizations across most systems

Dealing with “Bones” and “Boners”

I have my monthly update coming up in a few days which will talk about data structures for games and some interesting methods I’ve been experimenting with lately, which does actually reference SCake since I used those systems in the new tracking system here. But given I have so much writing to do on that, I’ma save my typing hands a bit of effort here and just briefly touch on something the community has been hoping to solve. I’m calling it, “The Boner Problem.” This has to do with the typically male member where we usually have some curve and can move it up and down for action, but with how Palworld is currently set up there’s a couple of issues, meshes are effectively static. We can technically add additional bones, but doing so breaks compatibility and it may be too early to set up standards given we don’t know what comes next (we are constantly making new discoveries or figuring out new systems).
However, some community members (Temtem and Boko specifically) encouraged me strongly to look into Morph Targets, and after a small bit of research we got it working in-game rather quickly! For those unaware of what Morph Targets (known in Blender as Shape Keys) are, to breifly explain, it allows you to deform or modify a mesh in real time using the individual vector points of the mesh rather than using armature bones. It’s a rather old-school technique but it’s very powerful and used in a lot of games for things like body morphs or facial expressions. This allows model makers to make soft/erect versions of ‘certain aspects’ to allow a ‘neutral’ and ‘aroused’ version (my simple example would be like making a soft/hard version of the penis/nipples). This has some other creative uses as well, and for SCake I’ve set it up so the Morph Target named “Aroused” will automatically be updated through the Sexual Heat system.
But there is a catch, in the future I’ll need to make this kind of thing configurable through something like maybe another loadable .json setting since these Morph Targets are referenced directly by name within the model asset itself. This means we have to standardize naming to allow this sort of thing to work properly and we can’t always guarantee creatives will make their models with SCake in mind. There’s also the other aspect of the Boner Problem, and that is actually animating it in animations. Unfortunately adding bones isn’t a viable method for reasons I’ve explained in previous postings so instead community members are looking into some form of dynamic penis system, which would allow attaching a penis onto models instead of baking them in. This could allow quite a lot of flexibility and avoids a ton of issues but also comes with its own challenges. I’ve been considering looking into it myself but I’ve been relatively busy with other features and getting things working as expected, so I haven’t quite gotten to it. Hopefully that second half of The Boner Problem is easy to solve with a bit of thinking, we’re blazing through figuring all this out so it wouldn’t surprise me if it happens sooner rather than later!

What’s Next?

I’ve had to put multiplayer support a bit on hold since I still don’t have a proper way to test any of it, so instead I’m going to be focusing on making a couple of animations in a new Anim Pak while working on adding features that will allow animators/users to spice up animations a bit.
Current Road Map
1 ) Research sockets system for dynamic attachments and furniture support
2 ) Introduce a built-in SCake Notif-system for animations to trigger certain effects (like changing arousal meshes or changing eyes/mouth)
3 ) Work on making some animations
On Hold ) Work on multiplayer support