I'm confused over supporting multiple resolutions in my 2D game.

I'm currently working with a reference resolution of 1280x720. That means that all elements are positioned in a 1280x720 coordinate system which I scale up/down to the actual resolution using glScale. My graphic assets are all pixel graphics, so it also means I need to save them relative to this reference resolution.

Now the artist sent me some files in a pretty high resolution and I scaled them all down to match the reference resolution, but I noticed that the positions of the graphics relative to each other are slightly off. Probably because there was some rounding involved in the down scaling.

Should I increase my reference resolution to match the artwork? Or should I ask the artist to scale everything down and make sure the positions aren't off as a result? Should my reference resolution be larger anyway? (2880x2304 is what I came up with to support all modern screen resolutions and aspect ratios down to 5:4, but that seems awfully large.)

How is this commonly being tackled?

Edit: Sorry, forgot to provide some relevant background: My game is a simulation game, that is essentially a UI. So there is no such thing as a world space, I'm just positioning widgets on the screen.


Since you have the choice, I'd recommend you do the proper thing: make it resolution independent.

There are two factors to consider here, not just one. There's both the physical size and resolution (often conflated when calling a screen size in pixels a "resolution"). For high or low resolution screens, the same number of pixels can vary wildly in actual physical size (compare an ancient monitor running at 800x600 and Apple's "Retina"-branded displays).

In order to accomodate these, you should really be thinking in terms of physical size, and use a device independent coordinate space based on millimeters or inches instead. Make your UI flexible enough to accomodate all screen sizes and aspect ratios.

Use your source artwork at the resolution provided by your artists to get the most out of the detail, and make it gorgeous on high resolution displays now and in the future. As a performance improvement, you could rescale it to the target resolution at load time.

The main problem with having a very flexible device independent coordinate space is snapping graphics on a tile to make them seamlessly line up. Depending on the artwork I'd suggest either to (a) use floating point everywhere and have ultra-smooth motion, or (b) snap image sizes and positions to be pixel aligned to line up without seams but possibly suffer from jitter in motion.

  • \$\begingroup\$ I guess I should have provided more info, but it's a simulation game which is essentially just a GUI. That means I don't really have a "world space", I just position things on the screen. Is working with millimeters recommendable in that case? \$\endgroup\$ – futlib Apr 15 '13 at 9:28
  • \$\begingroup\$ Working with pixel dimensions is never a good idea if you care about scalability and supporting a wide variety of resolutions. The days of a 15" 640x480 screen being the gold standard are long gone. \$\endgroup\$ – ccxvii Apr 15 '13 at 9:59
  • \$\begingroup\$ Well, my pixels are in fact virtual, as I have the reference resolution. So I suppose I should use a fairly large reference resolution? I'm already using float for pixel positions because I ran into tons of rounding issues with ints. \$\endgroup\$ – futlib Apr 15 '13 at 10:27
  • \$\begingroup\$ Then your "reference resolution" is your device independent coordinate space. So from your question above, you're really asking for how to consistently scale your artwork to maintain relative sizes and positions? \$\endgroup\$ – ccxvii Apr 15 '13 at 10:50
  • \$\begingroup\$ My question isn't very well formulated, as I'm still a bit confused. But it's basically: Should I scale my artwork to match the reference resolution, or should I use it as-is and scale it at runtime (using OpenGL)? And as a second question: Should my reference resolution be larger? I suppose if me and the artist agree on a reference resolution, there shouldn't be any positioning issues. \$\endgroup\$ – futlib Apr 15 '13 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.