Domanda

I have been developing a 2D side-scrolling platformer for a while now. This is my first proper game, and it is almost finished. I haven't given much thought about resolutions until now.

My game is tile-based, most tiles and the player sprite are .PNG-files with dimensions of 40x40 pixels. The default screen height and width are 1280x720. Most games nowadays, to my knowledge, have lots of different resolution choices with different aspect ratios.

I would want to give the player couple choices of resolutions, like 800x600, 1024x768 and 1280x720. This needs to be done so the player can see equal amount of tiles in the game, whichever the resolution is, to not give unfair advantages or disadvantages to using a resolution. How would be the best way to achieve this?

I have thought about scaling the sprites of the game according to a given resolution, using

self.image = pygame.transform.scale(self.image, (30, 30))
self.image = pygame.transform.smoothscale(self.image, (30, 30))

This means that the sprites are scaled down, with 30x30 px. being the target dimensions. I got them working properly, but the problem with both are the loss of quality. Less with pygame.transform.smoothscale, but still noticeable enough to my eyes.

This makes me wonder, is the best way to approach this really be making new art assets of the same files, but with different dimensions? It seems like a lot of work, more so when you have multiple choices of resolutions. I also thought about making a default screen resolution, sticking with it and not let the player choose any. But I rather not do that.

È stato utile?

Soluzione

Most games nowadays, to my knowledge, have lots of different resolution choices with different aspect ratios

But bear in mind that most games nowadays aren't based on 576 tiles! It's a lot easier to rescale things when you aren't working with static art assets.

Think about this; if you've developed your (square) assets for a 16:9 format monitor (1280x720), should the tiles be rectangular (and the characters thinner) on a 4:3 format monitor (e.g. 1024x768)? Simply scaling in this way will give you an odd-looking game. And as you say, creating a range of art assets will be an enormous job, given how many "common" resolutions there are.

I would recommend you concentrate on making the game look good in a base resolution that will fit within most other common resolutions (e.g. 800x600) and occupy any spare screen real estate with black if not running windowed. You won't be using the whole screen, but players will concentrate on the bit you are using if the gameplay's good!

If you really do want to support multiple resolutions, I would pick one aspect ratio, and definitely create separate assets for each size; as you've already noticed, simply scaling from e.g. 40x40 to 30x30 doesn't look very good.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top