• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py Many renpy games is unplayable on old PC.

NukaCola

Engaged Member
Jul 1, 2017
3,788
4,382
Hi. Renpy games used to be playable on a potato but now many games is stuttering and laggy. Would be nice if there is a way to fix these without upgrade the hardware.
There is 2 type of lag I encounter:
- The first one is animation lag. When there is animation playing the cpu is at 100% usage and it causes lag/skip frame. I found a renpy plugin that plays animations in H264 format instead and that helps a bit but not all games is support
- Massive interactive delay. Basically when a game has some kind of point and click gameplay . When you hover mouse on a object it took very long time for it to highlight and become clickable. This makes the game basically unplayable. Ex: Teen Zombie in Your Cabin, Vae Victis - Khan: Conquer, Ravish, Breed. This issue seems to only happen with onboard intel HD graphics because when I plugin in a GT 730, games work fine.

My specs: Intel Pentium G4560, 8GB ram, Intel HD 610.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,227
14,981
Hi. Renpy games used to be playable on a potato but now many games is stuttering and laggy.
[...]
My specs: Intel Pentium G4560, 8GB ram, Intel HD 610.
Hmm, the G4560 have been launcher in 2017, while the HD 610 have been released in 2016. This is far to be potato hardware, especially in regard of the configuration generally found from people having troubles with Ren'Py games ; that are 10 years old or more.
It's also more recent than my own computer, that have absolutely no issue playing smoothly Ren'Py games. As reference, while using my Variable Viewer for Ren'Py, I can easily goes up to more than 1,000 simultaneous interactive parts on a single screen. This is 100 times more than the average game, and it don't lead to slowdown, even less "massive interactive delay".

Since it apparently happen only when you use the embedded GPU, the most likely cause are an out of date driver, or the said GPU that is dying. Anyway, it's a local issue, not a Ren'Py one.
Ren'Py current minimal requirement make it works on any ~20 years old computers since the only imperative is a GPU compatible with Open GL 2.0 (2004) ; this modulo the GPU age itself. And, while being slow, Python isn't slow enough for it to be effectively sensible. At least outside of heavy movies, but they are handled by an external player wrote in C/C++.
 
  • Like
Reactions: NukaCola

NukaCola

Engaged Member
Jul 1, 2017
3,788
4,382
Hmm, the G4560 have been launcher in 2017, while the HD 610 have been released in 2016. This is far to be potato hardware, especially in regard of the configuration generally found from people having troubles with Ren'Py games ; that are 10 years old or more.
It's also more recent than my own computer, that have absolutely no issue playing smoothly Ren'Py games. As reference, while using my Variable Viewer for Ren'Py, I can easily goes up to more than 1,000 simultaneous interactive parts on a single screen. This is 100 times more than the average game, and it don't lead to slowdown, even less "massive interactive delay".

Since it apparently happen only when you use the embedded GPU, the most likely cause are an out of date driver, or the said GPU that is dying. Anyway, it's a local issue, not a Ren'Py one.
Ren'Py current minimal requirement make it works on any ~20 years old computers since the only imperative is a GPU compatible with Open GL 2.0 (2004) ; this modulo the GPU age itself. And, while being slow, Python isn't slow enough for it to be effectively sensible. At least outside of heavy movies, but they are handled by an external player wrote in C/C++.
I already install the latest intel driver. This issue also happens on my older computer with an i5 4570, Intel HD 4600.
You can try download Vae Victis - Khan. Skip through the intro and when you go to the world map. Try hover mouse to any of the icon or countries on the map. It takes like 20 seconds for everything to register. I check task manager and both cpu and gpu is not max out so I'm not sure that is the cause. Could it be because I'm using windows 11?
screenshot0012.png
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,227
14,981
You can try download Vae Victis - Khan. Skip through the intro and when you go to the world map. Try hover mouse to any of the icon or countries on the map. It takes like 20 seconds for everything to register.
I down sized the video (and converted it roughly, so don't bother the wrong duration) and as you can see, everything is perfectly smooth on my, a bit older than yours, computer:
View attachment vae victis.webm


Could it be because I'm using windows 11?
There's issue with Windows 11, but not that kind.
 

Titouille

New Member
Feb 25, 2023
7
46
You can try to start the renpy game and maintain the shift key. This will open a configuration tool for renpy where you can force the renderer (directx, opengl or software). This actually helped me in a previous configuration, where things were slow (I choose the angle/directx renderer).
 

Doorknob22

Super Moderator
Moderator
Game Developer
Nov 3, 2017
2,153
5,205
I already install the latest intel driver. This issue also happens on my older computer with an i5 4570, Intel HD 4600.
You can try download Vae Victis - Khan. Skip through the intro and when you go to the world map. Try hover mouse to any of the icon or countries on the map. It takes like 20 seconds for everything to register. I check task manager and both cpu and gpu is not max out so I'm not sure that is the cause. Could it be because I'm using windows 11?
View attachment 2782415
Unfortunately I don't have time to look into it (too busy working on version 0.10!) but for what it's worth, here is the code for this screen:


Code:
screen world_map:
    imagebutton auto "Maps/map_%s.png" action NullAction()
    #button:
    imagebutton:
        align 1.0,0.0 margin 20,20
        #focus_mask True background None
        #add "0GUI/map/help.png"
        background "0GUI/map/help.png"
        focus_mask True
        auto "0GUI/map/help_%s.png"
        action Jump('tutorial')
    imagebutton:
        align 0.1,1.0 margin 20,20
        background "0GUI/map/scroll.png"
        focus_mask True
        auto "0GUI/map/scroll_%s.png"
        action Jump('barlinTips')
    hbox:
        align .5,1.0 spacing -20 yoffset -10
        #button:
        #    focus_mask True background None
        #    add "0GUI/map/scroll.png"
        imagebutton:
            background "0GUI/map/khi_ui.png"
            focus_mask True
            auto "0GUI/map/khi_ui_%s.png"
            action Show('khaganate_info')
            alternate [SetVariable("kh_trp_to_send", 0), SetVariable("kh_trp_troop_max", deploymentTroopNum(-1)), Show("troops_bar", None, troopsFrom=-1)]
        #button:
        imagebutton:
            #focus_mask True background None
            #add "0GUI/map/castle.png"
            background "0GUI/map/castle.png"
            focus_mask True
            auto "0GUI/map/castle_%s.png"
            action Jump('khanThroneRoom')
        #button:
        imagebutton:
            #focus_mask True background None
            #add "0GUI/map/turn.png"
            background "0GUI/map/turn.png"
            focus_mask True
            auto "0GUI/map/turn_%s.png"
            action Jump('endTurn')

    #imagebutton auto "Maps/Gaunteinguk_%s.png" action Show('territory_screen',territoryList[0]) background None focus_mask True
    if territoryList[0].ruler.name == 'You': # MC rules this fiefdom
        imagebutton auto "Maps/F0_%s.png" action Show('territory_screen',None,territoryList[0]) background None focus_mask True
    else:
        imagebutton auto "Maps/Gaunteinguk_%s.png" action Show('territory_screen',None,territoryList[0]) background None focus_mask True sensitive fiefReachable(territoryList[0])
    if territoryList[1].ruler.name == 'You': # MC rules Oryeonguk
        imagebutton auto "Maps/F1_%s.png" action Show('territory_screen',None,territoryList[1]) background None focus_mask True
    else:
        imagebutton auto "Maps/Oryeonguk_%s.png" action Show('territory_screen',None,territoryList[1]) background None focus_mask True sensitive fiefReachable(territoryList[1])
    if territoryList[2].ruler.name == 'You': # MC rules Marbia
        imagebutton auto "Maps/F2_%s.png" action Show('territory_screen',None,territoryList[2]) background None focus_mask True
    else:
        imagebutton auto "Maps/Marbia_%s.png" action Show('territory_screen',None,territoryList[2]) background None focus_mask True sensitive fiefReachable(territoryList[2])
    if territoryList[3].ruler.name == 'You': # MC rules Hawatia
        imagebutton auto "Maps/F3_%s.png" action Show('territory_screen',None,territoryList[3]) background None focus_mask True
    else:
        imagebutton auto "Maps/Hawatia_%s.png" action Show('territory_screen',None,territoryList[3]) background None focus_mask True sensitive fiefReachable(territoryList[3])
    if territoryList[4].ruler.name == 'You': # MC rules Tinpingia
        imagebutton auto "Maps/F4_%s.png" action Show('territory_screen',None,territoryList[4]) background None focus_mask True
    else:
        imagebutton auto "Maps/Limtinia_%s.png" action Show('territory_screen',None,territoryList[4]) background None focus_mask True sensitive fiefReachable(territoryList[4])
    if territoryList[5].ruler.name == 'You': # MC rules Tinpingia
        imagebutton auto "Maps/F5_%s.png" action Show('territory_screen',None,territoryList[5]) background None focus_mask True
    else:
        imagebutton auto "Maps/Tinpingia_%s.png" action Show('territory_screen',None,territoryList[5]) background None focus_mask True sensitive fiefReachable(territoryList[5])
    if territoryList[6].ruler.name == 'You': # MC rules Waikokipia
        imagebutton auto "Maps/F6_%s.png" action Show('territory_screen',None,territoryList[6]) background None focus_mask True
    else:
        imagebutton auto "Maps/Waikokipia_%s.png" action Show('territory_screen',None,territoryList[6]) background None focus_mask True sensitive fiefReachable(territoryList[6])
    if territoryList[7].ruler.name == 'You': # MC rules Daoyuen
        imagebutton auto "Maps/F7_%s.png" action Show('territory_screen',None,territoryList[7]) background None focus_mask True
    else:
        imagebutton auto "Maps/Daoyuen_%s.png" action Show('territory_screen',None,territoryList[7]) background None focus_mask True sensitive fiefReachable(territoryList[7])

    if fahdaRevisitCondition == True and fahdaRevisitFlag == False and territoryList[2].ruler == mc:
        imagebutton auto "Maps/fahdaR_%s.png" action Jump('fahdaDispatcher') background None focus_mask True
    if lilanRevisitCondition == True and lilanRevisitFlag == False and territoryList[0].ruler == mc and territoryList[1].ruler == mc:
        imagebutton auto "Maps/lilanR_%s.png" action Jump('lilanAct2') background None focus_mask True
    if tatRevisitCondition == True and tatRevisitFlag == False and territoryList[5].ruler == mc:
        imagebutton auto "Maps/tatR_%s.png" action Jump('tatAct2') background None focus_mask True
    if ilgaRevisitCondition == True and ilgaRevisitFlag == False and territoryList[6].ruler == mc:
        imagebutton auto "Maps/ilgaR_%s.png" action Jump('ilgaAct2') background None focus_mask True
    if marnyRevisitCondition == True and marnyRevisitFlag == False and territoryList[7].ruler == mc:
        imagebutton auto "Maps/marnyR_%s.png" action Jump('marnyAct2') background None focus_mask True
    if wenchesList[0].act2Ready or wenchesList[1].act2Ready or wenchesList[2].act2Ready or wenchesList[3].act2Ready or (alamPregoSexCondition and alamPreggoSexPlayed == False):
        imagebutton auto "Maps/chronicles_%s.png" action Show('chronicle_screen') background None focus_mask True
 
  • Like
Reactions: Vincehz

NukaCola

Engaged Member
Jul 1, 2017
3,788
4,382
Here is the video. As you can see. Even the main menu is laggy. So far I only notice this problem in Khan and Teen Zombie in Your Cabin. But then again. I don't play many renpy "sandbox" game.
edit: it seem for whatever reason the recording software I use didn't pick up the mouse cursor in the video but basically when I hover mouse to any menu, it take like 5-10 second for it to highlight up and become interactable. Only then I can click to open it.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,227
14,981
[...] but for what it's worth, here is the code for this screen:
The bunch of if is a bit slowing down, but as I shown above, not really impacting.

I don't know what other value there's for ruler.name, but you can probably speed up a little bit with a renaming of the image, then a dynamic choice in the screen:
Python:
        imagebutton:
            auto "Maps/{}/F0_%s.png".format( "you" if territoryList[0].ruler == mc else "other" )
            action Show('territory_screen',None,territoryList[0]) 
            background None 
            focus_mask True
            sensitive territoryList[0].ruler != mc and fiefReachable(territoryList[0])
You then have "Maps/you/F0_idle.png" when the MC rule the territory, and "Maps/other/F0_idle.png" when it's not the MC.

But the fact is that Ren'Py refresh the screen regularly ; it can goes up to 5 times by second in normal use, and be even more frequent under some conditions. What mean that the more condition you have, the longer Ren'Py will need to proceed the screen.

Therefore, you would benefit from computing the condition beforehand. Something that would looks like:

Python:
label mapScreen:
    $renpy.dynamic( "rulers" )
    $renpy.dynamic( "flags" )
    python:
        rulers = []
        for i in range( 0, 8 ):
            rulers.append( "you" if territoryList[0].ruler.name == 'You' else "other" )
    $ flags = { "fahdaR": fahdaRevisitCondition == True and fahdaRevisitFlag == False and territoryList[2].ruler == mc,
                     "lilanR": lilanRevisitCondition == True and lilanRevisitFlag == False and territoryList[0].ruler == mc and territoryList[1].ruler == mc,
                    [...] }
    call screen world_map( rulers, flags )
    return
Then you replace all call screen world_map in the code by call mapScreen, what will have the same effect, but with the pre-computed conditions.

As for the screen, it would then looks like:
Python:
screen world_map( rulers, flags ):
    [...]

        imagebutton:
            auto "Maps/{}/F0_%s.png".format( rulers[0] )
            action Show('territory_screen',None,territoryList[0]) 
            background None 
            focus_mask True
            sensitive rulers[0] != "You" and fiefReachable(territoryList[0])
        imagebutton:
            auto "Maps/{}/F1_%s.png".format( rulers[1] )
            action Show('territory_screen',None,territoryList[1]) 
            background None 
            focus_mask True
            sensitive rulers[1] != "You" and fiefReachable(territoryList[1])
    [...]

    if flags["fahdaR"]:
        imagebutton auto "Maps/fahdaR_%s.png" action Jump('fahdaDispatcher') background None focus_mask True
    if flags["lilanR"]:
        imagebutton auto "Maps/lilanR_%s.png" action Jump('lilanAct2') background None focus_mask True
    [...]
This would make the screen faster, because based on way simpler computations.
 
  • Thinking Face
Reactions: gojira667