GameMaker Support 720p and 1080p in GMS2

JeanSwamp

Member
Hello Game Makers!

I've been reading a lot and found a few methods and tutorials on how to support multiple resolutions in GameMaker. Sadly most of them are aimed to GMS1.

With the new cameras in GMS2 most of the stuff is outdated and I wonder how do you guys give support to 720p for a pixel art game with a native resolution that scales to 1080p

My native resolution is 480x270 which scales perfect to 1080 but 720p is a whole mess.

Currently what I do to scale up my game is just set the window size to the desired resolutions I want to support. I set the viewport on the GM IDE and I set the camera position with camera_set_view_pos.

I know Pixelated Pope has a great serious that covers that, but is mainly aimed for GMS1.

Also, any idea how does the Nintendo Switch change the resolution from docked to undocked?

Any help is greatly appreciated it.
 

rIKmAN

Member
Shameless bump, hopefully someone can throw some light in?

Thanks
Popes videos were aimed at 1.4, but the last video in the series updates the previous ones for use with GMS2, including a camera video (although this may be contained in the same video - can't remember off hand).

With regards to the Switch changing from 720p to 1080p and pixel art games not ending up with artifacts / screen crawling, I would assume that the base resolution of the pixel art games that would be affected are one which scale 1:1 to both resolutions in whole factors.

640x360 for example will scale perfectly to 720p, 1080p and 4k (1280x720, 1920x1080 and 3840x2160 respectively).

If that isn't the case then it's possible they scale perfectly to 1080p and when downscaled to 720p undocked it isn't as noticeable on the smaller high density screen of the Switch as it would be on a regular large PC screen - though without testing how badly scaled pixel art looks on a Switch it's just an educated guess.
 

JeanSwamp

Member
Popes videos were aimed at 1.4, but the last video in the series updates the previous ones for use with GMS2, including a camera video (although this may be contained in the same video - can't remember off hand).
I've seen the videos but I haven't seen the one you mention about GMS2, just the Camera ones, which doesn't cover it.

With regards to the Switch changing from 720p to 1080p and pixel art games not ending up with artifacts / screen crawling, I would assume that the base resolution of the pixel art games that would be affected are one which scale 1:1 to both resolutions in whole factors.

640x360 for example will scale perfectly to 720p, 1080p and 4k (1280x720, 1920x1080 and 3840x2160 respectively).

If that isn't the case then it's possible they scale perfectly to 1080p and when downscaled to 720p undocked it isn't as noticeable on the smaller high density screen of the Switch as it would be on a regular large PC screen - though without testing how badly scaled pixel art looks on a Switch it's just an educated guess.
Hyper Light Drifer, Axion Verge, both runs at a native of 270p and they have ports to the Switch. Funny, the Steam version doesn't even have a window size scaling, just a one-size window.
 

rIKmAN

Member
I've seen the videos but I haven't seen the one you mention about GMS2, just the Camera ones, which doesn't cover it.
Hmm maybe there was only the camera one and I misremembered then, although merging the concepts from both videos should allow you to use the 1.4 tutorials in GMS2 as other than the camera system (which is in that extra video) it should largely be the same process.
Hyper Light Drifer, Axion Verge, both runs at a native of 270p and they have ports to the Switch. Funny, the Steam version doesn't even have a window size scaling, just a one-size window.
I haven't researched any of the other pixel art games, it just seems logical that if the game is scaling between 720p and 1080p perfectly that the base res would be one which allows this scaling to be done in whole integer factors.

If you know different then anything I say would just be speculating on methods that may have been used to achieve it.
Maybe get in touch with Juju on here / Twitter / Discord and see if he would be kind enough to possibly fill in the blanks regarding how HLD did it?
 
Last edited:

NightFrost

Member
Hearing how HLD does it would be interesting. By what I've gathered looking at it (PC version), I'm pretty sure it draws everything upscaled to an app surface sized by integer multiple of the base resolution. I also seem to recall it enforces 16:9 through black bars if necessary. Both of these most likely happen because the hidden stuff all around has been measured to that aspect ratio and base resolution, and because maps haven't been drawn beyond that base sight distance.
 
Hyper Light Drifter runs at 480x270. It gets scaled up to 720p/1080p, likely via Application Surface or some other kind of surface. Here is a screenshot of native res HLD:
hld_native.png
 

NightFrost

Member
Hyper Light Drifter runs at 480x270. It gets scaled up to 720p/1080p, likely via Application Surface or some other kind of surface.
However if it was just a direct upscale from a 270p, there would be no partial pixels. Looking at this image, we can see the screenshot is 1080p and pixels are 4x4, but the left and right edge pixels are only 2 wide because they are only partially visible.
 
However if it was just a direct upscale from a 270p, there would be no partial pixels. Looking at this image, we can see the screenshot is 1080p and pixels are 4x4, but the left and right edge pixels are only 2 wide because they are only partially visible.
Yep. I assume that is why the creator decided to place a 1x1 black border around the entire screen. It masks the partial pixels. Very smart move.

EDIT: Sorry, misread your comment. I think you're right, HLD does something really weird with upscaling. All the screenshots I'm seeing of the game are 1912x1072. I think the main thing that shows is you really don't need 100% perfect scaling when you're upscaling from such a low res. My games have been 320x180 or 640x360 for a while, just so I don't have to deal with this mess.
 
Last edited:

JeanSwamp

Member
Like I mention, is very weird because the PC version does not even support window resize/scaling, neither does Axion Verge that runs the same native resolution.

I did ask Juju and he does not know, also asked Alex and Tom but sadly got no answer. I'm kinda stressed about this issue
 

rIKmAN

Member
Like I mention, is very weird because the PC version does not even support window resize/scaling, neither does Axion Verge that runs the same native resolution.

I did ask Juju and he does not know, also asked Alex and Tom but sadly got no answer. I'm kinda stressed about this issue
Could they be scaling to a surface larger than the screen size (to retain 1:1 scaling) and then manually drawing the surface centred so that the outside edges aren't shown and some of it is cutoff?

You could do a quick test by looking at the "visible" play area at the edges before and after scaling up and seeing if anything is cutoff.
 

JeanSwamp

Member
Could they be scaling to a surface larger than the screen size (to retain 1:1 scaling) and then manually drawing the surface centred so that the outside edges aren't shown and some of it is cutoff?

You could do a quick test by looking at the "visible" play area at the edges before and after scaling up and seeing if anything is cutoff.
I believe they show the same amount of screen on both versions
 
Top