Some renpy games having laggy animations.

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
I occasionally get laggy animations in renpy. Well, it's pretty common to get slightly choppy animations, but sometimes it lags a lot. From some light googling, it might have something to do with the resolution of the video. I mean, my laptop is not the greatest, but it shouldn't lag while watching prerendered videos. If I unpack the rpa and play the movie in VLC, it runs fine. Renpy must be doing something stupid with super high res videos? Maybe I'm off the mark entirely though.

Is there a solution for this? There isn't a compressed download yet, but if my suspicions are correct, that should probably fix the lag... maybe.
 
  • Like
Reactions: KayUnrated

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,035
This guy fixed choppy renpy videos by adjusting his sound card audio quality. Could be something similar giving you trouble.
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
This guy fixed choppy renpy videos by adjusting his sound card audio quality. Could be something similar giving you trouble.
Any idea how to change the audio setting or whatever that guy did? Not sure if that's the same issue, but it's worth a shot.
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
Ok, so the compressed game also lags the exact same way when it plays the animation.

What can cause video in renpy to lag and skip most of the frames?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,802
Ok, so the compressed game also lags the exact same way when it plays the animation.

What can cause video in renpy to lag and skip most of the frames?
The usual reason why a video can lag is because its too big to fit in the RAM, but I guess this don' apply to compressed videos. Therefore the only common point between both is the sound.


Any idea how to change the audio setting or whatever that guy did?
Assuming you use Windows, right click on the sound icon present on the right side of the task bar, and chose the option looking like "sound parameters".
There, scroll down to click on what looks like "sound configuration panel".
On the window that will pop up, select your sound card and click on "properties".
From there, search through the tabs ; there's possibly more than one parameter to change.
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
The usual reason why a video can lag is because its too big to fit in the RAM, but I guess this don' apply to compressed videos. Therefore the only common point between both is the sound.




Assuming you use Windows, right click on the sound icon present on the right side of the task bar, and chose the option looking like "sound parameters".
There, scroll down to click on what looks like "sound configuration panel".
On the window that will pop up, select your sound card and click on "properties".
From there, search through the tabs ; there's possibly more than one parameter to change.
I talked to the other guy. It didn't seem like the same problem. I did look into the way he fixed it but it didn't work for me. I only have 48 KHz max and his problem was that his was like 300+.

If it really is a sound issue, shouldn't the sound also lag or get choppy? The video itself doesn't even have sound. There is just a background track playing in renpy. That track doesn't have any issues when the video is lagging.

I never had sound issues before in a general way. Could it still be a sound issue?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,113
14,802
There is just a background track playing in renpy. That track doesn't have any issues when the video is lagging.
What tell absolutely nothing about your issue since they are two different data flow proceeded independently.
Plus, the code that will proceed an OGG sound, by example, isn't at all the code that will proceed a WEBM video. Even if the said video use OGG for it's sound, the code for the video would have more to do (proceed the sound, and proceed the visual) while being given the same maximal amount of time that the code for the sound have.


Could it still be a sound issue?
I didn't said that it was a sound issue, just that the size being expected to be drastically smaller for one of the videos, while their encoding is different, the sound is the sole common point ; therefore a plausible cause that should be investigated.
After, your computer can also be a potato, that would struggle to store even the compressed video in the RAM, while the hard drive is so low (or the OS making it so busy) that it can't load smoothly the next slice.
 

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,035
I never had sound issues before in a general way. Could it still be a sound issue?
It's not really "a sound issue" necessarily, but some weird incompatibility with renpy as this is a very uncommon issue which is why it is worth trying anything to see if you find the culprint.

Like you mentioned it is just a video, so even a potato system should be able to run it and as you stated you can run it without issues when playing the video directly.

Unfortunetely it's not something easy to diagnose and you will have to try everything you can until you find the culprint, for the other guy it was his audio configuration for you it might be something else.

Knowing that, here are some random things you should try to change and see if it helps:
1-Make sure your graphic drivers are updated
2-Try a different renpy renderer to see if it helps, press shift+g when you open the game change the renderer and restart the game.
3-Remove any unecessary connected device, sometimes even controllers cause weird glitches on renpy.

You will have to keep poking around your system and trying different things all around.
 
Last edited:

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
What tell absolutely nothing about your issue since they are two different data flow proceeded independently.
Plus, the code that will proceed an OGG sound, by example, isn't at all the code that will proceed a WEBM video. Even if the said video use OGG for it's sound, the code for the video would have more to do (proceed the sound, and proceed the visual) while being given the same maximal amount of time that the code for the sound have.




I didn't said that it was a sound issue, just that the size being expected to be drastically smaller for one of the videos, while their encoding is different, the sound is the sole common point ; therefore a plausible cause that should be investigated.
After, your computer can also be a potato, that would struggle to store even the compressed video in the RAM, while the hard drive is so low (or the OS making it so busy) that it can't load smoothly the next slice.
Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz 2.70 GHz
8.00 GB (7.87 GB usable)
64-bit operating system, x64-based processor

Ok, I looked at the task manager when the animation plays in the game. The memory is fine, but the CPU maxes out. Is it just a simple case of potato or some optimization issues with the game? Or some other malfunction with my hardware?

As an added note, it's not like the laptop is a 15 year old brick. Plus, how much processing power does a renpy VN need really? It's not like it's rendering anything in real time.
 

TessaXYZ

Active Member
Game Developer
Mar 24, 2020
686
1,493
Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz 2.70 GHz
8.00 GB (7.87 GB usable)
64-bit operating system, x64-based processor

Ok, I looked at the task manager when the animation plays in the game. The memory is fine, but the CPU maxes out. Is it just a simple case of potato or some optimization issues with the game? Or some other malfunction with my hardware?

As an added note, it's not like the laptop is a 15 year old brick. Plus, how much processing power does a renpy VN need really? It's not like it's rendering anything in real time.
It could also be how the video was encoded. I have a single 2-second animation in one of my scenes. Encoded one way, it was jumpy and laggy. Encoded another way, it was buttery smooth. It might just be poorly optimized from the dev's side. Have you played other games with animations? Do they lag the same way?
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
It could also be how the video was encoded. I have a single 2-second animation in one of my scenes. Encoded one way, it was jumpy and laggy. Encoded another way, it was buttery smooth. It might just be poorly optimized from the dev's side. Have you played other games with animations? Do they lag the same way?
There are occasionally laggy animations, but nothing this bad. Just slight choppyness. Most renpy games run fine.
 

TessaXYZ

Active Member
Game Developer
Mar 24, 2020
686
1,493
There are occasionally laggy animations, but nothing this bad. Just slight choppyness. Most renpy games run fine.
If you're seeing choppiness in other games, and your CPU is maxing out, I'm leaning towards saying that's the problem and not something specific to the game involved. When the games aren't running, what's your CPU usage at?
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
If you're seeing choppiness in other games, and your CPU is maxing out, I'm leaning towards saying that's the problem and not something specific to the game involved. When the games aren't running, what's your CPU usage at?
I'm playing Monster Train and have firefox open and it's under 20%. If I have nothing open, it's closer to 0 I guess. I just meant some renpy games animations lag, but not across the board and not really depending on their render quality. Like Milfy City and whatever other newer games run fine. There are some random ones that lag. So I'm guessing it's some optimization issue with certain games that my lower end hardware cannot brute force. Who knows...

What I can't understand is prerendered video playback lagging at all. What's so reaource intensive about this? I can play middling 3D games just fine.
 

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,035
What I can't understand is prerendered video playback lagging at all. What's so reaource intensive about this? I can play middling 3D games just fine.
Well this is for sure not normal behavior.

Your cpu is more than enough, so it is something else causing this issue like missing codecs, drivers, or something else that is also affecting the behavior of renpy under specific circumstances that you are yet to figure out.

Always make sure your whole system is up to date to avoid unknown issues.
 

FaceOfDisgrace

New Member
Sep 19, 2022
3
5
You never mentioned game name(s)? or animation format you have problem with and the way they used. It can be ` scene "name" `, ` renpy.movie_cutscene( "name" ) ` etc.

I had a similar problem with .webm animations in LoF final build, when Drifty decided to switch to renpy 8.+ version. No matter duration, size, fps or framerate - cpu always was overloaded, what caused tearing and freezes.
That was the first and last time I saw this kind of shit, older builds that used renpy 7.+ or any other project never caused this kind of problem.

In my case renpy seems to had some personal vendetta with .webm format using `renpy.movie_cutscene` while rpy syntax `scene` worked perfectly fine. As an lazy bastard I never bothered enough to find an actual reason behind this and just converted all animations to .mp4/MPEG4 ('cause, you know, h.264/5 is big nOnO for renpy) straight away. It did the trick, cpu usage dropped to <20% and lags were gone.

It by no means an adequate or instant solution, but it'll most likely work for you. If you go for it remember to replace all extensions in script itself and make sure that converter don't use some builtin quality compressor, like most modern seems to have by default.
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
You never mentioned game name(s)? or animation format you have problem with and the way they used. It can be ` scene "name" `, ` renpy.movie_cutscene( "name" ) ` etc.

I had a similar problem with .webm animations in LoF final build, when Drifty decided to switch to renpy 8.+ version. No matter duration, size, fps or framerate - cpu always was overloaded, what caused tearing and freezes.
That was the first and last time I saw this kind of shit, older builds that used renpy 7.+ or any other project never caused this kind of problem.

In my case renpy seems to had some personal vendetta with .webm format using `renpy.movie_cutscene` while rpy syntax `scene` worked perfectly fine. As an lazy bastard I never bothered enough to find an actual reason behind this and just converted all animations to .mp4/MPEG4 ('cause, you know, h.264/5 is big nOnO for renpy) straight away. It did the trick, cpu usage dropped to <20% and lags were gone.

It by no means an adequate or instant solution, but it'll most likely work for you. If you go for it remember to replace all extensions in script itself and make sure that converter don't use some builtin quality compressor, like most modern seems to have by default.
The dev is working on a fix, so I didn't want to give any bad press, however minor it may be. There were a couple other players who had the same issue. And yes, it was using webm.

I wonder why only a had full of people have an issue with it though. There must be some kinda rare combination of factors where the dev uses some type of encoding, and the player has some specific thing going on with their PC.

Anyways, I'm just gonna wait for the next update where hopefully it will be fixed. Too lazy to do all that converting, although I have a gut feeling that it would probably work. It seems like a work around though, and doesn't arrive at the root cause of the lag that only affects me and a few others (at least out of the people who mentioned it in game thread).
 

ChromeMantis

Formerly 'CivisAlte'
Dec 22, 2017
15
7
Ah, looking for answer on my problem and got on this thread. All same as he. Renpy, animation laggind , and only CPU overloading to 80-100%. Game "Twisted World" , type of animation - webm.
And specs that he mention, i have almost the same CPU : intel i3 7100U
 
Last edited:
  • Like
Reactions: DlcKuran

DlcKuran

New Member
Nov 23, 2022
3
3
Ah, looking for answer on my problem and got on this thread. All same as he. Renpy, animation laggind , and only CPU overloading to 80-100%. Game "Twisted World" , type of animation - webm.
And specs that he mention, i have almost the same CPU : intel i3 7100U
Man I'm having the same issue with the very same game, I'm having this problem sice v0.6 came out, v0.5 works really smoothly so I'm not sure what might be causing this problem.
 

huntsman34

New Member
Dec 8, 2019
8
1
I've had the same thing with a few games (CPU heat skyrocketing). Oddly enough this only seems to happen when selecting submenus from the main menu (I.e.- gallery type menus, about screens... preferences seem to be fine thus far).

I have a brand new i9-13900ks, 64GB DDR5, M2 pci-e4 disks and an RTX 4090.... a renpy game should not cause any issues!

I've noticed that the process uses 1-2 cores of the CPU exclusively and maxes those almost immediately and the GPU rockets up in load too.
CPU temp goes from 35 to 80 almost immediately, the 13900 chips are famed for running hot under very heavy load, but this is not heavy load.

It's almost as if the refresh rate on the process itself becomes completely unrestricted and goes as fast as the system can do... however I have tried limiting the refresh rate both on the application and globally, with no effect.
 
Last edited:

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,035
I've noticed that the process uses 1-2 cores of the CPU exclusively and maxes those almost immediately and the GPU rockets up in load too.
CPU temp goes from 35 to 80 almost immediately, the 13900 chips are famed for running hot under very heavy load, but this is not heavy load.
This sounds like a bitcoin miner activating once you open the game, you could have some malwares on your system.
 
  • Like
Reactions: huntsman34