Ren'Py Renpy & 4k

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,295
Hi!

Trying to make a renpy prototype in 4k but come across several problem that seems unsolvable so far (I swear I googled it before).

Videos overlay:
I can't resize videos overlay (with renpy) without losing alpha mask. Tried multiple codecs (you never know lol), but nope.
It's not *that* bad, as I can still loop them in around or under 15mo but still, 2*4k overlay and Renpy start to shitting himself. Weird thing is downscaling PC to 1080 cause no problem.

Renpy downscaling from 4k to 1080:
Is there a way to avoid this monstruosity?
I mean the glitching rendering? (vid is around 1080 but you can see the problem, also boobs)

View attachment pythonw_n7jx7sN5Hs.mp4












artworks-wxgOBPLxmBh3v3hT-CBzIcA-t500x500.jpg
 
Last edited:

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,295
So... The only way to make a 4k game playable in a downscaled resolution (and not looking like a dumpster fire) is basically... To create a second copy of your images for said resolution (or even a standalone build)? Sounds like a nightmare, I must be missing the obvious (changing openGL scaling behavior?). Is there any game out there that is done in 4k?

1417822248943.gif


Edit: I was missing the obvious :eek:
Press shift+G in game and force ANGLE2 renderer. It's not perfect but remove tons of downscaling problems to somewhat acceptable level.

pythonw_aNdPZ9zU6Y.png

4k->1080 downscale with both renderers (zoomed) :

pythonw_JS1E6CowEn.png
 
Last edited:

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
This is just me checking a very basic question, which probably doesn't matter at the detail level you're talking about...
(If I'm honest, both those pictures look identical to me - I'm a graphical philistine).

But when you created your new RenPy project, did you choose the "Custom GUI size" when prompted (as opposed to 1066x600, 1280x720 or 1920x1080)?

I know some of the default things (like the textbox background) are sized according to the choice you make when creating the project.
I'm merely guessing that other aspects of the GUI might be scaled/defaulted based on that choice too.

I know it's a basic point, but that makes it so easy to overlook too when your other concerns are so highly technical.

Is there any game out there that is done in 4k?

It's not quite 4K, but Estate Dominate was 2560x1440. If there are other examples, I haven't personally noticed yet.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
So... The only way to make a 4k game playable in a downscaled resolution (and not looking like a dumpster fire) is basically... To create a second copy of your images for said resolution
A manual process will always offer you better result than an automatic one.

But you are forgetting something important here.
It doesn't matter that you downscale your images, Ren'Py will rescale them anyway. Not all players are playing in full screen (therefore the image will be scaled minus the title bar and borders), not all players will have a screen big enough (therefore the image will be scaled to fit theirs), not all players want the game to take all the screen and they'll rescale the window (therefore the image will be scaled to fit the new one), some player will have an in between screen, and either seen the 4K version downscaled, or the 1080 upscaled.


Press shift+G in game and force ANGLE2 renderer. It's not perfect but remove tons of downscaling problems to somewhat acceptable level.
Code:
init python:
    config.label_overrides["_gl_test"] = "my_gl_test"
    config.label_overrides["_gl_testREAL"] = "_gl_test"

define config.gl2 = True

label my_gl_test:
    call _gl_testREAL
    if not _preferences.renderer.endswith( "2" )
        "You cannot play this game, sorry"
        $ renpy.quit()
    $ _preferences.renderer = "angle2"
    return
It's the only way to force Ren'Py using it, else it will automatically select by itself the most performant one for the player configuration. Yet I'm not sure that it would really works.


Edit: typo in the code.
 
Last edited:

Deleted member 1121028

Well-Known Member
Dec 28, 2018
1,716
3,295
This is just me checking a very basic question, which probably doesn't matter at the detail level you're talking about...
(If I'm honest, both those pictures look identical to me - I'm a graphical philistine).

But when you created your new RenPy project, did you choose the "Custom GUI size" when prompted (as opposed to 1066x600, 1280x720 or 1920x1080)?

I know some of the default things (like the textbox background) are sized according to the choice you make when creating the project.
I'm merely guessing that other aspects of the GUI might be scaled/defaulted based on that choice too.

I know it's a basic point, but that makes it so easy to overlook too when your other concerns are so highly technical.

It's not quite 4K, but Estate Dominate was 2560x1440. If there are other examples, I haven't personally noticed yet.
Yeah went with 3840*2160. But there not much vanilla Renpy left.
I don't think it's highly technical nor even Renpy really at fault, but OpenGL not really build/thought for such large images.
I'll take a look at Estate Dominate see how he/she handles it (if game handles it at all). Thank you.

A manual process will always offer you better result than an automatic one.

But you are forgetting something important here.
It doesn't matter that you downscale your images, Ren'Py will rescale them anyway. Not all players are playing in full screen (therefore the image will be scaled minus the title bar and borders), not all players will have a screen big enough (therefore the image will be scaled to fit theirs), not all players want the game to take all the screen and they'll rescale the window (therefore the image will be scaled to fit the new one), some player will have an in between screen, and either seen the 4K version downscaled, or the 1080 upscaled.
I was thinking of way to mitigating at least for a somewhat playable 1080 full screen (like you have to set a bar somewhere). But looking more into angle2, seems good enough, not the panacea, but I'll run with it. Since it uses DX I guess it leaves Mac/Linux users in the cold.

Code:
init python:
    config.label_overwrite["_gl_test"] = "my_gl_test"
    config.label_overwrite["_gl_testREAL"] = "_gl_test"

define config.gl2 = True

label my_gl_test:
    call _gl_testREAL
    if not _preferences.renderer.endswith( "2" )
        "You cannot play this game, sorry"
        $ renpy.quit()
    $ _preferences.renderer = "angle2"
    return
It's the only way to force Ren'Py using it, else it will automatically select by itself the most performant one for the player configuration. Yet I'm not sure that it would really works.
Incredible :love:, seems working to me. Would have never figured this out.
(overrides instead of overwrite, no?)
I will put something like a recommendation splash screen or something among the lines.
Thank you very much.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
Incredible :love:, seems working to me. Would have never figured this out.
Well, it wasn't too difficult. Just needed to know that Ren'Py have one configuration value related to this (config.gl2 to force the use of the second version) and then have an intensive use of grep to trace the process back to something that can be used.



(overrides instead of overwrite, no?)
Yeah, my bad.


Thank you very much.
You're welcome.