Solving the Resolution Dilemma

Klogg

Well-known member
Joined
Oct 7, 2003
Messages
104
I was just wondering how I would go about programming a game that would work in both 800 x 600 and 1024 x 768 resolutions. Would you just have the program determine what the computers resulotion is and then set the measurements of the program accordingly? Is there an easy way of adjusting the game to run in another resolution, or do you have to put a lot of work into it? I dont really have a specific game that Im working on that Im asking about, but I was just wondering what you guys think about this so I can use it in the future. If it would take a lot of work, though, I may just stick with 1024 x 768 and apologize to people with other resolutions. :)
 
It would depend on the type of 2D game - there are a LOT of things to consider.

At the simplest you could define your artwork (textures, basically) to work at the lowest resolution: 800x600 in your case. If they want the screen bigger, do one of two things: add extra space around the edge or scale up your textures automatically. With the first solution, you might end up with really small objects. With the second solution, you might get unreadable textures (or just ugly).

For some games you may even want to lock them into a particular resolution to prevent the problems above. I think the original Diablo did that. Many card games do this as well.

If your textures are (or can be) created as vector graphics, then scaling is no problem. A vector graphic is one that is defined entirely through formulas to recreate the "texture" on the fly. Drawing things with lines, circles, filled rectangles, etc. A game like Asteroids could, conceivably, be done like this. Its probably not a suitable option as most decent games need *some* kind of pre-rendered graphics.

Other options might be creating all your 2D graphics in 2 or 3 scales. Say youre writing Majong and you draw everything to fit at 800x600. Your pieces may be 32x48 pixels. When you move to 1024x768 and you scale up, you may get some really ugly graphics. So you recreate all your graphics as 48x64. When you start the game, you pick one of these two "tilesets". If they want somthing bigger, maybe 1280x1024, you could pick either set and scale them up or just leave some "whitespace" on the edges.

Other options are to create LARGE textures and do everything in 3D even though you render as 2D. Hopefully the large textures, with some good mipmaps (smaller versions of the large texture), would scale well at lower resolutions.

Id definitely pick your game FIRST, then try and figure out how best to implement it. I would strongly advise against developing some kind of reusable engine to create a slew of 2D games, as youre likely to spend the majority of time on the engine and not get your game done.

-ner
 
Thanks for the explanation. I think Ill just go with one resolution for now, though. It looks like it would be more work than I would want to do. In addition to what you were talking about, I would have to figure out how many pixels per frame to move the objects so they go at the same speed for both resolutions, which probably wouldnt be fun to do. I dont know, I might try it sometime, but for now I wont worry about it.

And while were on the topic, you should go to my web site and download Bug Zappers, a game that I made. It only displays properly in 1024 x 768, though, so sorry if you have a different resolution. :) You should check out my other programs while youre there, too.
 
Back
Top