Some renpy games having laggy animations.

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,114
14,802
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!
There were an issue prior to the 7.5.2/8.0.2 when the game used a clearly abusive number of variables, but it was something really exceptional. My Variable Viewer multiply by 3 the number of variables used, and I really rarely has an overloaded CPU with my i6 at 3.7GHz. What mean that you shouldn't feel it with your own CPU.

I agree with Meaning Less, it feel like there's something else at works when this happen to you, and with such load a coin miner seem effectively to be the culprit.
 
  • Like
Reactions: huntsman34

huntsman34

New Member
Dec 8, 2019
8
1
This sounds like a bitcoin miner activating once you open the game, you could have some malwares on your system.
It's a fair point, but I've done full scans with both MalwareBytes (including rootkit scan), Norton, Hitman Pro, ADWCleaner, ESET and Acronis.
Full DISM and SFC scans show no issues.
No CPU, GPU or network spiking when system idle... the spikes also stop when closing the game in question (after having gone to the particular submenu in question).

Also, this doesn't happen when opening and running the game. It ONLY happens with a select few games and only then when using certain Main Menu submenus (I.e.- My Best Deal -> Gallery or -> About)... so very strange.

Also, the network traffic (I have a hardwire firewall which tracks all inbound and outbound traffic and logs it) does not climb when this happens.

Might just set up a VM and run these through that with strict limits
 
Last edited:

huntsman34

New Member
Dec 8, 2019
8
1
There were an issue prior to the 7.5.2/8.0.2 when the game used a clearly abusive number of variables, but it was something really exceptional. My Variable Viewer multiply by 3 the number of variables used, and I really rarely has an overloaded CPU with my i6 at 3.7GHz. What mean that you shouldn't feel it with your own CPU.

I agree with Meaning Less, it feel like there's something else at works when this happen to you, and with such load a coin miner seem effectively to be the culprit.
Adding second reply because I don't know how to tag you to give you an alert:

It's a fair point, but I've done full scans with both MalwareBytes (including rootkit scan), Norton, Hitman Pro, ADWCleaner, ESET and Acronis.
Full DISM and SFC scans show no issues.
No CPU, GPU or network spiking when system idle... the spikes also stop when closing the game in question (after having gone to the particular submenu in question).

Also, this doesn't happen when opening and running the game. It ONLY happens with a select few games and only then when using certain Main Menu submenus (I.e.- My Best Deal -> Gallery or -> About)... so very strange.

Also, the network traffic (I have a hardwire firewall which tracks all inbound and outbound traffic and logs it) does not climb when this happens.

Might just set up a VM and run these through that with strict limits
 

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,035
Also, this doesn't happen when opening and running the game. It ONLY happens with a select few games and only then when using certain Main Menu submenus (I.e.- My Best Deal -> Gallery or -> About)... so very strange.
Ok so I downloaded that game to check if the game was to blame but couldn't replicate this issue, my gpu/cpu stayed around 10~20%.

This tells me that this is some specific issue on your end, could be a malware but could also be a bad installation of drivers or similar.
Try reinstalling your video drivers if you are sure that you have no malware running.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,114
14,802
Also, this doesn't happen when opening and running the game. It ONLY happens with a select few games and only then when using certain Main Menu submenus (I.e.- My Best Deal -> Gallery or -> About)... so very strange.
Hmm... I tried with the last version and my own playthrough, and my i6 only have a 5% raise when I open the Gallery, passing from ~25% load to ~30%. But most of the load is due to what it's doing outside of the game, so it stay the same than Meaning Less values.

I also took a look at the code for the gallery, and while it's clearly not the best thing I've seen, there's absolutely no reason for it to induce a CPU load raise. I've seen screens more complex than this, that made Ren'Py on its knee, yet without overloading the CPU.

Since it's not a coin miner, I don't really see what it can be. There's many images to display, and the screen is refreshed often. But even there it don't make real sense. There's 8 mandatory image buttons, plus 24 conditioned ones. They are bigger, but I've made Ren'Py display up to 200 images buttons without it having a real impact on the CPU load.
Perhaps a problem with the video/GPU driver, like Meaning Less said, but even there I found this strange.


By the way, to ping someone, you type @ directly followed by it's pseudonym. The forum will show you options while you type, and it works even when there's spaces in the said pseudonym.
 
  • Like
Reactions: huntsman34

Eeagle

Member
Jul 28, 2017
115
139
I have a same problem, even posted here once about it. didnt help or shared a light on a problem.

NSFW(Game) - some scenes are going smooth, the other using almost 80% of CPU, lagging as hell.
Drivers are up-to-date(did that check the time i posted with this problem).No viruses, games that actually need cpu and gpu a lot - running great.
Even other renpy games are running smooth, but for some reason - a few will lag like this.
Renderer change doesnt do much.
I dont think renpy games are known for their sys.rec.
And seeing that more than a few people have this issue - that has to be on renpy end.

People wrote, that renpy games using different versions of the renpy, maybe problem in that.
I hope we can solve this problem.
 

BRaider2020

Member
Apr 25, 2020
418
266
I don't think it's a RAM issue, I have 16 GB of RAM and the cutscenes in the current version of the Waifu academy game were a little slow all of a sudden. Okay, slow isn't the right word, it's more like parts of the scene in the video suddenly hiccuped lol

I am still exploring all ideas you ppl posted here. I hope one of them works :fingerscross:
 
Last edited:

BRaider2020

Member
Apr 25, 2020
418
266
Code:
https://lemmasoft.renai.us/forums/viewtopic.php?t=33050
I found this, I don't know if what they speak in there could help solving the lagging problem on the renpy games, but I decided to post it anyway, some developer might think this is useful.
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
I don't think it's a RAM issue, I have 16 GB of RAM and the cutscenes in the current version of the Waifu academy game were a little slow all of a sudden. Okay, slow isn't the right word, it's more like parts of the scene in the video suddenly hiccuped lol

I am still exploring all ideas you ppl posted here. I hope one of them works :fingerscross:
I just gave up on it. It's probably a combination of shitty engine for video playback and a weaker machine.

Not sure about your issue, but what I'm experiencing is directly tied to the resolution of the video. Renpy apparently has a hard time playing high res videos (like 2400 x whatever or higher) which could probably be overcome with a stronger machine, which is why not everyone has this problem maybe.

I played the lagging videos on VLC and it runs fine, but not in renpy. Also, I used a converter to lower the resolution to like 1600 x 900 or something and the lag was gone even in renpy.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,114
14,802
I played the lagging videos on VLC and it runs fine, but not in renpy. Also, I used a converter to lower the resolution to like 1600 x 900 or something and the lag was gone even in renpy.
Hmm, you said your computer is 15yo, so I guess that 1600x900 is your screen resolution, or smaller than it. Coupled with the post that Jamdan pointed to, I suppose that the issue is due to a triple factor (too big resolution for the video, too high frame rate, and too old CPU).

Ren'Py have to resize each frame, for it to fit the screen. So, the more there's frame per second, the more it have to do it, and with a too old CPU, it need a bit more times than the fraction of second that should be allowed to the frame.
Then, the trick that Jamdan pointed permit to solve the issue since the CPU's MMX instruction set permit to proceed all this a bit faster. While closing most software running in the background free CPU time that can be allocated to Ren'Py for it to have a bit more time to proceed the frames.

Let's say that you have three software running together. Globally speaking Ren'Py have just a forth of second available, the rest being used by the two other software and the OS. So, if the video is at 60FPS, this mean that Ren'Py have 1/240th of second to proceed each frame. And in your case, there's too much too proceed to fit in such small time.
It's not an issue for VLC, that is both fully wrote with a compiled language and optimized for its task. But Ren'Py is partly wrote in Python, and initially designed for VN, therefore less optimized.
In the same time, like it's a question of available CPU time, more than CPU power, it don't lead to an abnormal CPU load ; the CPU is powerful enough to do what is asked, but not to do it in the time it have for this.
 

BRaider2020

Member
Apr 25, 2020
418
266
hmmm I see what you ppl mean

my screen max resolution 1920x1080. Then one solution would be using the renpy game compressed versions instead of the original ones.

Even so, this is kinda weird, I never had this problem until I tried last version of Waifu Academy (to be honest, in my case, this is the only game where the issue exists). Which makes me believe that something was changed in its code because this issue didn't exist in previous versions (or maybe the issue is so simple as they increased their resolution higher then my screen supports).

One more thing, its rare for me to use compressed versions too, I only use them if the size is really big, like above 10GB or so, with means most renpy games I try here, probably use higher resolution then what my screen supports but this issue never happened with those other game.
 
Last edited:

jokuur

Active Member
May 23, 2019
781
883
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 also thought about this having something to do with dual processors pcs having problems with viewing the scenes, but it just could be like other people say and just need to be better set up or different extensions of animation or resolution... how about C++ or directX couid that be related? im not a coder or h4xxor by any means but i did had problems with games before connected to graphics when certain windows update was installed or c++ and directX needed to be older versions for them to run
 

FinderX

Member
Jan 15, 2018
102
73
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.
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.
I have a same problem, even posted here once about it. didnt help or shared a light on a problem.

NSFW(Game) - some scenes are going smooth, the other using almost 80% of CPU, lagging as hell.
Drivers are up-to-date(did that check the time i posted with this problem).No viruses, games that actually need cpu and gpu a lot - running great.
Even other renpy games are running smooth, but for some reason - a few will lag like this.
Renderer change doesnt do much.
I dont think renpy games are known for their sys.rec.
And seeing that more than a few people have this issue - that has to be on renpy end.

People wrote, that renpy games using different versions of the renpy, maybe problem in that.
I hope we can solve this problem.
Hi, try this workaround.
Download the latest renpy SDK from github and run this command (i use linux but you can adapt if you use windows):

/path/to/renpy-8.1.3.X/renpy.sh /path/to/game-with-problems

I had resolved my video performance this way, maybe this can help you out.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,114
14,802
Download the latest renpy SDK from github and run this command (i use linux but you can adapt if you use windows):

/path/to/renpy-8.1.3.X/renpy.sh /path/to/game-with-problems
This is not, and I mean really not an advice to give.

Firstly, despite its high backward compatibility, there's still some small issues when using a newer 7.x version on top of a 6.99.x or 7.x version, depending on the original version used by the game.
Secondly, the version 8.x of Ren'Py use a radically different version of Python than the 6.x and 7.x version, what can totally break the game itself.

You are lucky that so far it worked every time for you, but there's between 25% and 35% of the games that would be broken due to this.
 

desmosome

Forum Fanatic
Sep 5, 2018
5,999
13,864
Hmm, you said your computer is 15yo, so I guess that 1600x900 is your screen resolution, or smaller than it. Coupled with the post that Jamdan pointed to, I suppose that the issue is due to a triple factor (too big resolution for the video, too high frame rate, and too old CPU).

Ren'Py have to resize each frame, for it to fit the screen. So, the more there's frame per second, the more it have to do it, and with a too old CPU, it need a bit more times than the fraction of second that should be allowed to the frame.
Then, the trick that Jamdan pointed permit to solve the issue since the CPU's MMX instruction set permit to proceed all this a bit faster. While closing most software running in the background free CPU time that can be allocated to Ren'Py for it to have a bit more time to proceed the frames.

Let's say that you have three software running together. Globally speaking Ren'Py have just a forth of second available, the rest being used by the two other software and the OS. So, if the video is at 60FPS, this mean that Ren'Py have 1/240th of second to proceed each frame. And in your case, there's too much too proceed to fit in such small time.
It's not an issue for VLC, that is both fully wrote with a compiled language and optimized for its task. But Ren'Py is partly wrote in Python, and initially designed for VN, therefore less optimized.
In the same time, like it's a question of available CPU time, more than CPU power, it don't lead to an abnormal CPU load ; the CPU is powerful enough to do what is asked, but not to do it in the time it have for this.
I think this makes sense to me. I don't know where I said my laptop is 15 years old, but it's not top of the line or anything. My screen resolution is 1929x1080. The animations that lag are ones larger than that, so you might be right about renpy having a seizure while resizing each frame or something. I dunno.