Sign in to follow this  
OmarShehata

Handling multiple resolutions?

Recommended Posts

OmarShehata    205
This is more of a general question, but I thought I'd point out that I'm using Lua.

My question is what's the best way to handle multiple resolutions while keeping my aspect ratio?

I used to think that by keeping the window sizes at 16:9 (my game's aspect ratio) , and going into fullscreen that the game would just add black borders without stretching and everything would be fine. This doesn't seem to be the case however as I'm getting mostly erratic behavior with that.

I did manage to get it working perfectly when setting the window size to the screen size before going into full screen. And while that works and keeps the aspect ratio, I feel that defeats some of the purpose of setting resolutions.

Don't older games have it so that, you could set to a lower resolution in the same aspect ratio, and you'd still see the same amount of stuff in the same screen area but since you made the graphics at a lower resolution they would be blurred but it would in turn be better for performance?

Is this worth pursuing or do most modern games now just set the window to the monitor size before going into full screen? That mean we'd only support one resolution in full screen, and that'd be whatever resolution your monitor is at, and add black borders where there is no game.

Any info/tips would be greatly appreciated! Thanks! Edited by OmarShehata

Share this post


Link to post
Share on other sites
mark ds    1786
Unless there is a specific reason, I wouldn't force an aspect ration - there are people using 16:10 native resolutions, and even older 4:3 CRTs, that would prefer to use all the pixels at their disposal.

However, the resolutions available are a function of what's supported by the monitor. Functions that are useful include EnumDisplayDevices, EnumDisplaySettings, and ChangeDisplaySettings/ChangeDisplaySettingsEx.

Share this post


Link to post
Share on other sites
OmarShehata    205
[quote name='mark ds' timestamp='1340014506' post='4950195']
Unless there is a specific reason, I wouldn't force an aspect ration - there are people using 16:10 native resolutions, and even older 4:3 CRTs, that would prefer to use all the pixels at their disposal.

[/quote]

I can't support more than 1 aspect ratio because then the graphics would be stretched in some way or another and that would look horrible. I'm trying to make it exactly like how when you watch a movie in full screen, there's always black bars on the top and bottom.

Share this post


Link to post
Share on other sites
Ashaman73    13715
[quote name='OmarShehata' timestamp='1340023325' post='4950224']
I can't support more than 1 aspect ratio because then the graphics would be stretched in some way or another and that would look horrible
[/quote]
You should, it is quite easy. You just need to separate the gui (more fix) from the game. When it is a 3d game, you just need to the the ratio according to your game resolution, if you have a 2d game, just display more. Problems occurred only if you have fix background images (i.e. an adventure game), in this case I would choose a minimum aspect ration and fill the rest with either placeholder art or with a larger background image.
When it comes to gui, try to use dockable gui elements, that is, instead of setting the healthbar at an absolute position, use a system like this: 3 pixels from the bottom and 5 pixel from the left, this way it is screen independent.

Here are two comparision shots, one at 1280x720(16:9) and one at 1680x1050(16:10), the 3d world is adjusted, the gui elements are fix (no scaling):
[img]http://www.gnoblins.net/wp-content/gallery/screenshots_alpha_1/screenshot_05_2012_01.jpg[/img]

[img]http://www.gnoblins.net/wp-content/gallery/screenshots_alpha_1/screenshot_04_2012_09.jpg[/img]

Share this post


Link to post
Share on other sites
I can see where he's coming from with the whole aspect ratio thing though, for some kind of games having a different aspect ratio can be considered an advantage/disadvantage because the player can see more/less. If this gets really serious then forcing the aspect ratio (and adding padding as needed) could be considered a good idea.

And regarding the first post: yes, supporting multiple resolutions is always good. First because on weaker systems the user may want to reduce the resolution, and then because some users hate having to use any resolution that isn't the native one of the monitor because the stretching can make everything look horrible. Some people can tolerate that, some can't.

Also, if you do support multiple aspect ratios, don't get limited to 4:3, 16:10 and 16:9, make the game support [i]any[/i] ratio it stumbles with, because you never know what you may end up with. 1280×1024 comes to mind, which has a ratio of 5:4 (even more square than 4:3!).

Share this post


Link to post
Share on other sites
OmarShehata    205
[quote name='Sik_the_hedgehog' timestamp='1340119218' post='4950599']
I can see where he's coming from with the whole aspect ratio thing though, for some kind of games having a different aspect ratio can be considered an advantage/disadvantage because the player can see more/less. If this gets really serious then forcing the aspect ratio (and adding padding as needed) could be considered a good idea.
[/quote]

Yeah, that's what I was thinking of.

Interesting post Ashaman! It's a 2D game by the way.

I guess the only reason I was having doubts is that, no matter what language I used, the only resolution on which fullscreen worked perfectly was the monitor's native resolution, which makes sense.

I think it's cleared up now but if anyone wants to post any more info, feel free to do so!

Share this post


Link to post
Share on other sites
[quote name='OmarShehata' timestamp='1340125345' post='4950634']I think it's cleared up now but if anyone wants to post any more info, feel free to do so![/quote]
Well, if it's feasible, instead of using black borders you could use extra artwork (probably designed to tile or to blend against a single color or something) so it looks nicer. But that's really just a matter of polishing, and if you already have code for adding black borders then it shouldn't be too hard to add that. The artwork would have to change depending on what's going on at the moment though (e.g. in-game, menu, etc.).

Not really something critical, I would consider it low priority.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this