M
MiniSiets
Guest
Hey everyone,
I've got a game I've been developing in GMS, and thus far everything has been going fairly smoothly for me except for one nagging issue that I can't seem to resolve. That is of course as the title suggests, I'm having difficulty getting the game to adjust to different display resolutions without the scaling causing things to look janky.
Here's some basic info about what I'm trying to achieve. This is a 2D pixel art game that is attempting to emulate a 16-bit SNES style aesthetic. As such I wanted to target an internal resolution that matches pretty closely to the SNES, but at the same time I also wanted to modernize it a little bit so that it would be 16:9 widescreen aspect ratio. Therefore I settled on a resolution of 400x225, which is 16:9 while otherwise resembling a pixel size close to the SNES' original resolution. Because of the way certain game mechanics work, the game needs to maintain a fixed aspect ratio at all times, so I'm not concerned with black bars appearing on displays that are not 16:9, and I'm not dynamically supporting them.
(Also note, my work environment right now is Win7 64-bit and GMS 1.4)
Now that we got that out of the way, here's my problem. My actual display is 1920x1080, but even though both 400x225 and 1920x1080 are 16:9 aspect ratios, 400x225 doesn't upscale evenly into 1920x1080 (1080p is 4.8 times the resolution of 400x225, not a rounded integer), which seems to cause some slight pixel distortion in full screen, which is distracting.
I do not get this problem if I set the game to windowed mode at 1600x900, as this resolution divides evenly into 400x225, so it can upscale the resolution pixel-perfect.
This led me to doing a little research on possible solutions so I could support multiple resolutions, which had me come across PixelatedPope's tutorials on creating a display manager. I tried his method, but this seems to cause movement in my game to become extremely choppy when upscaled to 1920x1080, as it seems to just stretch the 400x225 surface to my display without accounting for the fact there are a lot more in-between pixels after being stretched to 1920x1080, so during motion it just draws the object to the next nearest pixel within that stretched 400x225 space.
My next thought was to look into possibly implementing some kind of sub-pixel movement as a workaround for this, but I'm not sure how much this would complicate my code or if it would even work.
My other thought was that I could just change the resolution to something that would fit evenly into 1920x1080, like 480x270. This would certainly be doable without much reworking of my code, but other resolutions like 1280x720, 1600x900, and so on are still quite common and I would just run into the same problem with them all over again since 480x270 doesn't divide evenly into these resolutions. I feel like there should be some way to scale these pixels up with minimal distortion to support multiple screen resolutions, especially if I intend to keep a fixed aspect ratio and I'm not even concerned with dynamically supporting other stuff.
Is there any way to fix this?
I've got a game I've been developing in GMS, and thus far everything has been going fairly smoothly for me except for one nagging issue that I can't seem to resolve. That is of course as the title suggests, I'm having difficulty getting the game to adjust to different display resolutions without the scaling causing things to look janky.
Here's some basic info about what I'm trying to achieve. This is a 2D pixel art game that is attempting to emulate a 16-bit SNES style aesthetic. As such I wanted to target an internal resolution that matches pretty closely to the SNES, but at the same time I also wanted to modernize it a little bit so that it would be 16:9 widescreen aspect ratio. Therefore I settled on a resolution of 400x225, which is 16:9 while otherwise resembling a pixel size close to the SNES' original resolution. Because of the way certain game mechanics work, the game needs to maintain a fixed aspect ratio at all times, so I'm not concerned with black bars appearing on displays that are not 16:9, and I'm not dynamically supporting them.
(Also note, my work environment right now is Win7 64-bit and GMS 1.4)
Now that we got that out of the way, here's my problem. My actual display is 1920x1080, but even though both 400x225 and 1920x1080 are 16:9 aspect ratios, 400x225 doesn't upscale evenly into 1920x1080 (1080p is 4.8 times the resolution of 400x225, not a rounded integer), which seems to cause some slight pixel distortion in full screen, which is distracting.
I do not get this problem if I set the game to windowed mode at 1600x900, as this resolution divides evenly into 400x225, so it can upscale the resolution pixel-perfect.
This led me to doing a little research on possible solutions so I could support multiple resolutions, which had me come across PixelatedPope's tutorials on creating a display manager. I tried his method, but this seems to cause movement in my game to become extremely choppy when upscaled to 1920x1080, as it seems to just stretch the 400x225 surface to my display without accounting for the fact there are a lot more in-between pixels after being stretched to 1920x1080, so during motion it just draws the object to the next nearest pixel within that stretched 400x225 space.
My next thought was to look into possibly implementing some kind of sub-pixel movement as a workaround for this, but I'm not sure how much this would complicate my code or if it would even work.
My other thought was that I could just change the resolution to something that would fit evenly into 1920x1080, like 480x270. This would certainly be doable without much reworking of my code, but other resolutions like 1280x720, 1600x900, and so on are still quite common and I would just run into the same problem with them all over again since 480x270 doesn't divide evenly into these resolutions. I feel like there should be some way to scale these pixels up with minimal distortion to support multiple screen resolutions, especially if I intend to keep a fixed aspect ratio and I'm not even concerned with dynamically supporting other stuff.
Is there any way to fix this?
Last edited by a moderator: