Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411511 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 02:02:14 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)[Solved!] Issue with refresh lines in Game Maker?
Pages: [1]
Print
Author Topic: [Solved!] Issue with refresh lines in Game Maker?  (Read 4811 times)
denzgd
Level 1
*



View Profile WWW
« on: March 16, 2015, 10:30:31 PM »

So it doesn't seem to matter what the framerate is in my game - when the view moves somewhere, it causes the game to redraw unevenly, to where I can visibly see a horizontal section of the game that is refreshing slower. Now, I have seen this issue in other GM games, for example Gunpoint. However, I picked up Hotline Miami 2, and that game runs at 60FPS, and does not have this issue. This tells me it is possible to prevent/fix this issue, but I can't find how. Anybody have any fixes for this?
« Last Edit: March 18, 2015, 02:20:51 PM by denzgd » Logged

Layl
Level 3
***

professional jerkface


View Profile WWW
« Reply #1 on: March 16, 2015, 11:30:42 PM »

This is called screen tearing, the area that's under the tear line is a frame behind the area above. It's not actually running slower under that line, it's just not done copying the frame over yet. This can be fixed by enabling vsync.
Logged
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #2 on: March 17, 2015, 04:20:15 AM »

Yeah, the option to turn on vsync is in your advanced game settings or something named similarly. It should be at the bottom of the resource manager.

Edit: While you're at it, turn off the option that says "interpolate colors between pixels" as well in every graphics tab of each export option. it'll make zooming in much sharper, especially if your game is in pixel art.
Logged

denzgd
Level 1
*



View Profile WWW
« Reply #3 on: March 17, 2015, 05:14:40 PM »

Yeah, the option to turn on vsync is in your advanced game settings or something named similarly. It should be at the bottom of the resource manager.

Edit: While you're at it, turn off the option that says "interpolate colors between pixels" as well in every graphics tab of each export option. it'll make zooming in much sharper, especially if your game is in pixel art.

It does use pixel art, and I actually turned it off long ago! But thank you for the heads up, anyway! A while back, I was looking for a way to scale pixels perfectly, because the previous method was apparently obsolete, so I ended up just making my own way to do so. It works perfectly, too.

I did enable the synchronization option, and the screen tearing is now gone! My question now is, does the V-sync option or whatever cause any issues with performance or compatibility? Otherwise, I see no reason to not have it on all the time.
Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #4 on: March 17, 2015, 05:29:54 PM »

I guess it might cause some lag on 20 years old toasters, but other than that I don't think so. There are old computers at my workplace with Windows XP and I had GM 8 installed, and vsync was on and it caused no lag, so it's safe to say it causes more good than harm.
Logged

J-Snake
Level 10
*****


A fool with a tool is still a fool.


View Profile WWW
« Reply #5 on: March 17, 2015, 06:16:58 PM »

A while back, I was looking for a way to scale pixels perfectly, because the previous method was apparently obsolete, so I ended up just making my own way to do so. It works perfectly, too.
You cannot scale pixels perfectly in most cases, aliasing occurs.

I did enable the synchronization option, and the screen tearing is now gone! My question now is, does the V-sync option or whatever cause any issues with performance or compatibility? Otherwise, I see no reason to not have it on all the time.
Vsync can add noticeable visual lag (press a button and the character starts to move few frames later on the screen). And it will cause stuttering when screen refresh and the fixed update loop go out of sync.

Unfortunately you have to decide what trade off you want to make. Gsync/FreeSync should solve that problem, but that should be a standard decades ago, not a new invention.
Logged

Independent game developer with an elaborate focus on interesting gameplay, rewarding depth of play and technical quality.<br /><br />Trap Them: http://store.steampowered.com/app/375930
denzgd
Level 1
*



View Profile WWW
« Reply #6 on: March 18, 2015, 02:19:46 PM »

You cannot scale pixels perfectly in most cases, aliasing occurs.

I'm probably not describing my issue in the correct terminology, then. (forgive me, I use GMS because I'm not very knowledgeable about programming! Anyway, the issue I was running into, is that my game uses low-res pixel art. Since it was low-res, I didn't want to just keep it at 1:1 ratio, as the characters and stuff would be tiny!

So I increased the size that the game would draw all the graphics, and turned off interpolation so that the graphics wouldn't be all blurry. But they were still all stretched out and stuff, and I wanted it to not look stretched out and warped; I wanted it to look like it did when it was small, just bigger! I don't know what the official name for that is, but that's what was happening.

People said that Game Maker isn't very good with doing graphics like that, and nobody really knew how to fix it. So I came up with my own way of doing it, and now it looks exactly like I want it to!

That's a shame about the v-sync, though. I'll have to have it so that the player can enable, or disable it at startup. I'all have it on by default, just because the game runs smoother for me, but I'll definitely keep that in mind. Thanks guys!
Logged

J-Snake
Level 10
*****


A fool with a tool is still a fool.


View Profile WWW
« Reply #7 on: March 18, 2015, 02:42:46 PM »

People said that Game Maker isn't very good with doing graphics like that, and nobody really knew how to fix it. So I came up with my own way of doing it, and now it looks exactly like I want it to!
That's one of the problems working with foreign limited engines. In opengl it is just a texture filtering setting. Instead of linear you choose nearest.

That's a shame about the v-sync, though. I'll have to have it so that the player can enable, or disable it at startup. I'all have it on by default, just because the game runs smoother for me, but I'll definitely keep that in mind. Thanks guys!
You certainly should, depending on how important that is for your particular game.
Logged

Independent game developer with an elaborate focus on interesting gameplay, rewarding depth of play and technical quality.<br /><br />Trap Them: http://store.steampowered.com/app/375930
denzgd
Level 1
*



View Profile WWW
« Reply #8 on: March 18, 2015, 11:01:52 PM »

That's one of the problems working with foreign limited engines. In opengl it is just a texture filtering setting. Instead of linear you choose nearest.

Yeah, I didn't think it would be so hard to get pixel art to not look warped or stretched at all. Game Maker doesn't make it easy. It feels like all my code is duct tape, barely allowing it to work, but I think that's okay for somebody with my amount of experience. I've got perfectly-scaled pixel art, with no blurring, no stretched or warped pixels, no letterboxing, and it works on any monitor size. This is nothing short of a miracle, that I made that happen. It all still seems like sorcery to me.

Anyway, my vsync solution is thus:

Settings Menu option to turn it on/off, which triggers:
Code:
display_reset(AA, vsync);

Antialiasing, I presume, would be set to 0 by default for pixel art, and then vsync true/false based on player preference. This would also trigger a change in some sort of external file, so the game remembers this on startup, AND can be changed manually, in case somebody can't get it to start otherwise.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic