Ren'Py 100% CPU usage while playing videos in some games

CheerMaster

Newbie
Dec 27, 2018
31
257
Hello fellas, how you doing?

So, as per the title says, whenever some games I've downloaded start playing a video, my CPU usage skyrockets to 100% and stuttering/lagging ensues, and thus leading to a less than optimal experience.
Last time this happened to me, the videos themselves were in 4k, and they weighed very little, none of them bigger than 7MB, most of them half that size, and in this case in .OGV format.
I've tried on the different render settings in renpy, Windows set to performance mode, all to no avail.

I wanna clarify just in case that there're games where the animations run incredibly smooth, absolutely no problem.
The specs on this PC are an i3-8100T 3.1GHz, 8GB ram, and integrated Intel UHD630, and while it's far from a high end device, a lot of high quality games run smoothly af, some others simply nuke the CPU.

I'd appreciate any guidance that could be provided, as to maybe be able to give some useful info to the devs of those games so we can get a better game, whether it's a video file issue, or size, or some settings that could be enabled to allow a better performance, all is welcome.

Thanks a bunch and have a good day folks!
 

Asr127

Member
Aug 5, 2016
100
114
Are these video playing ingame or in an external player?. If its an external player you could try using another one. I had this issue happen randomly with some videos. I assumed it may be due to there being something wrong with the video file itself. I have vlc and MPC which you can get from here . I have had lag from videos played in media player classic before. Sorry for not being very helpful.

EDIT: Adding more ram to you system if possible might help?
 
Last edited:

Deleted member 6168082

Active Member
Jun 5, 2023
927
1,403
Are these video playing ingame or in an external player?
I would assume the person means in-game animated scenes. I've played some games that had animated scenes lag/stutter etc for me as well.

I wish there was a way to lower the quality of the animated scenes or something (if that is the cause) I played a Demo on Steam of an AVN game and I let the Dev know. He did something and updated the Demo, next thing I know, the animated scene that was giving me trouble, didn't anymore.

So, it could be how the game handles the animated scenes? I have no clue. I wish there was a definitive answer on what the cause is and how to fix it.
 

Asr127

Member
Aug 5, 2016
100
114
I would assume the person means in-game animated scenes. I've played some games that had animated scenes lag/stutter etc for me as well.

I wish there was a way to lower the quality of the animated scenes or something (if that is the cause) I played a Demo on Steam of an AVN game and I let the Dev know. He did something and updated the Demo, next thing I know, the animated scene that was giving me trouble, didn't anymore.

So, it could be how the game handles the animated scenes? I have no clue. I wish there was a definitive answer on what the cause is and how to fix it.
He mentioned only having integrated graphics so it could be a combination of that and the game not being optimized. 4k might be too much for the system to handle regardless of size. Only having 8 gb of ram might also be an issue.
 

Deleted member 6168082

Active Member
Jun 5, 2023
927
1,403
He mentioned only having integrated graphics so it could be a combination of that

4k might be too much for the system to handle

Only having 8 gb of ram might also be an issue.

Just a bunch of guessing and mights.

We just need a real answer as to why. Like, why would 100+ games with animations work but 1-4 or so, have issues?

We need a rich person to buy a few computers/laptops with different graphic cards, let them get the games that give us issues, they can try the games out on the different stuff, and then we should find out everything.
 

CheerMaster

Newbie
Dec 27, 2018
31
257
EDIT: Adding more ram to you system if possible might help?
4k might be too much
The animations in question are in-game and in 1440p, and for sure upgrading the machine might solve something, but think about what the games are compared to their apparent requirements, a bunch of images and videos,
And I can play those same animations in a video player completely fluid no problem at all, but when the game does, they lag like it's nobody's business.

So I'd say it's not really a PC issue, plus there are other games that play animations with no issues at all, I checked only one that I had downloaded and it was in 1080p, so it might have something to do with resolution, dunno.

I also skimmed through google and saw some people with good rigs having issues too.

I wish there was a way to lower the quality of the animated scenes or something (if that is the cause) I played a Demo on Steam of an AVN game and I let the Dev know. He did something and updated the Demo, next thing I know, the animated scene that was giving me trouble, didn't anymore.
Was it a Renpy game? If so, is there any way to ask that dev what did they do?
Also, if resizing without using more resources is possible, that'd be dope.
 

Yuki-x

Member
Jul 22, 2021
214
324
For renpy

.......
A small fraction of systems may experience problems when running hardware accelerated Ren'Py games. These problems are often due to buggy graphics drivers, and so your first step to fixing them should be to check for an update to your graphics card drivers.


If upgrading your video drivers does not fix the problem, you should consider switching video renderers, using the following steps.


  1. Hold down Shift while starting Ren'Py, or press Shift+G once Ren'Py has started.
  2. From the "Graphics Acceleration" menu that appears, choose the renderer to use.
  3. Choose "Quit", then restart Ren'Py.

We suggest trying the GL and ANGLE renderers. The GLES renderers may not function on desktop hardware.
....
for rpgmake MV/MZ or any nwjs/electron game
create a text file and add the following
Code:
<script>
        // similar behavior as an HTTP redirect
        // displays the capabilities of your gpu
        // with the current version of the nwjs or electron
        window.location.replace("chrome://gpu");
</script>
change the extension from txt to html and load it to the engine.

e.g. For rpgmaker games name the file as "index.html" and replace the original file (remember to move the original in another folder first).
gpu.jpg
If that version does not support hardware acceleration for your gpu, you can download another one from
 

CheerMaster

Newbie
Dec 27, 2018
31
257
For renpy


for rpgmake MV/MZ or any nwjs/electron game
create a text file and add the following
Code:
<script>
        // similar behavior as an HTTP redirect
        // displays the capabilities of your gpu
        // with the current version of the nwjs or electron
        window.location.replace("chrome://gpu");
</script>
change the extension from txt to html and load it to the engine.

e.g. For rpgmaker games name the file as "index.html" and replace the original file (remember to move the original in another folder first).
View attachment 3055979
If that version does not support hardware acceleration for your gpu, you can download another one from
It's a renpy game, not RPGMaker, and I already tried all those steps in the renpy documentation, as I wrote in the original post. Still, thanks for your time.


Yes. It was an Renpy VN game.

He said "I slightly changed the way in which the animations are programmed into the game which may help performance"
So in short, no actual way to know what the dude did, that's sad.
 

Deleted member 6168082

Active Member
Jun 5, 2023
927
1,403
no actual way to know what the dude did, that's sad.
I mean, you could just ask him yourself if you really want to know the exact details about what he did, point by point and step by step.

He's the Dev for this game Having a HARD Time but he replied to me on Steam so, ask him on there (if you have an account) or on here. Maybe you'll get the reply you want.
 

Meushi

Well-Known Member
Aug 4, 2017
1,146
12,751
Thanks a bunch and have a good day folks!
What version of Ren'Py are the problematic games running? You can check the version of Ren'Py games by looking at game\script_version.txt

Many people have experienced such issues with games running Ren'Py 8.0.x. Particularly on lower spec machines.

If it's a Ren'Py version issue, there's no easy fix. You can try the custom library in this post, or transcoding the videos to reduce their hardware usage as also described there.
 
Oct 21, 2023
344
280
Golden shovel, but since the post already exists - no point in making new one.

Any developements with webm videos eating 100% cpu while played in renpy?

I get it, I have 5 years old gpu drivers installed so there is a field for issues to occur.
But ffs - how hard it can be to fix it? If vlc can play it, chrome can play it, then why renpy can't?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,959
16,194
Any developements with webm videos eating 100% cpu while played in renpy?
Well, I guess that there's none since it's not an issue that Ren'Py is facing due to its own code.
It's been now years that, just counting here, each day thousands peoples are playing Ren'Py games with WebM videos, yet there's still just a handful of them who experience this kind of problem.

From the few threads talking about this, it seem to be due to a combination between the configuration of the encoding and the way the GPU deal with video decompression. Two factors that are outside of Ren'Py scope.
 

hu lover

adult porn gave me purpose to be here.
Uploader
Jul 27, 2022
4,429
7,923
well honestly after playing videos in so many games myself, i never had any game reach 100% CPU usage. i have had my comp's fan go off and make loud noise as if revving up, despite this, i couldn't stand it being like that so i toned down my graphical settings for the game and now the fan does not go off at all during game play. i would suggest getting a desktop, if you have not already. laptops can handle up to a certain point, but are not meant for gaming.

the reason as to why you are experiencing high CPU usage can be due to a game being poorly optimized. back then when i used my laptop VAMX ran terribly, every game is optimized differently, toning down and adjusting a game's graphical settings can help fix a lot of issues, for example V sync enabled in some games helps a lot, and disabling anti-aliasing helps also.
 
Oct 21, 2023
344
280
the reason as to why you are experiencing high CPU usage can be due to a game being poorly optimized. back then when i used my laptop VAMX ran terribly, every game is optimized differently, toning down and adjusting a game's graphical settings can help fix a lot of issues, for example V sync enabled in some games helps a lot, and disabling anti-aliasing helps also.
Brother in Christ, we are talking about RenPy slideshow that for some reason fails to play video file the way every single other software does. What V-sync you're on about.

it seem to be due to a combination between the configuration of the encoding and the way the GPU deal with video decompression. Two factors that are outside of Ren'Py scope.
I know too little about the specifics you mention to say it's wrong, but for sure it does sound like not true.
Whose scope it is then? It is RenPy specific issue, that no other software has. If every developer managed to figure out the way to tackle this issue, and RenPy's can't, then sorry, but in my book - it is in RenPy scope. Fuck it, embed the browser and use it to play videos for all I care.

I can swallow the "99.9% of players do not experience this issue so it's not worth fixing it" argument, but let's not sugarcoat it into "impossible to fix".
 

hu lover

adult porn gave me purpose to be here.
Uploader
Jul 27, 2022
4,429
7,923
Brother in Christ, we are talking about RenPy slideshow that for some reason fails to play video file the way every single other software does. What V-sync you're on about.
Oh sorry, you had me confused when i read the title of this thread, when it said 100% CPU usage, i thought you were referring to graphical issues in video games.

back to topic, when you try to play a video file via RenPy slideshow are you getting an error message afterwards? if so, what error message are you getting?