GameProgramming:MultipleResolutions
lastmod 2022-03-23created 2022-03-188 edits
A record of trial and error in supporting multiple resolutions in games
For 2D pixel games, there are terms like Pixel Perfect, which means getting the aspect ratio exactly right.
Short summary
- Use a resolution of 1920×1080.
The problem of multiple resolutions
Developers often have trouble understanding how to best support multiple resolutions in their games. For desktop and console games, this is more or less straightforward, as most screen aspect ratios are 16:9 and resolutions are standard (720p, 1080p, 1440p, 4K, etc.).
For mobile games, at first, it was easy. For many years, the iPhone and iPad used the same resolution. When Retina was implemented, the pixel density doubled. Most developers had to supply assets in default and double resolutions.
Nowadays, this is no longer the case, as there are many different screen sizes, densities, and aspect ratios. Non-conventional sizes are also becoming increasingly popular, such as ultrawide displays.
For 3D games, there is not much of a need to support multiple resolutions (from the aesthetic point of view). The 3D geometry will just fill the screen based on the field of view, disregarding the aspect ratio. The main reason one may want to support this, in this case, is for performance reasons (running in lower resolution to increase frames per second).
For 2D and game UIs, this is a different matter, as art needs to be created using specific pixel sizes in software such as Photoshop, GIMP or Krita.
Since layouts, aspect ratios, resolutions, and pixel densities can change so much, it is no longer possible to design UIs for every specific screen. Another method must be used.
One size fits all
The most common approach is to use a single base resolution and then fit it to everything else.
This resolution is how most players are expected to play the game (given their hardware). For mobile, Google has useful stats online, and for desktop, Steam also provides them.
As an example, Steam shows that the most common primary display resolution is 1920×1080, so a sensible approach is to develop a game for this resolution, then handle scaling for different sizes and aspect ratios.
Godot provides several useful tools to do this easily.
Godot
See Godot:MultipleResolutions. There is a lot of good reference material.