• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Proper Fullscreen

Rikifive

Member
Hello there,

I'm struggling with the game resolution and its fullscreen mode. Handling the resolution itself seems to be more complex than it should be.

Anyway, getting to the point.
Let's say, that if we'd have the game resolution set to 960x540 and have the fullscreen mode enabled, it should generate a screenshot with these dimensions, which would be pixel-perfect, but kinda blurry. In GMS however, it scales just the game itself- not even scales, but stretches it. As a result, when we enter the fullscreen mode, there are misshapen objects all over the place. When we take a screenshot, we get the same result - the game screen stretched to dimensions of our display resolution. It multiplies the pixels, but not perfectly- It gives a weird effect of double-pixels every x pixels. It looks like this:


That's why I wanted to ask you for instructions and perhaps tips related to resolution management.

My target platform is mainly Windows (and probably some other OS's for DESKTOP if possible), but mobile devices are a nope, as my game will be simply not designed for these.

Soo... How do I configure the fullscreen mode properly?
Also if you have any tips on resolution management, that would help me avoid getting problems in the future, I'd really appreciate these.
Thank you in advance.

Edit: Updated post.
 
Last edited:

Mick

Member
There are some guides for doing proper scaling here on the GMC, these two to be exact:

https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/
https://forum.yoyogames.com/index.p...d-aspect-ratio-management-for-gms1-gms2.7106/

But basically you can't scale pixel graphics to cover the full screen on all screens, you need to scale your view or room by an integer (2,3,4,5 etc.), centering your game using the highest possible scale. Your resolution of 768x432 is an odd one but maybe it's too late to change it now. I prefer to use an aspect ratio of 16:9 since it's common (which you also use already), good resolutions are 320x180 and 640x360, these will scale perfectly to both 1080p and 720p screens.
 

TrunX

Member
Without (completely) reading the linked tutorials.
Wouldn't it be possible to scale it pixelperfect to the biggest possible integer and afterwards scale it to fullscreen with bilinear filtering?
This would result in a (barely noticible?) unsharpness but the pixels will all have the same size. This is atleast my plan for Catboy but I haven't tried it out yet and in the end I want to let the players decide the scaling method in the options menu.
 

Mick

Member
Without (completely) reading the linked tutorials.
Wouldn't it be possible to scale it pixelperfect to the biggest possible integer and afterwards scale it to fullscreen with bilinear filtering?
This would result in a (barely noticible?) unsharpness but the pixels will all have the same size. This is atleast my plan for Catboy but I haven't tried it out yet and in the end I want to let the players decide the scaling method in the options menu.
I don't think that method would look good, but please prove me wrong! Letting people decide if they want perfect scaling or stretched full screen is a good "solution" though.
 

TrunX

Member
I tried it out in photoshop very quickly.
My game resolution is 480*270 so it doesn't scale well for 720p. The source picture has this fence in the background that would make uneven pixels very visible.

See the ugly uneven pixels in the non-interpolated screenshot?
The bilinear interpolation is to blurry for my taste. My suggested method seems to be a good compromise if you want to play fullscreen with unfitting resolution. And I expect the blur to become even less if you play it on a higher resolution like 1440p.

One thing I don't know: Is the build in interpolation method in GM similar to bilinear filtering in PS? I expect it because it seems to be the most trivial interpolation.
 
Last edited:

Rikifive

Member
It's not too late for changes~
I admit I originally planned to work with 768x432 (16:9)(Divisible by 8), but if there are better choices, I wouldn't mind working with another one. However, 640x360 may not be enough, while 720p may be actually too much. Besides, many people may have even different resolutions or even with different aspect ratios (my old monitor had 1440x900, for example), so that will not solve the problem completely I'm afraid.. Though that's true it would be best to focus on making it work with common resolutions as 1920x1080.

The idea TrunX has proposed sounds interesting. I wouldn't mind getting things slightly blurry, as long as that would look acceptable.

Either way, wouldn't that still be a fake fullscreen? When the game resolution is set to specific size, then making a screenshot should give the image with these dimensions, right? GMS however, gives an image to whatever size it gets scaled to, which gives bad results. Like in TrunX's example, it gets slightly blurry, but it's not noticeable that much in game (?), but making a screenshot would reveal the side-effect. -- But that's not that important I suppose.

Oh this gets complex. I've read and watched the tuts, but I'm still not sure what to do.
 

TrunX

Member
Most modern games dont change the screen resolution any more, thats why the screenshot has the same resolution as your screen. If you change the screen resolution you lose control over how the game gets stretched and interpolated. Some monitors have settings for this others just stretch it blurry or have black border around it. The graphic card driver has also options for it.

If 360p is to less and 720p to much try out 540p. Thats not ideal for 720p and 1440p screens but it will be pixel perfect on FullHD and 4k Screens (which should be more common than the former ones)
 

Rikifive

Member
Hmm.. That's true..
540p? I may give it a try and see how that would fit my game. If 720p would be preferred, then I think I could adjust sprites to fit that one. Higher resolution would have its pros after all... By the way, I'm not using double-pixels (yet)- everything has original size.
-- and what would be next? Should I configure stuff (app surface etc.) via code upon initialization? How to deal with that properly?
 

TrunX

Member
Right now I'm just working with the view settings (Port on screen double the size as view in room) for my pixel art game. Thats nice when testing in windowed mode nad I don't mind the unperfect scaling in full screen (no interpolation) for now. The long term solution should be to draw the application surface in its native resolution and then scale it the way you like. Otherwise GM does strange things like drawing sprites between two pixels. (Who came up with this standard behaviour?)
 

Rikifive

Member
Hmm.. and I really thought I'm just not smart enough, but it seems, that it's a legit issue. That kind of stuff should be configurable in settings or something like this, rather than having to come up with workarounds to overwrite the default behavior.

Either way your custom method seems to look acceptable (I don't mind imperfect scaling either). The previous software I used had non-configurable 640x480 (4:3) resolution and it looked perfect on my old monitor 1440x900, while it looked slightly worse on current 1080p due to slightly blurry result, yet it was acceptable. Still better than stretched, mutated pixels.
 

TrunX

Member
Rikifive, yes I think such things should be configurable in the IDE but GM was always less about user-friendlieness and more about "you have all the tools you need, do it yourself". :D
 

Mick

Member
The bilinear interpolation is to blurry for my taste. My suggested method seems to be a good compromise if you want to play fullscreen with unfitting resolution. And I expect the blur to become even less if you play it on a higher resolution like 1440p.

One thing I don't know: Is the build in interpolation method in GM similar to bilinear filtering in PS? I expect it because it seems to be the most trivial interpolation.
Your method doesn't look too bad to be honest. :) GM uses linear interpolation (or does it have to be bilinear for 2D?) but you can probably find a shader that gives you a better result.

From Wikipedia: "In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables (e.g., x and y) on a rectilinear 2D grid. The key idea is to perform linear interpolation first in one direction, and then again in the other direction."
 
Last edited:

Mick

Member
I had to do a proper test of the different methods talked about here. I set up the project to use full scale in full screen, when full screen is toggled, the GUI is resized to cover the whole display or window. Automatic drawing of the application_surface is disabled and handled manually in the Draw GUI event. These are the drawing modes:

Pixel Perfect: application_surface drawn scaled up to max possible whole number
Nearest Neighbour: application_surface scaled up to cover all display (keeping aspect ratio)
Interpolation: application_surface scaled up to cover all display with interpolation enabled
Optimised Interpolation: application_surface is drawn to a surface scaled up to max possible whole number, the surface is then drawn to screen using interpolation
Shader: application_surface drawn scaled up to cover all display using a shader

Press F4 ot Alt+Enter to toggle full screen, arrow keys left and right to change draw mode in full screen. Optimised interpolation (like @TrunX suggested) looks almost exactly the same as the shader, the shader is more efficient because no extra surface is needed, the application_surface is drawn directly to the screen scaled.

http://www.gamephase.net/files/linked/PixelScaler.exe
 

TrunX

Member
Thanks for trying it out in the field.
Unfortunately I have only a black screen when switching to full screen. Even when pressing Left and Right.
 

TrunX

Member
At first the new version had the same problem. But then I tried out changing the options.ini and set AlternateSyncMethod to 1 and it worked.
Thats strange because my own games have also AlternateSyncMethod at 0.

I have Windows 10 1680*1050 resolution with an AMD RX580 GPU

It's also interesting to see how close the shader and my suggested method look like. What exactly does the shader do? The same thing like I suggested just in shader code or something completly different resulting in a nearly identical result?
 

Mick

Member
At first the new version had the same problem. But then I tried out changing the options.ini and set AlternateSyncMethod to 1 and it worked.
Thats strange because my own games have also AlternateSyncMethod at 0.
This is interesting and a bit troubling. The test project only have one instance in the room that disables automatic drawing of the application_surface and handles the drawing. The background of the room is set to the Metroid image. Vsync isn't even enabled. I use version 1.4.1772 of GMS.

EDIT: This is a bug with a Windows 10 update it seems. The "fix" is to enable vsync or use tje alernative sync method. Read the following thread, good to know before releasing games: https://forum.yoyogames.com/index.php?threads/solved-pitch-black-screen-in-fullscreen-mode.27263/

It's also interesting to see how close the shader and my suggested method look like. What exactly does the shader do? The same thing like I suggested just in shader code or something completly different resulting in a nearly identical result?
The shader is the one I found on allegro.cc (link above). I didn't analyse it too much but it's probably doing about the same thing. I guess it's ideal to use the shader if it is compiled on the target machine, otherwise use the optimised interpolation method.
 
Last edited:

TrunX

Member
@Mick: Would you mind sharing the source for the different scaling methods? Might save me (and others) 20 minutes of work when implementing such options into their game :)
 

TrunX

Member
Pixel art games can't look pro if there's any visible blur or graphical deformation due to scaling.
Well as far as I remember the classics didn't look very sharp on old CRTs and they were also not rendered in the native resolution of these screens.
Of course stretching a low resolution pixel art game with linear filtering does look horrible, but I don't see a problem in a very slight blur that you only notice when sitting very close to the monitor or zooming in with a graphic program to avoid pixel deformation. In fact I prefer this over having a black border around your game (especially for a console game where you sit several meters away from your TV on your couch).

Nevertheless I definitely would implement the settings in the option menu so everyone can choose what he prefers.
 

RangerX

Member
Well as far as I remember the classics didn't look very sharp on old CRTs and they were also not rendered in the native resolution of these screens.
Of course stretching a low resolution pixel art game with linear filtering does look horrible, but I don't see a problem in a very slight blur that you only notice when sitting very close to the monitor or zooming in with a graphic program to avoid pixel deformation. In fact I prefer this over having a black border around your game (especially for a console game where you sit several meters away from your TV on your couch).

Nevertheless I definitely would implement the settings in the option menu so everyone can choose what he prefers.
In CRTs time having a slight blur or deformation wasn't a big deal 'cause you couldn't see it. Problem is that nowadays we can see it. :p
Having a very very subtle and slight blur (like your last screenshot I guess) can be tolerated. I however prefer black bars over the slighliest stretch or deformation though.
 

Rikifive

Member
I don't think games have done that since the 1700s...
They haven't? I agree it's rarer nowadays, but there were many games like this in WinXP days. For a little moment it was possible to notice how the desktop resolution changes (huge icons etc.)- or how it tended to stay like this when the game crashed and didn't bring back the default settings. I think I've seen that nowadays as well. I may be mistaking though.

Pixel art games can't look pro if there's any visible blur or graphical deformation due to scaling.
NES games on old TV's didn't look pro, but they were great. ;)


[hr]
I see some science is happening there, yet I'm still not sure what to do. :p
I guess I'll try few things and see how it goes.
 

RangerX

Member
NES games on old TV's didn't look pro, but they were great. ;)
In the NES days game weren't made with deformed and stretched graphics either. Proof of that is playing them again nowadays thanks to emulation or again, those plenty of authentic re-releases.
I also seperate what the game is and what were the consequence of our equipments in the 80s, like tubes. This was giving a litttle coat of blurry and and deformation to games... but it wasn't the games still.

On the side, there was quite a few amateur games on the NES. Most of them just aren't good like the ones everybody knows but the industry was surprisingly approachable in its young days. A bunch of basement dwellers could have their go.
Funny that today, after years and years of this industry being pretty "close", its now like the easiest time for an amateur to make a game for the world. :)
 

TrunX

Member
I'm not sure how the NES handled it but the SNES had an narrower aspect ratio for the internal render resolution than a 4:3 TV and the graphic artists had to consider that their graphics will be stretched horizontally when displayed on a TV: So they pixeled all character taller than they really are. (Some games didn't consider it. When playing these games in an Emulator round objects like Balls are perfectly round with the original resolution but slightly stretched in 4:3)

This seems to become an off-topic discussion about good old times :D
But just another point that rendering some classics pixel perfect results in a "wrong" aspect ratio. So if you want to play them as they were intended to played you need some sort of stretching and filtering to avoid uneven pixels.
 

RangerX

Member
This was only the PAL region games that had this wierd size. Rest of the world was NTSC 480x320 (240x320 with scanlines)
 

Yal

🐧 *penguin noises*
GMC Elder
I know a bunch of people that can't even play a game in fullscreen mode because it crashes (might be related to weird multi-monitor setups and stuff) so having windowed mode and try to maximize an integer scale so the game covers as much screen space as possible without poking outside the screen seems like the best bet. I also personally try to play a lot of games in windowed mode with some space left over for a chat client, so having the scale be configurable is nice. Guesstimate the default scale based on screen size the first thing you do, then let the player change it if they don't like it.

(Also, side note: players appreciate if the Options menu is immediately visible on the first screen of the game. Lots of people start a new game off by checking the options, especially controller settings)
 

TrunX

Member
This was only the PAL region games that had this wierd size. Rest of the world was NTSC 480x320 (240x320 with scanlines)
No, the PAL Format had a slightly higher vertical resolution resulting in small black bars in unoptimized games, but in both regions TVs had 4:3 screens while the internal render resolution of the SNES is 8:7 (Nearly quadratic)

@Yal: Agree that games should have the options available to switch to windowed mode and also change the size of the window but I'm not sure if I want windows mode to be the default situation. I Think most players will prefer switching it to fullscreen.
 

Rikifive

Member
In the NES days game weren't made with deformed and stretched graphics either.
Yep, yep, I know that. I had the end-look in mind- what we saw on TV, that is. I know the games themselves were pixel perfect, but thanks to (now) old hardware, it was getting kind of blurry and sometimes the colors were warmer. I'm not sure how about the original NES, but in Poland we had a NES console called "Pegasus", which combined with old-type TV's, it was giving the effects I've mentioned. To be honest it was so nicely blurred, that I wouldn't even really call it blurry- the pixels were really nicely working together. That actually was a pretty nice effect, way better than having deformed objects thanks to uneven pixels. :p

Of course I plan to give the players the options to switch between windowed/fullscreen and change the resolution ~ in both, the title screen and in-game options menus. ...Once I'll figure out how to handle that kind of stuff, that is. (I mean, proper scaling and stuff) :D
 

Rikifive

Member
I've got busy for a while and my PC had a failure at the top of that (motherboard died; just built a new PC) - Now that I have caught up with some things and have everything back, I'd like to revive this discussion (does that count as necro here? I was thinking, that making exactly the same thread would be pretty much pointless) to start making some progress with the game. - or rather get more information to be sure, that I'm going in the right direction.

So I've did some tests having your suggestions in mind and I think, that 960x540 resolution would be okay. It obviously scales perfectly to 1080p screens, but I assume that's not the end yet, right? Now while I know, that there's a nice tutorial available there, all the possibilities that were discussed here above made me confused. That's why I'd appreciate any help, opinions and suggestions regarding ways to scale the screen properly, especially from experienced users, who know various pros and cons, as well as have some tips.

If I'd have to give some details regarding my project~
- 540p resolution is good enough, it would be possible to use the sprites I've made in this environment. Nevertheless, if using another, relatively close to 540p (either smaller or larger) would be preferred, I could try that one, as everything can still be changed;
- Pixel art is what it will be about; the main sprites (characters etc.) have around 65x65 pixels;
- The main target is Windows; not sure about the others, but I might consider other desktop OS's, that will be possible. Either way the game totally isn't designed for mobile devices, nor web games etc..

Now what should I know when working on that kind of games and which path (method) should I take? I haven't used GMS much, so I'm unaware of its possibilities and limits yet. I just want to make the game look acceptable... Of course I'll still allow players to switch to windowed mode for maximum compatibility at any time, but fullscreen is also important for me, so I'd love to have it designed relatively well. Personally, I wouldn't mind having it slightly blurry if I'd have to, as long as it would look acceptable of course.

Thanks for any input. Sorry for asking most-likely-silly questions.
 

Yal

🐧 *penguin noises*
GMC Elder
Scrolling shooters probably are the easiest to learn, they let you mess around with level logic (if you move through a room with terrain and enemies and stuff) and boss AI and whatnot, but without all the annoying special cases imposed by gravity. You'd be surprised how many of my problems/bugs are related to gravity in one way or another :p
 

GMWolf

aka fel666
Scrolling shooters probably are the easiest to learn, they let you mess around with level logic (if you move through a room with terrain and enemies and stuff) and boss AI and whatnot, but without all the annoying special cases imposed by gravity. You'd be surprised how many of my problems/bugs are related to gravity in one way or another :p
This, very much this.
Many people try making a platformer their first game. Many tutorials have a platformer as the first game too. But the truth is platformers are hard! I am still not happy with the state of my own goto platformer logic, there are simply sooo many edge cases!
 

Yal

🐧 *penguin noises*
GMC Elder
sooo many edge cases!
Heh, figuratively and literally :p

Just to name a few:
  • Nonlinear movement (gravity acceleration) is harder to plan and control
  • Falling down somewhere doesn't mean you can jump up again (non-reversible movement)
  • Jump arcs are arced, so just because a gap are within your height and distance limits doesn't mean you can actually get across if there's objects protruding into the arc (which makes level design easy to mess up - especially with moving objects)
  • Instance deactivation + gravity has some issues with objects falling offscreen because the ground stops existing when deactivated
  • Blind jumps are more of an issue than blind reversible moving
Lots of these things apply both to enemies and player objects, too.
 

Yal

🐧 *penguin noises*
GMC Elder
Uh.. now I'm confused even more. :p
See? x3

But to TLDR my post: gravity makes everything more complicated. Collision checking, AI, level design. Make a game without gravity and stuff will get easier :p
 

Rikifive

Member
See? x3

But to TLDR my post: gravity makes everything more complicated. Collision checking, AI, level design. Make a game without gravity and stuff will get easier :p
Uh, I think we have some misunderstanding here. :p
I didn't ask for help related to game mechanics and such (yet :p), but just how to scale the game properly for fullscreen mode. :p Either way I wrote a platformer shooter in Ruby (another scripting language) before, so I think making it in GMS should be even easier than that. :p
 
Top