Windows Pixel perfect quality[Solved]

Brenden

Member
I have made a few games for school and me and my friends have noticed that sometimes the pixels in the game are janky or weird, so I have tried a few things to help but I still haven't got it pixel perfect.
In our games we resize the view height and width which can cause pixel problems. If you have any good advice please let me know that sweet knowledge to help this poor soul. noictied
 
L

Lotias

Guest
It sounds to me like the x and y position of the view might not be an integer, so pixels get rendered weirdly. Try rounding view_xview and view_yview.
 
X

Xskode

Guest
It sounds to me like the x and y position of the view might not be an integer, so pixels get rendered weirdly. Try rounding view_xview and view_yview.
Interesting: I have that same problem at times.

Would go about round the view in the step event? And would it be something like this:
view_xview = view_wview/x?
 
L

Lotias

Guest
Interesting: I have that same problem at times.

Would go about round the view in the step event? And would it be something like this:
view_xview = view_wview/x?
Code:
//It would be more like this
view_xview = round(view_xview);
view_yview = round(view_yview);
Experiment around with floor() and ceil() and round() to get the intended result, but generally you probably won't notice much of a difference between the three.
 
X

Xskode

Guest
Code:
//It would be more like this
view_xview = round(view_xview);
view_yview = round(view_yview);
Experiment around with floor() and ceil() and round() to get the intended result, but generally you probably won't notice much of a difference between the three.
yeah I used to floor and it works greatly. Im gonna checkout the others. thanks for the info man
 

RangerX

Member
I have made a few games for school and me and my friends have noticed that sometimes the pixels in the game are janky or weird, so I have tried a few things to help but I still haven't got it pixel perfect.
In our games we resize the view height and width which can cause pixel problems. If you have any good advice please let me know that sweet knowledge to help this poor soul. noictied
I need more details to truly solve your problem. You totally have a game that displays itself "pixel perfect" all the time in any monitor and I can help you achieving that. So what do you have right now in matter of code for scaling your game to different screen sizes?
 
T

ThunkGames

Guest
Is pixel interpolation off? Windows tab of global game settings I believe.
 
D

Deleted member 467

Guest
Could you maybe screenshot an example of your problem?
 

Brenden

Member
If you look close enough you will find pixels that are wider or taller than others. (I have full screen and small screen)
upload_2016-6-24_13-13-13.png
upload_2016-6-24_13-13-20.png
So far all I have done in this game to make the pixels a good size is this code.
Code:
surface_resize(application_surface, view_wport[1], view_hport[1]);
I do change the port from time to time.
 
Last edited:
D

Deleted member 467

Guest
Resizing the game window could do this, as well as surfaces.
 
R

Robert

Guest
I had a ton of problems getting this to work right, so I feel your pain, and unfortunately I am not home so I don't remember exactly what I did, but I believe you should be setting the application_surface to the screen width and height and you get that with something like display_get_width() or something along those lines. Then you need to set the view size to the size you want the window to actually be, and then set the port to be the ratio you want. So if your view size to be 800 x 600 and you want the graphics to scale up by 200% then set the port to 400 x 300. I believe thats what I did, it's been a while now since I got all that working.

Also make sure you have the interpolate colors turned off in the settings area and I cant remember if force aspect ratio needs to be on or off for this to work, I want to say turn it off.
 

RangerX

Member
Ok this happens because you're not scaling your game properly. As simple as that. You need to do much more than this to get pixel perfect.
And this implies that your game will appear letterboxed in certain screens/monitors (which still is more elegant than having deformed graphics).

What you need to do is actually to not let GameMaker Studio resize the application surface while automatically displaying it on screen. You will take control of it. You will have to display, resize and center the application surface yourself every step, according the monitor your game is played on. If you want to learn how to do that, I can help if you really have no idea. You game need to always resize itself only by an integer value. Anything else will lead to graphical deformation. This is how you will be pixel perfect and also why your game will appear letterboxed at certain sizes.


I also want to make a tutorial about this whole question soon. In the old forum I been explaining this every single week. All the time. I think its gonna end up the same with this forum too so my tutorial is going to be useful. When you truly understand what pixels and pixels displays causes, it becomes quite second nature and easy to solve your scaling problems once and for all.
 

zendraw

Member
@Xskode: What? You round using the rounding functions dear. And I'd suggest NOT to use round(). For even rounding, use either floor() or ceil() instead.
thanx, this helped me alot, i use very dynamic view and altho i had it pixel perfect, it seemed a bit chopy and unpleasent to the eye, now when i floor them its perfectly smooth and clear no matter how dynamic the view is.
 

Brenden

Member
Ok this happens because you're not scaling your game properly. As simple as that. You need to do much more than this to get pixel perfect.
And this implies that your game will appear letterboxed in certain screens/monitors (which still is more elegant than having deformed graphics).

What you need to do is actually to not let GameMaker Studio resize the application surface while automatically displaying it on screen. You will take control of it. You will have to display, resize and center the application surface yourself every step, according the monitor your game is played on. If you want to learn how to do that, I can help if you really have no idea. You game need to always resize itself only by an integer value. Anything else will lead to graphical deformation. This is how you will be pixel perfect and also why your game will appear letterboxed at certain sizes.


I also want to make a tutorial about this whole question soon. In the old forum I been explaining this every single week. All the time. I think its gonna end up the same with this forum too so my tutorial is going to be useful. When you truly understand what pixels and pixels displays causes, it becomes quite second nature and easy to solve your scaling problems once and for all.
Ya, a tutorial would be great but i'll try to do what I can with this new information. Whenever you get it done please message me.
 

RangerX

Member
I worked on it tonight. Should get it done during the weekend. I will post it in the tutorial section and link it here for convenience.
 
Top