[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Best practices for creating multiple resolution 2D pixel-art games?




Hi all,

(Sorry for the long message, but I like to give them an historical context; you can jump directly to the question below if you want)

---- Historical context ----

As I told in an old thread (about 3D rendering in pygame), I started writing games/programs in a Sinclair ZX Spectrum with a fixed 256x192 screen resolution. Very simple resolution choice: just 256x192.

After that, worked on PCs where you could just select between my beloved mode 13h (MCGA 320x200x256, paletted) and VGA 640x480x16 colours (SVGA VESA modes were not really very used then).

You had really not more resolutions to select (maybe mode-x such as 320x240), so you selected just 1 resolution (for speed = 320x200, for detail = 640x480) and you created your game according to this resolution. Very simple: you draw sprites and menues and backgrounds and position them with that resolution in your mind, and everything fits.

After that, it came a lot of years where the maximum system resolution for PCs was 1024x768 and you could create a game in either 640x480, 800x600 or 1024x768 (tipycally, 640x480) and it looked "good" in that display, either windowed or fullscreen. But, again, for 2D games, you usually selected and used a single resolution.

---- End historical context ----

And the question:

I have problems to determine the best way to "create" game graphics and to "design" the game engine to allow the player to change the game resolution, or just to fit my game in the "available display".

Nowadays you have a very large variety of possible displays: from simple PC's with 17" 1024x768 to 22.5" FullHD monitors, to tablets that range from 640x400 to 1280x800, not forgetting that the displays can be either 4:3, or 16:9, or 16:10...

Selecting a concrete resolution (640x480 or 800x600 typically) can annoy the user because it can be too small in window mode or too "big" (low-res, really) in fullscreen mode... so I think that we need to adapt the game in real time to the resolution that the user wants to use. Very easy in 3D games, but ... not in 2D games.

So, my doubts:

- Game graphics (pixel-art, not vector or 3d graphics): What's the best way to create the graphics? Do them "high-res", try to ask always for the highest resolution and downscale if not (losing quality)? Do them "mid-res" and upscale / downscale depending on the resolution? Create them in 2 or 3 different sizes to minimize quality losing in scaling?

- Game engine: when creating the scoreboard, menues, inventories, position items in the screen, define sprite-speeds ... should I use "percentages" instead of pixels? ( % ). Should I, instead, work in a "base resolution" (640x480) and scale all (pixel-speed for sprites, on-screen text and scoreboards positions, etc) according to the relation base-resolution / real-resolution? And what about the ratio (16:9 <-> 4:3) change (it's not just an "scaling" problem)?

 How do you think I should be handling all this?

--
Santiago Romero
Ubuntu GNU/Linux
http://www.sromero.org