(SOLVED) Is Selective Redrawing (For Screens) Possible?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
User avatar
Posts: 322
Joined: Fri Sep 02, 2016 3:14 am
Completed: Multiverse Heroes, Space Hamster in Turmoil
Soundcloud: Chrysopoeist
Location: Puerto Rico

(SOLVED) Is Selective Redrawing (For Screens) Possible?

#1 Post by SypherZent » Sat May 01, 2021 2:23 pm

Update: Found some information on https://www.renpy.org/doc/html/screen_optimization.html that will help me with some extra optimizations that won't require changing how Ren'Py renders screens. Basically, by using Creator-Defined Displayables (https://www.renpy.org/doc/html/udd.html) it should be sufficient to allow Ren'Py to reuse existing displayables instead of making new one every interaction which seems to be what is happening. Note that the original problem was discovered by profiling screens (info on that can also be found on the Screen Optimization page linked above).

I'm wondering if there is a way for me to tell a screen NOT to redraw itself every single interaction.

For example, you know how you can put "predict False" into a screen to exclude it from prediction, for optimization purposes?
I would like to do something like "redraw False" and then, using a Screen Action, tell the screen when to redraw itself MANUALLY.

To elaborate, here's my issue: I use hovered on buttons in screens. When I hover over that button, ALL of my screens get redrawn.
So if I move my mouse back-and-forth really fast over the hover button, it runs the hovered action and redraws everything.
I've used Ren'Py's Developer Tools and logging functions to confirm this.

So, for optimization purposes, I need a way to tell screens NOT to redraw when I move my mouse back-and-forth over a button that has a hovered trigger.
This is essential to eliminate visual lag in animated frames caused by moving the mouse really fast over the hover buttons.

And then, I need a way to tell the screens to redraw themselves MANUALLY using a Screen Action.
For instance, I want to tell the screen when to redraw itself when the button's ACTION runs (instead of the button's hovered trigger).

Any help with this is appreciated. The quality of my production could increase tenfold and the performance could be on par with Unity games if I could just eliminate this lag with selective redrawing.

Post Reply

Who is online

Users browsing this forum: No registered users