Fullscreen vs. non-standard resolutions?
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.
Fullscreen vs. non-standard resolutions?
I recently bought a new laptop, and its default resolution is 1280x800, which is a width/height ratio of 1.6:1, significantly wider than the standard 4:3 (or 1.33:1) of most monitors. I've also heard of some machines having a 1280x1024 resolution, which would be 1.2:1.
When I run The Ren'Py Demo Game in fullscreen, for example, Eileen looks quite a bit wider than she should (20% wider, if I do the math). Of course, I can change the resolution of my laptop to, say, 1024x768, which puts wide black bars on the sides and narrow ones at the top and bottom (basically cutting off the extra pixels instead of resizing the screen), and everything looks normal.
My question: Is there a way to specify, within my Ren'Py-based game, that I want fullscreen mode to preserve the 4:3 width/height ratio, without forcing the user to adjust their machine's resolution themselves if they have an odd machine like mine? I'm planning on using 800x600 as my game's native resolution, and I realize most people are running a higher resolution than that these days, so they're quite likely to use fullscreen mode.
When I run The Ren'Py Demo Game in fullscreen, for example, Eileen looks quite a bit wider than she should (20% wider, if I do the math). Of course, I can change the resolution of my laptop to, say, 1024x768, which puts wide black bars on the sides and narrow ones at the top and bottom (basically cutting off the extra pixels instead of resizing the screen), and everything looks normal.
My question: Is there a way to specify, within my Ren'Py-based game, that I want fullscreen mode to preserve the 4:3 width/height ratio, without forcing the user to adjust their machine's resolution themselves if they have an odd machine like mine? I'm planning on using 800x600 as my game's native resolution, and I realize most people are running a higher resolution than that these days, so they're quite likely to use fullscreen mode.
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
I don't know how to deal with this yet, although it's something that I'm aware of. I'll search the SDL lists and see if I can figure out a decent way to go fullscreen on a machine with non-4:3 screen resolution.
I think a problem with this is that there isn't really a good way to query for the screen geometry, within SDL/Pygame, although I could be wrong about that.
I think a problem with this is that there isn't really a good way to query for the screen geometry, within SDL/Pygame, although I could be wrong about that.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
It's not a crippling problem... it just requires a little extra work on the part of those people whose machines have non-4:3 native resolutions. I just thought there might be some relatively trivial solution I might be missing -- a couple of lines to insert into the code that would fix the problem.
This isn't the first problem I've had with this resolution -- most desktop wallpapers are designed for 4:3 resolution as well. I'm certainly not complaining, though -- it's very nice when it comes to watching widescreen video. ^_^
This isn't the first problem I've had with this resolution -- most desktop wallpapers are designed for 4:3 resolution as well. I'm certainly not complaining, though -- it's very nice when it comes to watching widescreen video. ^_^
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
I'm not sure I have a good solution to this problem. One idea would be to break the Fullscreen setting up into two choices. We could have:
Fullscreen (4:3)
Fullscreen (16:9)
Window
As the choices, and rely on the user to set the right aspect ratio. The problem with this is that games that automatically go full screen would sometimes pick the wrong aspect ratio, and the user would have to change it. Also, the widescreen display would be anti-letter-boxed, with black stripes on the left and the right side of the screen.
Do people think this is a reasonable idea?
Fullscreen (4:3)
Fullscreen (16:9)
Window
As the choices, and rely on the user to set the right aspect ratio. The problem with this is that games that automatically go full screen would sometimes pick the wrong aspect ratio, and the user would have to change it. Also, the widescreen display would be anti-letter-boxed, with black stripes on the left and the right side of the screen.
Do people think this is a reasonable idea?
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
-
Just lurking
I may not be a regular (don't feel comfortable registering yet, given the extremely early state of my project) but this sounds like a good idea. Even if a user has to go in and change the preferences for their first run so the graphics don't look goofy on their display, with the standard Ren'Py game main and preferences menus, it's very easy to do so and takes maybe ten seconds.
Even though my own computer's display runs at the common 4:3 ratio, I've been considering a widescreen approach to my project to give it a more cinematic feel. What this ends up meaning so far is setting the window to 960x720 full screen with the text display set for 240 pixels high, leaving a visible graphical area of 960 by 480.
(Then I decided that I didn't like the text box going all the way to the left and right edges, so I tinkered with that. Now the background also shows for about 20 pixels on either side of the text box since I'd been making bg images at full resolution, but I like it better that way.)
Even though my own computer's display runs at the common 4:3 ratio, I've been considering a widescreen approach to my project to give it a more cinematic feel. What this ends up meaning so far is setting the window to 960x720 full screen with the text display set for 240 pixels high, leaving a visible graphical area of 960 by 480.
(Then I decided that I didn't like the text box going all the way to the left and right edges, so I tinkered with that. Now the background also shows for about 20 pixels on either side of the text box since I'd been making bg images at full resolution, but I like it better that way.)
-
Just lurking
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
Welcome, Just Lurking. You may want to register even if you're just lurking, as if you register, the board will show you which posts are new since your last visit, which I find a valuable feature.
I'm not sure why you'd make a game with a 960x720 resolution. Commonly supported resolutions are 800x600 or 1024x768 (and their less common widescreen equivalents). If you're not using them, aren't you just wasting screen space?
Unless people can think of a reason why it's a bad idea, I'm now quite likely to implement a mode in which black bars are placed on the side of the screen. I'm now wondering what to call this mode:
Fullscreen (Wide)
Fullscreen (1.6)
Fullscreen (16:9)
? The problem is, these are kinda misleading, as what the mode will do is to make the display take up the correct subset of the screeen, rather than making the display actually wider.
The game would still need to have the 4:3 aspect ratio, at least for the near term. In the future, I may look into removing that restriction, but not now.
I'm not sure why you'd make a game with a 960x720 resolution. Commonly supported resolutions are 800x600 or 1024x768 (and their less common widescreen equivalents). If you're not using them, aren't you just wasting screen space?
Unless people can think of a reason why it's a bad idea, I'm now quite likely to implement a mode in which black bars are placed on the side of the screen. I'm now wondering what to call this mode:
Fullscreen (Wide)
Fullscreen (1.6)
Fullscreen (16:9)
? The problem is, these are kinda misleading, as what the mode will do is to make the display take up the correct subset of the screeen, rather than making the display actually wider.
The game would still need to have the 4:3 aspect ratio, at least for the near term. In the future, I may look into removing that restriction, but not now.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
All right, you lured me out. No longer 'Just Lurking,' I guess. 
As for 800x600, it's too small for comfort (at least for me). I figured I'd experiment with 960x720, at least to start, because it wasn't one of the 'standard' resolutions but still 4:3. (Does Ren'Py by default only run those two 'standard' resolutions? It didn't look like my project, when tested in window mode, was being shrunk to 800x600, though for all I know it could have been expanded to 1024 resolution -- I suppose I ought to look more closely next time.)
At this point the only reason, really, that I even have resolution defined is because I've been testing my script to see how (and sometimes IF) it runs so far. So resolution is something that's still mutable. The only two things that are really fixed so far are that it's an SF project, and as of yet there's no ren'ai features.
(By the by, I'm very glad for the adjustable text display area! You've probably noticed I can be long-winded, and so far my prologue's got some fairly lengthy paragraphs.)
I almost forgot about the topic at large -- I can fully understand 16:9 support beyond the anti-letterboxing being something for far down the road, but I can't help but think that the possibility of 16:9 native resolution games is rather neat. Even if it is something far down the road if at all.
As for 800x600, it's too small for comfort (at least for me). I figured I'd experiment with 960x720, at least to start, because it wasn't one of the 'standard' resolutions but still 4:3. (Does Ren'Py by default only run those two 'standard' resolutions? It didn't look like my project, when tested in window mode, was being shrunk to 800x600, though for all I know it could have been expanded to 1024 resolution -- I suppose I ought to look more closely next time.)
At this point the only reason, really, that I even have resolution defined is because I've been testing my script to see how (and sometimes IF) it runs so far. So resolution is something that's still mutable. The only two things that are really fixed so far are that it's an SF project, and as of yet there's no ren'ai features.
(By the by, I'm very glad for the adjustable text display area! You've probably noticed I can be long-winded, and so far my prologue's got some fairly lengthy paragraphs.)
I almost forgot about the topic at large -- I can fully understand 16:9 support beyond the anti-letterboxing being something for far down the road, but I can't help but think that the possibility of 16:9 native resolution games is rather neat. Even if it is something far down the road if at all.
What exactly are you intending to do, PyTom? I'm a bit confused, since you said you can't detect the computer's resolution. Are you just going to offer a choice between:
* the standard 4:3 fullscreen mode, or
* a 16:9 fullscreen mode where you pad each side of the game window with a black bar 1/6th the width of the game window?
It strikes me as curious, because here's what I see happening in the latter case on my 1280x800 machine:
* The original game window is 800x600. Let's assume it contains an 800x600 background image.
* Adding black bars to make it 16:9 makes the modified game window 1067x600. (The background image covers 75% of the width and 100% of the height.)
* Ren'Py passes this window to my computer to make it fullscreen. My computer stretches the 1067-pixel width to 1280 (a 20% increase) and the 600-pixel height to 800 pixels (a 33% increase).
* Since the background image covers 75% of the width and 100% of the height, my computer is now displaying the image in a 960x800 region.
* So now the image that's supposed to have a 1.33:1 width/height ratio is being shown on my machine with a 1.2:1 width/height ratio... meaning everything is "squished" 10% horizontally.
This is definitely an improvement over the original fullscreen, where everything was being stretched 20% horizontally... but it's still leading to a deformed end result.
Also, on the terminology, I'd avoid "Fullscreen (Wide)", since I'm instantly simultaneously reminded of both of the two DVD options, fullscreen and widescreen. There's also a difference between 1.6:1 and 16:9 (which is 1.777:1) (which is incidentally precisely why I'm getting the deformed end result above).
* the standard 4:3 fullscreen mode, or
* a 16:9 fullscreen mode where you pad each side of the game window with a black bar 1/6th the width of the game window?
It strikes me as curious, because here's what I see happening in the latter case on my 1280x800 machine:
* The original game window is 800x600. Let's assume it contains an 800x600 background image.
* Adding black bars to make it 16:9 makes the modified game window 1067x600. (The background image covers 75% of the width and 100% of the height.)
* Ren'Py passes this window to my computer to make it fullscreen. My computer stretches the 1067-pixel width to 1280 (a 20% increase) and the 600-pixel height to 800 pixels (a 33% increase).
* Since the background image covers 75% of the width and 100% of the height, my computer is now displaying the image in a 960x800 region.
* So now the image that's supposed to have a 1.33:1 width/height ratio is being shown on my machine with a 1.2:1 width/height ratio... meaning everything is "squished" 10% horizontally.
This is definitely an improvement over the original fullscreen, where everything was being stretched 20% horizontally... but it's still leading to a deformed end result.
Also, on the terminology, I'd avoid "Fullscreen (Wide)", since I'm instantly simultaneously reminded of both of the two DVD options, fullscreen and widescreen. There's also a difference between 1.6:1 and 16:9 (which is 1.777:1) (which is incidentally precisely why I'm getting the deformed end result above).
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
Okay, my plan is as follows.
When the Fullscreen (1.6) mode is enabled, instead of creating a window that is (say) 800 x 600, instead we will create a window that is 1.6 * 600 wide, which is 960 pixels wide. Two vertical bands, each 960 - 800 = 160 / 2 = 80 pixels wide are placed on either side of the image, and then that is displayed in fullscreen mode.
On your (1280x800) display, everything is scaled up 4/3 times. So the actual display part of the window is scaled to 4/3 * 800 = 1064 by 4/3 * 600 = 800 pixels. That's an aspect ration of 1.33, more or less. (The actual math will be more precise then this, so it should be very close to a 4/3 aspect ratio.)
I think my confusion comes from the fact that many manufacturers advertise 1.6 aspect screens (with square pixels) as 16:9 screens.
True 16:9 (1280 x 720) will either be wide, or will jump up to the next video mode (in which case, fullscreen may be a misnomer). I'm not sure if this is really a problem, because most displays I've seen are really 16:10, even if they claim to be 16:9 on the surface.
When the Fullscreen (1.6) mode is enabled, instead of creating a window that is (say) 800 x 600, instead we will create a window that is 1.6 * 600 wide, which is 960 pixels wide. Two vertical bands, each 960 - 800 = 160 / 2 = 80 pixels wide are placed on either side of the image, and then that is displayed in fullscreen mode.
On your (1280x800) display, everything is scaled up 4/3 times. So the actual display part of the window is scaled to 4/3 * 800 = 1064 by 4/3 * 600 = 800 pixels. That's an aspect ration of 1.33, more or less. (The actual math will be more precise then this, so it should be very close to a 4/3 aspect ratio.)
I think my confusion comes from the fact that many manufacturers advertise 1.6 aspect screens (with square pixels) as 16:9 screens.
True 16:9 (1280 x 720) will either be wide, or will jump up to the next video mode (in which case, fullscreen may be a misnomer). I'm not sure if this is really a problem, because most displays I've seen are really 16:10, even if they claim to be 16:9 on the surface.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
You explain it so much more clearly than I can. ^_^ The math is easier with 1.6 than it is with 16/9, too. I understand now... and I can always adjust the resolution on the laptop, or just use the older PC, as long as this isn't available.
Any thoughts on 1280x1024? (Does anybody even have a system that uses that resolution by default?) Of course, 1280/1024 is 1.25... so there's really not much difference between that resolution and 4:3 -- less than 7%.
Any thoughts on 1280x1024? (Does anybody even have a system that uses that resolution by default?) Of course, 1280/1024 is 1.25... so there's really not much difference between that resolution and 4:3 -- less than 7%.
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
Huh. Now that you mention it, I checked and my main monitor is running at 1280x1024. Go figure.
Anyway, I made a test release of Ren'Py w/ Fullscreen (1.6) support. Download it from:
http://www.bishoujo.us/tmp/renpy-widetest.zip
Please let me know if it works for you. (I'm not sure it will... widescreen machines can be somewhat flaky as to what resolutions they will stretch to fullscreen.)
Anyway, I made a test release of Ren'Py w/ Fullscreen (1.6) support. Download it from:
http://www.bishoujo.us/tmp/renpy-widetest.zip
Please let me know if it works for you. (I'm not sure it will... widescreen machines can be somewhat flaky as to what resolutions they will stretch to fullscreen.)
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Tried the widetest version on my laptop with the 1280x800 screen... and when I run the demo and select the Fullscreen (1.6) option, I get a 259x162 mm image centered on my 332x208 mm screen -- in other words, it fills about 78% of my screen in both dimensions -- and the image looks horizontally stretched, the same way it does in regular fullscreen mode.
When I take a screenshot in Fullscreen (1.6) mode and paste it into an image viewer, the resulting image is 960x600 pixels, which is an 800x600 window with an 80x600 black bar on each side. (When I take a screenshot in regular Fullscreen mode, the result is an 800x600 image.)
EDIT/afterthought: It's almost like it's taking the 960x600 image and stretching it horizontally to fill the 1280 pixels, without also stretching it vertically to fill the 800 pixels.
When I take a screenshot in Fullscreen (1.6) mode and paste it into an image viewer, the resulting image is 960x600 pixels, which is an 800x600 window with an 80x600 black bar on each side. (When I take a screenshot in regular Fullscreen mode, the result is an 800x600 image.)
EDIT/afterthought: It's almost like it's taking the 960x600 image and stretching it horizontally to fill the 1280 pixels, without also stretching it vertically to fill the 800 pixels.
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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:
I had similar (that is, bad) results on a laptop I tested on. I think that there just isn't a rule that determines if/when the image will be stretched on the screen.
I'm afraid I just don't have a good solution to the original problem.
I'm probably going to cut Fullscreen (1.6) out of the public interface.
I'm afraid I just don't have a good solution to the original problem.
I'm probably going to cut Fullscreen (1.6) out of the public interface.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
I really wasn't begging for this feature to begin with. I just noticed something unusual and thought I'd bring it to your attention. Especially if you can't deduce the screen resolution via code, this seems impossible for covering all the variations of possible resolutions.
Besides 1280x800 and various 4:3 resolutions, I also have the optional settings of 1280x768, 1280x720 and 1280x600, and you have 1280x1024. Surely you're not going to code possible fullscreen modes for 1.25:1, 1.333:1, 1.6:1, 1.667:1, 1.778:1 and 2.133:1, as well as any other oddball ratios other people might come up with.
(How about 1.357:1 for NeoGeo machines... or 1.067 for old Bally Midway arcade machines [with non-square pixels]? 1:1 for a PalmPilot? 3:333:1 for the old Jumbotron in Toronto's SkyDome [now Rogers Centre, sans Jumbotron]? ^_^)
Besides 1280x800 and various 4:3 resolutions, I also have the optional settings of 1280x768, 1280x720 and 1280x600, and you have 1280x1024. Surely you're not going to code possible fullscreen modes for 1.25:1, 1.333:1, 1.6:1, 1.667:1, 1.778:1 and 2.133:1, as well as any other oddball ratios other people might come up with.
(How about 1.357:1 for NeoGeo machines... or 1.067 for old Bally Midway arcade machines [with non-square pixels]? 1:1 for a PalmPilot? 3:333:1 for the old Jumbotron in Toronto's SkyDome [now Rogers Centre, sans Jumbotron]? ^_^)
Who is online
Users browsing this forum: Bing [Bot]