Ren'Py RenPy and (physical) screen size

Bip

Active Member
Donor
May 4, 2017
734
2,100
Hi guys,

Big little problem here and I can't find a way to solve it.
I have an old laptop with a small resolution screen (1680 x 1050) and a bigger secondary screen (2560 x 1440).
The main screen is the small one... of course... and I don't want to change it, it's very useful like this.

But for RenPy, it's a pain in the ass!

RenPy doesn't care, the games start on the primary screen. So, for games in full-HD resolution, it reduce the size to fit in the screen.
And of course, when I move the game on my secondary screen, I can't give it his full resolution. It would be too easy! It's capped to the primary screen size... So I can't resize it at more than 1680 x 1050.
- Mouse corner resize don't work (1680 x 1050 max)
- gui.init(1920, 1080) is not valid after the init of the game, so it doesn't work.
- config.screen_width, I've tried...
- config.adjust_view_size = (1920, 1080), nope.

So, it seems there is a max_width and a max_height somewhere, based on the screen resolution, that's preventing me from enlarging the window to its proper resolution.

For now, the only way is to shutdown the primary screen to start the game and it's not very convenient...
Is there a way (via the console would be perfect) to force it?
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
The internal settings (like gui.init) control the "virtual" screen, if you will. Ren'py will use that for image placement and sizing, but then will scale everything to the size of the actual physical screen if it's smaller. So adjusting the settings internally won't have an effect - Ren'py won't create a window bigger than the physical screen.

describes a variable you can change that will then allow the window to be resizable.
seems to imply that if you go into Preferences and toggle between "full screen" and back to "Windowed", it might then go to the "proper" size, but I don't know if this works on secondary monitors.
 

Bip

Active Member
Donor
May 4, 2017
734
2,100
Hi Rich,

The config.gl_resize allows to resize the window (physical resize) but is capped to the screen size.
If the screen size change (moving from primary to secondary monitor), the limits remain.
It's the same toggling between full screen and windowed... It's still capped.

I've tried some renpy.set_physical_size((1920, 1080)), but no. Still this limit...
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
Ah so. Not having a dual-screen machine, I've never run into this. As a suggestion, maybe go to Ren'py's GitHub site ( ) and create an issue. PyTom might be able to put in a flag that disables the "limit to the primary screen size" behavior.
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,272
22,422
Renpy generates images for the UI when you create a project, the image are sized to which you set the resolution when you generate the project and they won't change anymore after that. I tried to make my 4k game scalable so I don't have to upload 2 different versions everytime for a release (I have shitty internet), but would've had to regenerate the images everytime the game starts (or when the player changes resolution), or resize them dynamically which would've meant to edit several of renpys core files.
I guess a python script would've work as well, but I'm not a python pro, so I didn't try.
 
  • Like
Reactions: ShamanLab

Bip

Active Member
Donor
May 4, 2017
734
2,100
Ah so. Not having a dual-screen machine, I've never run into this. As a suggestion, maybe go to Ren'py's GitHub site ( ) and create an issue. PyTom might be able to put in a flag that disables the "limit to the primary screen size" behavior.
I think I'll end doing it, yes. Not a big fan of creating accounts everywhere, especially on sites that I probably won't return to, but I'm going crazy looking for it and I can't find it :LOL:


Renpy generates images for the UI when you create a project, the image are sized to which you set the resolution when you generate the project and they won't change anymore after that. I tried to make my 4k game scalable so I don't have to upload 2 different versions everytime for a release (I have shitty internet), but would've had to regenerate the images everytime the game starts (or when the player changes resolution), or resize them dynamically which would've meant to edit several of renpys core files.
I guess a python script would've work as well, but I'm not a python pro, so I didn't try.
I suppose that you're talking about the game/gui, not about the game/images.
But even if you set your game to, let's say, 1280 x 720, you can enlarge the window if your screen is big enough (except if you set the config.gl_resize to False). Everything will be scaled to fit the new size, up or down.

Here, a game sets to 1920 x 1080 can't reach his trully size because my primary screen is smaller than this resolution. We're in the playing part of the process, not the creation part.

But that clearly a good thing to know! Thanks!
 

recreation

pure evil!
Respected User
Game Developer
Jun 10, 2018
6,272
22,422
I think I'll end doing it, yes. Not a big fan of creating accounts everywhere, especially on sites that I probably won't return to, but I'm going crazy looking for it and I can't find it :LOL:



I suppose that you're talking about the game/gui, not about the game/images.
But even if you set your game to, let's say, 1280 x 720, you can enlarge the window if your screen is big enough (except if you set the config.gl_resize to False). Everything will be scaled to fit the new size, up or down.

Here, a game sets to 1920 x 1080 can't reach his trully size because my primary screen is smaller than this resolution. We're in the playing part of the process, not the creation part.

But that clearly a good thing to know! Thanks!
Well, your old laptop is 1680 x 1050 (16/10), the other screen 2560 x 1440 (16/9), the images have a fixed ratio, and that ratio won't change on resize, that's why the clickable area is off.
 

Rich

Old Fart
Modder
Donor
Respected User
Game Developer
Jun 25, 2017
2,490
7,035
I think I'll end doing it, yes. Not a big fan of creating accounts everywhere, especially on sites that I probably won't return to, but I'm going crazy looking for it and I can't find it :LOL:
Ya, I get that. But if you're going to be using Ren'py, you may encounter bugs, so being able to report them (now or in the future) may be useful. And PyTom is usually really good about fixing things, as long as you give a good description of what's going on and a way to recreate it. I've reported 2 or 3 items, and they've gotten fixed in the very next release. Your case is obviously quirky, in that it requires a two-screen setup, but I'm sure he knows where the "max screen size" stuff is buried.
 
  • Like
Reactions: recreation

canibalarrecho

New Member
Dec 2, 2019
10
6
I'm having a gpu bottle neck issue, my gpu goes to 100%, how can I lower the resolution of the game so I can play that part, pd. its an part where you have to click a lot to advance the progress bar
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,369
15,285
I'm having a gpu bottle neck issue, my gpu goes to 100%, how can I lower the resolution of the game so I can play that part, pd. its an part where you have to click a lot to advance the progress bar
Changing the resolution will not solve your problem. Ren'py do not generate images big enough to push a GPU at 100%, it's all the in between processing that can cause that, and it will be the same whatever the size of the resulting image.

What is the game ?
 
Aug 19, 2019
96
124
I was also wondering about this or something of this matter.
When I first started learning about Renpy, some on youtube, some on forums, I remember the person making the video saying that renpy uses natively 1920*1080 pictures or something like this so if we make a bigger image either resize it in eg. Photoshop or use renpy for this but then we have to write code in renpy for it for every picture but I am not sure.
So if I make a 1440p image instead of a 1080p one, would that work?
Would the bigger picture still work on a smaller monitor and everything would be visible?
What happens if there is something to click on the picture? (on the side or in a corner)
I was just wondering because I have a ability to do renders bigger than 1080p but I really don't want to waste my time just to find out that I have to resize everything.(I know I could but it is easier to straight up do the right size)
 

Bip

Active Member
Donor
May 4, 2017
734
2,100
The Organic Hemp
Ideally, your renderings should be the same size as the renpy window.
So, if you set gui.init(1920, 1080), your renders should be 1920 x 1080.

You can make the renderings larger, but then you will have to resize them to fit the windows. Otherwise, they will overflow. But this means using resources of the player's computer, which can be a problem for a number of configurations. I don't think it's a good solution.

That said, if you want to do 4k renders and initialize the RenPy window at the same resolution, there won't be any particular worries for screens with a lower resolution. The window, and its contents, will shrink accordingly. On the other hand, problems of lack of memory may appear......

So, window and renders size matching and a not to big resolution is the best.
 
  • Like
Reactions: The Organic Hemp
Aug 19, 2019
96
124
The Organic Hemp
Ideally, your renderings should be the same size as the renpy window.
So, if you set gui.init(1920, 1080), your renders should be 1920 x 1080.

You can make the renderings larger, but then you will have to resize them to fit the windows. Otherwise, they will overflow. But this means using resources of the player's computer, which can be a problem for a number of configurations. I don't think it's a good solution.

That said, if you want to do 4k renders and initialize the RenPy window at the same resolution, there won't be any particular worries for screens with a lower resolution. The window, and its contents, will shrink accordingly. On the other hand, problems of lack of memory may appear......

So, window and renders size matching and a not to big resolution is the best.
Thanks.
 

EvasionYT

Newbie
Jan 6, 2021
72
40
Im kinda bringing this up again lol, so I have a 1440p monitor, should I set the renpy project resolution to that? Or go with 1080p? Will it resize everything if a user is using one that's 1080p?
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,581
2,219
Im kinda bringing this up again lol, so I have a 1440p monitor, should I set the renpy project resolution to that? Or go with 1080p? Will it resize everything if a user is using one that's 1080p?

RenPy will resize whatever resolution you use within your project to whatever window size the player decides to play at.
If your game was 720p and you're playing full screen on a 4K monitor - the final images will be upscaled to 4K. And the opposite way around. A lot will come down to if you're one of those people who can tell the difference between 1080p and 720p upscaled to 1080p. Personally, I'm not.

Some will suggest that the higher resolution you can set your project to... the better. After all, movies at 4K are better than movies at 720p... right? There is some truth to that.

Others (like myself) will point out that it really depends how good you are as a 3D artist. There's no point taking all that extra time rendering at higher resolutions, if the end result isn't that much different.

I'd suggest choosing a resolution that suits your free time. Test different resolutions and how long each takes to render. Settle on the highest resolution that works for you. No point picking 1440p or 4K if each rendering 150 images is more time than have free over say... 4 weeks. You'll constantly be waiting for your renders to finish.

I've seen games at 720p which look better than other games rendered 1440p.
A lot of it is about the skill of the 3D artists.

Edit: The other aspect I forgot (because I'm not a 3D artist) is rendering at a higher resolution and then downsizing the image to reduce image aberrations/artefacting. Downsizing, especially using some sort of de-noising program can mean you can reduce the number iterations you send rendering (how long the renderer will spend tracking individual light rays).. and therefore how much time each render takes. So you end up with a slightly less perfect 4K rendered image, but the de-noiser makes it a near perfect 1080p image. Which wasn't your question, but might be something you want to consider anyway.
 
Last edited: