• 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.

Legacy GM Broken pixels

O

Olafz

Guest
bugged pixels.png Hello! As you can see in the above image (I hope it's not too small), some pixels don't seem to be working properly. They seem to be cut in half, vertically. I've tried adjusting the room view H/W values and different pixels seem to be bugging at different view sizes, though I don't know how it's correlated. Any idea how to fix this?

Edit: Windows 10


Thank you!
 
Last edited by a moderator:

TsukaYuriko

☄️
Forum Staff
Moderator
Make sure that everything you draw is drawn at integer (rounded) coordinates.

If you are scaling the game in any way, make sure that your scale factor is an integer and that you're not interpolating what you're scaling (using texture_set_interpolation and turning it off while you are scaling, then turning it back on). For further information, you should read the tech blog articles about scaling:
http://www.yoyogames.com/blog/65
http://www.yoyogames.com/blog/66
 
O

Olafz

Guest
Thanks for the reply.

I've already turned off ''interpolate colours between pixels'' in the global game settings. Additionally I tried to use the code ''texture_set_interpolation(false);'' in the room creation code (I assume there's where it would be?), but it didn't change anything. I don't see how I could have used anything other than rounded numbers. The game has no code yet, apart from the function you showed me in your post, so I can't have divided in some way to get something that isn't a rounded number. Also when placing the objects in the room I've never set the Snap X/Y to anything below 1. I read through a bit quickly the articles you sent me. Maybe the problem is the scaling and maybe I missed something important but I couldn't immediately find something that made me think ''aha, that solves my problem''.

Here's some more info:

View in room:

W = 288
H = 192

Port on screen

W = 512
H = 384

Global Game Settings

Start in fullscreen mode = true
Interpolate colours between pixels = false
keep aspect ratio = true


Additionally I've also tried with "Start in fullscreen mode" set to false. No idea if that's relevant or not but it didn't change anything apart from, obviously, not starting the game in fullscreen mode.
 
Last edited by a moderator:
O

Olafz

Guest
Your problem is simple. There's a tutorial I made that will not only explain to you why this is happening but will give you multiple methods to fix it.
You can totally make so your game is displaying "pixel perfect" in all monitors of this world.

https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/

:)
Hello! I have some questions about the guide. I chose to follow ''1) Games displayed "pixel perfect" at all time."

1. In the guide you mention ''native resolution''. Does this equate to view height/width in a room?

2. I tried to have a separate object draw the application surface as described in step 5 of your guide. I tried using the code ''draw_surface_ext(application_surface,global.Xoffset,global.Yoffset,1,1,0,c_white,1);''.
First I used it in a draw event, which simply gave me a black screen upon startup. Then I tried using it in a step event, which simply crashed the game. Since your guide mentions that the application surface has to be drawn on the screen every step I suppose maybe the right solution would be to use a step event which in some way calls upon a draw event that includes the code? I'm not quite sure how to do that though. I googled it quickly and came upon the ''event_perform'' function. Would that do it?

3. Also, is there anything else I may not be doing correctly? Here's an image:
Capture.PNG

These may be really rookie questions but please be patient with me.

Thank you!
 

RangerX

Member
Good question. Yes by native resolution there I meant the view size and port size (which should always be the same).
As for drawing the application surface, I suggest you dedicate an object for drawing it. You could use the "post draw event". It needs to be in a draw event or else it won't work.
I suggest a "post draw" because its the last thing you want to draw basically. All your objects in the game should draw themselves on the application surface in a pre-draw or normal draw.

Also, since your game is for windows, I would suggest you accomodate it for the most popular resolutions. I wouldn't bother for less than 800x600 and would care to resize according the most popular resolutions only....

 
Last edited:
O

Olafz

Guest
Good answer.
I got it to work now thanks to your explanation. Also, thanks for the handy chart!

Tyvm
 
Top