Hey Everybody
I've encountered this weird Micro Stuttering issue in my project, which I can't seem to fix.
I'm using this code in my project, which makes it so I can click on invisible Buttons in the background, which takes me to a label:
Code: Select all
screen room2():
add "background" #This is a 20 frame animation background
imagebutton:
mouse "mouse2
xpos 1585
ypos 270
idle "invisible_button.png" # empty PNG File (SIze:1140x450)
hover "invisible_button.png"
activate_sound "audio/sound3.wav"
action [With(dissolve), Jump("label_1")]
label label_1:
character1 "blablablablablablabla"
call screen room2
The thing is, after I was testing stuff, I realised that after you pressed the button a couple times and jumping between the screen and the label, some weird Micro stuttering would occur. Before, the game would run at a smooth 60 FPS with 17,000 MS, but after a couple of Button presses, the reaction time would spike up to 27,000 MS frequently, which was noticeable due to the animated background. I suspected the animated background to cause some memory issues, so I've tried renpy.free_memory(), which unfortunately did not do anything. The image cache behaviour also wasn't unusual. I've also tested, if it is related to runtime, rather than button presses, but the micro stuttering would occur only after a certain amount of button presses. The problem is, that this stuttering carries on during the rest of the game, otherwise It would've been not that big of a problem. Of course, one could ask, why I would want to press that button rpeatedly anyways, but I'm planning on implementing several imegabuttons in that screen, so that the player can interact with many things in the background, which means that repeated button presses are bound to happen.
I've tried so many other things regarding image cache and image loading - none of it fixed the stuttering, so I feel like it has nothing to do with that, but I'm not super experienced with coding in general.
I'm hoping somebody could help me here
Thank you in advance