Any way to make a built game more friendly for G-Sync screens?

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
Message
Author
User avatar
Aureus
Veteran
Posts: 271
Joined: Sun Aug 06, 2017 4:49 am
Completed: The Tavern, Tales From Windy Meadow
Projects: Roadwarden
Organization: Moral Anxiety Studio
itch: moral-anxiety
Location: Breslau, Poland
Contact:

Any way to make a built game more friendly for G-Sync screens?

#1 Post by Aureus » Wed Sep 14, 2022 12:26 pm

A few players reported that as they use advanced screens, the game tends to flicker or briefly turn into black screen unless the screen is manually set to turn off the G-Sync features. It also starts to lag severely, or losing track of the mouse. For some people, running the game in window mode helps.

Is there an option to make the game more adaptive for such displays? From what I've googled, the issue happened to other Ren'Py games as well, but there was no obvious solution.

EDIT: Just in case, an example of what one player did to make the game run smoothly on his G-Sync screen: "Switched from gsync to fixed refresh rate + vsync off in nvidia control panel and the lag/stuttering is gone in fullscreen mode now."
Tales From Windy Meadow - slice of life, pixel art Visual Novel set in a fantasy village. now available on Steam.

User avatar
Zetsubou
Miko-Class Veteran
Posts: 513
Joined: Wed Mar 05, 2014 1:00 am
Completed: See my signature
Github: koroshiya
itch: zetsuboushita
Contact:

Re: Any way to make a built game more friendly for G-Sync screens?

#2 Post by Zetsubou » Thu Sep 15, 2022 5:23 pm

According to the answers in this thread: viewtopic.php?t=46412
Renpy should be able to go over 60fps. So as long as the game isn't doing a lot of unpredicted image loading as PyTom noted I would think it can run smoothly at higher frame rates.
My guess would be that it's dropping the framerate when nothing happens (which is often with a VN, since they're largely static images) to conserve power, RAM, etc. Which has the side effect of making the game fall outside of the G-sync target FPS and causing those problems.

One solution might be to implement a preference on the game's settings screen which G-sync users can turn on to invoke renpy.maximum_framerate(t) somewhere like interact_callaback, as suggested in that thread. So a G-sync user having stuttering problems could turn on that setting and force the game to run at a higher framerate.
Though according to that thread, the config is for the obsolete software renderer, so it might not work out.

You could also take a look at the gl_ preferences
https://www.renpy.org/doc/html/preferen ... _framerate
and RENPY_GL_VSYNC
https://www.renpy.org/doc/html/environm ... =framerate
The above would make me think that Renpy games should run fine with G-sync by default as long as the machine is powered (ie. not an unplugged laptop) and those configs haven't been changed for the game in question.
But I don't have a G-sync monitor or any experience supporting it, so I can't be sure.
Finished games
-My games: Sickness, Wander No More, Max Massacre, Humanity Must Perish, Tomboys Need Love Too, Sable's Grimoire, My Heart Grows Fonder, Man And Elf, A Dragon's Treasure
-Commissions: No One But You, Written In The Sky, Diamond Rose, To Libertad, Catch Canvas, Love Ribbon, Happy Campers, Wolf Tails

Working on:
Sable's Grimoire 2

Image

User avatar
Aureus
Veteran
Posts: 271
Joined: Sun Aug 06, 2017 4:49 am
Completed: The Tavern, Tales From Windy Meadow
Projects: Roadwarden
Organization: Moral Anxiety Studio
itch: moral-anxiety
Location: Breslau, Poland
Contact:

Re: Any way to make a built game more friendly for G-Sync screens?

#3 Post by Aureus » Thu Sep 15, 2022 11:54 pm

This is very interesting, thank you. I think I'll need to ask someone to test "RENPY_GL_VSYNC" on their end as I'm too afraid to blindly set it up for everyone, but that's definitely a start.
Tales From Windy Meadow - slice of life, pixel art Visual Novel set in a fantasy village. now available on Steam.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]