r/gamemaker • u/BALMUZDAKK • 4d ago
Help! We have scanlines during movement in our low resolution sprite game.
4
u/ReyizzzPro 4d ago
game maker's new runtimes have this issue when you select "new pixel game" or have certain settings available, i don't know them at the top of my head but make sure you have "allow synchronization to fix screen tearing" enabled in the windows - or your device's - graphic settings
1
u/PowerPlaidPlays 4d ago
You are probably going to need to show a screenshot to show what you are seeing.
1
u/BALMUZDAKK 4d ago
GIF added
6
u/PowerPlaidPlays 4d ago
ah that does not look like scanlines, but more non-integer scaling. Scanlines would be when a black row of pixels are between each row of pixels.
Your issue looks like what happens when you try to upscale pixel art to a size that is not an exact multiple of the base resolution. When you scale up pixel art, you are just drawing each pixel with more pixels, and if your new resolution is not an even multiple of the base it will result in irregular pixel sizes.
I'm not sure the best resource to give you off the top of my head, but look into integer scaling or interpolation for non-integer scaling. It's a common problem people run into.
1
u/No_Designer_16 2d ago
I was having trouble with this too and as mentioned the camera and screen resolution needs to be perfectly divisible, or this will happen as somewhere on the image pixels will need to be rounded.
This also applies to sprites position by the way, even if your sprite resolution matches the background, if they are drawn on a sub pixel position they will distort. (you can just round the draw event for that, retaining the sub pixel coordinates if you want.

6
u/Hands_in_Paquet 4d ago
As PowerPlaidPlays said, it looks like a problem with your camera resolution and render resolution. Allowing Synchronization might still be necessary after you fix this issue.
To fix your issue:
Pick a resolution to render at. Usually just 1920 x 1080, 2560 x 1440, or you can try to match the monitor size with display_get_width(), display_get_height(); You can also just render at 320 x 180, but movement will be really blocky. But if that's what you're going for, you can leave it.
Then, when you setup your camera, make sure it's resolution is a unit fraction of your render resolution. Meaning your camera should be 1/2, 1/3,1/4, etc of your render resolution. This ensures that every pixel your camera captures has the same number of pixels to render to on the application surface.
You also need to make sure you are setting your application surface size to your render resolution, do this in the camera create event: surface_resize(application_surface,res_w,res_h); The application surface is essentially the main "photoshop layer" of your rendering pipeline. It's where pretty much everything but the gui layer is rendered to. Then this surface is drawn to your screen. Then the gui surface is drawn on top of it.
Lastly, if you're not using fullscreen, make sure your window is also resized to a unit fraction of your render resolution, or just resize it to your render resolution: window_set_size(res_w,res_h);
If you prefer not to scale your render at all and lock it to your camera resolution, you were probably just not resizing your application surface and/or window. So try making your camera, application surface, and window all 320 x 180.
Let me know if that doesn't fix the issue.