Search code examples
androidlibgdx

Should I make different spritesheets for different resolutions


Im designing a game for android, I have my assets in low resolution that looks fine in small screens, if the game runs in a bigger screen it comes out pixelated, should I make different spritesheets for different resolutions or just one in HD and then reduce the images according to resolution? the second one sounds better but Im worried if all the scaling would take its toll on performance


Solution

  • I do use several SpriteSheets with different resolutions on LibGDX, here is why :

    When you have to support devices with screen resolution ranging from 320*480 to 2560*1400 (And maybe up to 4K in a few years), it's almost impossible to have a perfect result on all these screens with an unique spritesheet resolution. If you use a virtual screen resolution (viewport), you may work on a single resolution and create assets accordingly and let this viewport automatically scale to the screen, so that your game will look the same on any device.

    So, one may argue that a single HD spritesheet may be enough. However, most low-cost or old mobile devices are sometimes unable to load high resolution textures, so you may lose support for these devices if you only use HD graphics. What's more, downscaling assets programmatically often lead to poor and unpredictable graphics results in my own experience.

    So personnaly, here is what i do :

    • I check the screen resolution and the max size of texture the device can load.
    • Using these values, i choose a viewport size and a spritesheet size choosing from spritesheet resolutions i pre-defined. (Low, medium or high resolution)

    To help resolving assets according to the screen resolution, libgdx provide the ResolutionFileResolver class.

    However, you should also read : https://gamedev.stackexchange.com/questions/24638/resolution-independence-in-libgdx