Skip to main content
GameDev.net gamedev.net
🔒 Locked

2d game resolution independence

Started by TheAverageUser May 15, 2010 at 5:51 PM 6 replies 3.3k views
Original Post
TheAverageUser
TheAverageUser
Hey there, when playing a modern 2d game, are you expecting it to be resolution-independent? If so, do you expect "true" independence as in 3d games instead of just having a bigger viewport (== you can see more)? For my current game, having a different view based on the selected resolution isn't an option as it would affect gameplay and cutscenes too much. As I'm faking a 3d perspective using an orthogonal view, I can't really guarantee true resolution independence; I'll have math just not adding up properly when playing with perspective-related "camera settings". It seems like not supporting resolution independence is my only choice, and I'm not sure whether I like it or not. I just wanted to grab some suggestions and comments on this.
pothb
pothb
Can't you just scale things or have different sets of art (though I think this is utterly ridiculous in a way since it requires so much extra space/work)
TheAverageUser
TheAverageUser
D'oh, nevermind. After some initial tests I thought, the glOrtho-Upscaling approach wouldn't work and started experimenting otherwise. I now recognized, that the initial test was screwed due to some bugs I had in there. I re-implemented Ortho-Upscaling and it now perfectly works: Resolution-independent with a constant player viewport. You only note the difference when zooming out and seeing there are still more details visible than on lower resolutions.

From my side, this thread may be closed. Sorry guys.
blackbird04217
blackbird04217
Just wondering, or to get your mind pondering; what about supporting different aspect ratios? Widescreen etc? 16:9 / 4:3 or any others for that matter. How will you take this into account? Scaling here would stretch the images, or inserting black bars, which I find annoying to have a widescreen monitor only to have black bars shoved in my face. Although, I understand sometimes there is true gameplay reasons for this, not necessarily just the challenge of getting it to work. have you thought of this issue?

Happy development!
TheAverageUser
TheAverageUser
Yes, I thought of that an experimented with those black bars you mentioned. I found that, for me, the best solution is to ignore aspect ratio and stretch the final screen image a little to fit the resolution. The only other possibility would include slightly different viewspaces depending or screen resolution and I do'nt want that - it'd screw some of the cutscenes and alter gameplay.
blackbird04217
blackbird04217
For cutscenes, bars are acceptable - almost desired in fact to let the player know it is cutscene time versus game.

As far as gameplay like I said before some games can not get away with it based on the game mechanics. But stretching isn't a good option either : / The black bars are the better option if you need to constrain the size for gameplay concerns.

In anycase, it sounds like you've got where you want and have thought of this side of things, so I'll leave it be. Good luck!
CDProp
CDProp
The way I've handled different aspect ratios in the past is to have anchor points at 9 different locations on the screen: top-left, top-center, top-right, center-left, center, center-right, bottom-left, bottom-center, bottom-right. All HUD elements are children of these anchor points and thus inherit their transforms from them.

When the screen aspect ratio changes, I move the anchor points such that they always occupy their assigned corner of the screen. Voila, the HUD elements move along with them, without the need for bars or stretching.
TheAverageUser
TheAverageUser
You've solved a different problem ;)

We were talking about resolution independence concerning the players view - which should remain statig e.g. not grow or shrink depending on how high the resolution is. The HUD doesn't matter here, it can always be drawn screen-border-relative, as you've done it :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.