Follow me!

Search Posts

Search for:

Scaling up my game 4x without resizing a single sprite (GM:S 1.4)

So I was developing a low res game (480 x 270) in GameMaker: Studio 1.4. The moment comes when I need to test it on mobile. I create my APK, load it up on the phone and there it is... a horrible mess of graphic artifacts!

The camera movement was all jittery, the zoom effect made all the tiles look funny and overall it just felt wrong.

The problem was obviously the very low resolution of the game. The camera (the view), along with every other object in the game, can move only by whole "game pixels". That means that if you divide the actual display resolution by the game resolution (480 horizontal pixels in my case) you get the minimum "screen pixels" that any object can be moved/re-drawn. No in-between values are possible.

This is actually hi-res. Just scaled up 4x (background still old-size) - 1 game pixel is now 1 view pixel. But sprites are 4x bigger so they look low-res (fake it).

On a 1920 pixels wide screen, that's 4 "screen pixels" per "game pixel". So the camera (along with every other objects) can move only by 4 screen pixels at once and no less. This means jittery movement.

Since I wanted the camera to be able to move at least 1/4th of a game pixel, I had to upscale the whole game by a factor of 4... I had to go Full HD to keep my low res game enjoyable.

That meant resizing 175 sprites, move their origins, check their collision masks, resize the tilesets and backgrounds, adjust the speeds, re-make the whole levels and probably fix other bugs... unless...

I also increased the view size by 4 (and resized the application surface accordingly) so the objects in the game looked exactly like before (size-wise). Now everything is 4 times bigger.

View and Application SurfaceMy application surface (and the view) have a 1080 pixels vertical resolution. The horizontal resolution is dynamically calculated based on the monitor aspect ratio. The application surface is then manually drawn stretched to the display in the post-draw event (i.e. this game looks just as good on a 4:3 monitor than it does on a 16:9 one).

I still have to resize any in-game created instance and modify the speeds of some of my objects... but at least I didn't have to resize 175 sprites. Now the camera moves and zooms smoothly. Everything can move 1/4th of a game pixel without looking jittery.