Rogue-Like Update 4/11/2019 (any programmers in the house?) (Patreon)
Content
Hey, this one's going to be all technical stuff, a call to arms to hopefully sort out a technical issue in the game, so if you aren't into that, sorry, there will be more later. :D It's also a little "NSFM."
Basically I'd like some help sorting out an issue with some of Laura's animations (no April Fools this time), and it's a computer sciency issue, so while "I might be able to figure it out myself, it'd mostly be a lot of trial and error and waste time I could be building other things, so if anyone who knows more than I do about this stuff can just realize the solution right away, that'd be great. :D
The issue is that in her BJ poses, when I load each of her animations for the first time in a given session, they load just fine, but when they are loaded again (by the player switching back to a previously viewed speed), all the various components of the animation flip out and end up all over the screen for a second before re-assembling.
My hypothesis is that this is a memory loading issue, that these are fairly large image files, and that what is happening is that while the animations continue to function in the background, the data inside them is removed from memory, and then when they're called up again, they are re-loaded into memory, but not so fast that you don't notice, and it takes a while for their proper locations to reassert themselves.
I do know that with the way I structure character images, if an animation ever starts, it continues to run on some level until the game is rebooted, so for example if an animation "starts at the bottom and goes up, then down, and repeats," then that will happen the first time it is shown to the player, but the next time it could start at any point in the animation, because it's just been running in the background the entire time. If an animation does not repeat, then it won't replay each time it becomes visible, it will only play the first time and never again until they reboot. It would be handy to have a way to bypass this, as it would make it easier to show "one time use" animations, so any suggestions there could be nice.
Ideally I'm looking for solutions that would not increase the overhead to the point that it would become unplayable on devices that can currently handle it. At minimum I'm hoping for an ugly patch that could just make these current animations load smoothly every time, but if anyone can figure out a way to force all these animations to reboot cleanly every time the game displays them, that would open up a lot more options. Ask any questions and I'll answer them best I can.
There's plenty of official Renpy documentation, here are a few that might be helpful:
https://www.renpy.org/doc/html/screen_optimization.html
https://www.renpy.org/doc/html/displaying_images.html
https://www.renpy.org/doc/html/atl.html
Edit: I've tried a few things, renpy.force_full_redraw() and renpy.free_memory() don't seem to fix anything, and actually freeing memory seems to make the issue worse, causing the animation to pause in the broken state for an extra couple frames before "getting right." One half-assed solution I've come up with is just using a "fade to black" every time the speed changes, which hides the glitch, but is inelligent.
It should also help to know the basic structures of the animations being used. The core image, the one that is "displayed" is a Live Composite, and then the sub-images that are called as part of a condition switch are just standard images full of "contains." Simplified example below:
image Laura_BJ_Animation:
contains:
ConditionSwitch(
"Speed == 1", "Laura_BJ_Body_1",#Licking
"True","Laura_BJ_Body_0",#Static
)
zoom 1.35
anchor (.5,.5)
pos (600,605)
image Laura_BJ_Body_0:
contains:
#Hair underlay
"Laura_Sprite_BJ_HairBack"
zoom 0.81
anchor (0.5, 0.5)
pos (490,400) #(535,340) #top
rotate 0 #-30
parallel:
ease 1.1 ypos 405 #bottom
pause 0.2
ease 1.1 ypos 400 #top
pause 0.2
repeat
contains:
#base body
"Laura_Sprite"
subpixel True
pos (650,800)#(673,740) #top
zoom 2.2 #.75
anchor (0.5, 0.5)
rotate -20
parallel:
pause 0.1
ease 1.1 ypos 810 #bottom
pause 0.2
ease 1.1 ypos 800 #top
pause 0.1
repeat
contains:
#base head under cock
subpixel True
"Laura_Sprite_BJ_Head"
zoom 0.81
anchor (0.5, 0.5)
pos (490,400) #(535,340) #top
rotate 0 #-30
parallel:
ease 1.1 ypos 405 #bottom
pause 0.2
ease 1.1 ypos 400 #top
pause 0.2
repeat
contains:
#zero's cock
AlphaMask("Blowcock", "Laura_BlowCock_Mask")
subpixel True
pos (412,292) #tilted/top #(640,198)
zoom 0.4
alpha 1
rotate 10
parallel:
pause 0.1
ease .15 rotate -5 #bottom
pause 0.4
ease 1.95 rotate 10 #top
repeat
parallel:
pause 0.1
ease .15 pos (405,255) #bottom(637,168)
pause 0.4
ease 1.95 pos (420,292) #top 412
repeat
#End BJ animation Speed 0