Hello all,
I updated to the new Ren'Py back on Sunday and since then I've seen noticeable issues with my GPU and lag in my game whenever a screen is being loaded. I've tried the solutions listed at https://www.renpy.org/doc/html/display_problems.html and I double-checked https://www.renpy.org/doc/html/screen_optimization.html to make sure I wasn't doing something horrific, but even with multiple restarts of renpy and my computer the problem remains the same.
Is anyone else experiencing the same issue? It was fine before I updated to the new version but now even just opening renpy(not my actual game) spikes my gpu to 40% and I've watched it hit as high as 80% while running the game. Even the tutorial and the question projects spike it up to at least 50%.
In-game I see the lag whenever I switch screens. For example I have a small fade-in animation that plays before the main menu loads. The animation plays fine but just as the main menu is loading in(in which i remove the faded-in images and add a static background) it lags. The same happens when I navigate to any of the options, load, credits, or gallery screens.
Any thoughts? I'm not ruling out a coding error on my part so I'd like to know if this is something I can fix.
[Solved]GPU spike and screen lag - 6.99.14
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
- Farryn
- Regular
- Posts: 33
- Joined: Wed May 10, 2017 10:15 pm
- Projects: Diplomatic Relations
- IRC Nick: Farryn
- Tumblr: princessdealtry
- Contact:
[Solved]GPU spike and screen lag - 6.99.14
Last edited by Farryn on Sun Jan 21, 2018 5:05 pm, edited 1 time in total.
- PyTom
- Ren'Py Creator
- Posts: 16093
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: GPU spike and screen lag - 6.99.14
Well, GPU usage should be increased. That's not a problem.
More concerning is the main menu lag, though that may be due to unpredicted image loads. Can you send me your unpacked game so I can diagnose it and suggest fixes?
More concerning is the main menu lag, though that may be due to unpredicted image loads. Can you send me your unpacked game so I can diagnose it and suggest fixes?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- Farryn
- Regular
- Posts: 33
- Joined: Wed May 10, 2017 10:15 pm
- Projects: Diplomatic Relations
- IRC Nick: Farryn
- Tumblr: princessdealtry
- Contact:
Re: GPU spike and screen lag - 6.99.14
Sent in pm - thank you!
- PyTom
- Ren'Py Creator
- Posts: 16093
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: GPU spike and screen lag - 6.99.14
The really obvious problem is that you're using a function called ProportionalScale to avoid scaling the gallery images, but it's a terrible function that's slowing things down.Farryn wrote: ↑Fri Jan 19, 2018 8:35 pm In-game I see the lag whenever I switch screens. For example I have a small fade-in animation that plays before the main menu loads. The animation plays fine but just as the main menu is loading in(in which i remove the faded-in images and add a static background) it lags. The same happens when I navigate to any of the options, load, credits, or gallery screens.
Code: Select all
def ProportionalScale(img, maxwidth, maxheight):
currentwidth, currentheight = renpy.image_size(img)
xscale = float(maxwidth) / float(currentwidth)
yscale = float(maxheight) / float(currentheight)
if xscale < yscale:
minscale = xscale
else:
minscale = yscale
return im.FactorScale(img,minscale,minscale)
I've modified Ren'Py such that it'll simply give up if you ask it to predict a screen that uses renpy.image_size, which'll move the slowdown to before someone clicks on the gallery screen. But I'd recommend getting rid of it entirely, and doing thre work required to actually produce thumbnails for your gallery images. (Without them, the full-size images are _always_ read from disk and decompressed.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- Farryn
- Regular
- Posts: 33
- Joined: Wed May 10, 2017 10:15 pm
- Projects: Diplomatic Relations
- IRC Nick: Farryn
- Tumblr: princessdealtry
- Contact:
Re: GPU spike and screen lag - 6.99.14
This is good to know, thank you! I will remove this and switch back to the thumbnails.
-- 5 minute later edit --
I removed the function and switched back to using all thumbnails instead and the lag was fixed immediately. No problem anywhere anymore and the hit to my gpu dropped by 10%.
Thank you very much for taking the time to look into this.
-- 5 minute later edit --
I removed the function and switched back to using all thumbnails instead and the lag was fixed immediately. No problem anywhere anymore and the hit to my gpu dropped by 10%.
Thank you very much for taking the time to look into this.
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot]