8
\$\begingroup\$

After several very small games I have decided to make something more standalone (2D) and playable. However, I have met the problem of every game that is going to be played in more screen resolutions.

Basically, after some research I see that there are several solutions.

This seems to be the simplest one: Let's say I define a constant aspect ratio for the game (16:9) and the whole game will be created for a resolution 1680 x 1050.

The game will be rendered in this resolution and then I will be able to scale the render to match the player's display resolution. Therefore the game might be playable on almost any resolution, while it would keep the aspect ratio. So, if the game was run on 4:3 display, the top and the bottom of the display would be filled with black color.

It seems easy, but my question is - Is this a good approach for a simple game? The game will be simple, but I want to maintain high quality.

\$\endgroup\$
3
  • \$\begingroup\$ Whether it's a good approach or not seems to be a question for you to decide. Is that the approach you want to take? Is yes then it's a good approach. If you feel like this would be simplest for you, then go for it. \$\endgroup\$
    – House
    Jun 11, 2012 at 19:47
  • \$\begingroup\$ Sure, in my project it's my responsibility to decide. I think I will use this method. However, I'm also interested in opinions of others, that's why I've asked if it is a good idea in general (although I have mentioned "my game"). \$\endgroup\$ Jun 11, 2012 at 19:54
  • 8
    \$\begingroup\$ Do you realize that 1680x1050 is not 16:9? It's 16:10. \$\endgroup\$
    – Adam
    Jun 11, 2012 at 22:44

2 Answers 2

4
\$\begingroup\$

It's a fair approach, I've seen not-so-simple games using it.

However, as your target is high quality, I advise you to support all aspect ratios properly. You don't want your players annoyed because you're using only a percentage of their pixels.

So you've got two options:

  1. If you only have a few aspect ratios to support (e.g only 4:3 and 16:9), you can cheat and use distinct sets of absolute positions and sizes for your 2D elements. One for each ratio. This might sound cheesy, but it's actually a fine solution in this situation, as option 2. is way trickier.

  2. Use a library that supports adapting 2D elements to ratio changes. You might think this is an easy task to re-create one yourself, but it's not. So if you feel like going this way, be ready to craft your library with rigor. I've seen several people falling in the trap of just-creating-a-menu-system-in-2-days. Nope. This takes way more time. Goodbye absolute placement: you need anchors, relative sizes, extra care for the safe areas, etc. That's a broad topic (and a boring one, IMHO), and that's one of the main selling points of UI middlewares such as Autodesk Scaleform.

Once you've picked up your option, always make sure you test thoroughly your layout changes with all the different aspect ratios.

PS: You're not concerned by this as you're making a 2D game, but for the record: for 3D rendering, adapting to different aspect ratios is only a change to the perspective matrix.

\$\endgroup\$
2
  • \$\begingroup\$ Are there any extra materials available for 2nd option? And is there something I could read on the subject for 3D? \$\endgroup\$ Jun 15, 2012 at 14:03
  • 2
    \$\begingroup\$ @Tom For 3D, really, that's an easy one. For instance with OpenGL/GLU, just specify the proper ratio in the aspect variable of gluPerspective. For 2D, I strongly advise to go for solution 1. or a variant, check this for more ideas. Getting 2D elements to adapt to any ratio could be another question as it's a very broad topic! \$\endgroup\$ Jun 15, 2012 at 14:10
2
\$\begingroup\$

To answer the question: yes, it is a good idea to make a game for a given aspect ratio and screen resolution.

However, it is only a good idea in certain circumstances.

Those circumstances include, but are not limited to:

  1. developing for a platform with a particular aspect ratio and screen resolution like a console where display hardware is fixed (which it does not sound like what you are doing)
  2. the game relies upon the aspect ratio for some reason that should it need to be retooled for a different aspect ratio it would somehow ruin the game play (doesn't sound like you have this either)
  3. Deliberate stylistic reasons (it doesn't sound like you are doing this either).

If your reason is "because it is hard and complex to support multiple aspect ratios", then if that is enough of a reason for you, it is your game.

\$\endgroup\$
6
  • \$\begingroup\$ I'm programming for computers/notebooks (Windows mainly). I would like the simplest solution while keeping the game quality high. Well, if the game had levels which would have fixed size (not square), that seems as a legit argument, doesn't it? \$\endgroup\$ Jun 11, 2012 at 20:09
  • 3
    \$\begingroup\$ The big three console manufacturers all require that you support at least two aspect ratios (4x3 and 16x9) and two resolutions (SD and 720p). Otherwise you'll fail certification. \$\endgroup\$
    – Crashworks
    Jun 11, 2012 at 20:10
  • \$\begingroup\$ ok... scratch number 1, then! \$\endgroup\$ Jun 12, 2012 at 12:43
  • \$\begingroup\$ I'm pretty sure at least one of the big three doesn't require you support 720p... \$\endgroup\$
    – user744
    Jun 12, 2012 at 15:30
  • \$\begingroup\$ @Joe Yet. But I bet this will change by the end of the year ;) \$\endgroup\$ Jun 12, 2012 at 17:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .