• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Beyond frustration: shimmer & flicker, artifacts on images

Hi,

I've been having a great deal of trouble with graphical artifacts; shimmering sprites, flickering lines and camera jitter, and as nice as Gamemaker is, it's been frustrating to say the least, and frankly I feel a bit sad.

I have the view size, room size, almost all of the graphics assets at image sizes in multiples of 2 (8, 16, 32, 64, 256 etc.) Interpolation on or off, drawing floored x/y coordinates or not, I still get problems -- when zooming and or scrolling/panning the view. It seems to occur most (or be most noticeable) when there are straight lines (a line of pixels in a straight row) in an image, but not always.

I'm desperate for knowledge and solutions.

Nathan
 
There's a lot of different things it could be. How's your monitor? On my monitor, the pixels refresh slowly, so there is always flickering and ghosting (especially in high contrast images). It could also be the texture interpolation or aliasing. Post a video or gif if you can.
 
Thanks for writing in everyone.
NazGhul, I may post a video of the issue if necessary.
RangerX, I have seen and read your very useful thread before, but I am going to read it all again now. In the mean time, you may wish to take a peek at the actual code I have in place now in the spoiler below.
Flyingsaucerinvasion, I have an ASUS 2560x1440 27" gaming monitor. I'm definitely feeling that this has something to do with interpolation, because sometimes, on some sprites a white pixel line will be drawn on the edge of the sprite when there is definitely no such line on the original image. But how does one combat these issues?

I am running/testing everything in windowed mode, but ultimately want windowed or full screen as options. I -think- I want the base resolution at 1920x1080, and this is not a pixel-art game.

// RESOLUTION AND SCALING
Code:
    // Get the hardware display width and height so we can match its aspect ratio
    hardware_display_height = display_get_height();
    hardware_display_width  = display_get_width();
 
    // set the width at a fixed value, and the width will scale up appropriately
    hardware_display_ratio = hardware_display_width / hardware_display_height; // hardware display ratio
    game_view_width        = 1920;
    game_view_height       = game_view_width / hardware_display_ratio; // now scale the height to match the aspect ratio combined with the fixed width
 
    // set the size of the GUI to match the proper width/height
    globalvar GUIWIDTH, GUIHEIGHT;
    GUIWIDTH  = game_view_width;
    GUIHEIGHT = game_view_height;
    display_set_gui_size(game_view_width, game_view_height);
 
    // window functions for scaling/centering the window
    window_set_size(game_view_width, game_view_height);

    window_set_position((hardware_display_width - hardware_display_width) + 100, (hardware_display_height - hardware_display_height) + 100);
 
     // Scale the draw surface of the game to match the new resolution
    surface_resize(application_surface, display_get_gui_width(), display_get_gui_height());
 
     global.original_view_size_w = game_view_width;
    global.original_view_size_h = game_view_height;
//CODE TO SET THE ABOVE FOR EACH ROOM
Code:
var i;
i = true;
room_to_set = room_next(room);

while (i == true)
{
    room_set_view(room_to_set, 0, true, 0, 0, global.original_view_size_w, global.original_view_size_h, 0, 0, global.original_view_size_w, global.original_view_size_h, 0, 0, 0, 0, -1);
    room_set_view_enabled(room_to_set, true);
    room_set_background_colour(room_to_set, c_black, false);

    // Continue to next room
    if (room_to_set != room_last)
    {
        room_to_set_prev = room_to_set;
        room_to_set = room_next(room_to_set_prev);
    }
 
    // Stop if this is the last room, and go to the starting room of the game
    else
    {
        i = false;
    }
}

UPDATE: I went and implemented Pixelated Pope's tutorial in a virtually identical manner, and while everything displayed correctly, the shimmering lines were not eliminated. (for more info, see my latest post below regarding colour interpolation)
 
Last edited:
K

Kenjiro

Guest
Hibba dibba da dibba do.
 
Last edited by a moderator:

RangerX

Member
Ok, what do you have in your global settings, graphic tab?
Are you in "full scale" or "keep aspect ratio". Because either way I suspect GMS might ignore your resizing code there and set the game according the global options.
Am not sure though, its been a long time I tested that because on my side, I ALWAYS disable the automatic handling of the application surface by the engine.
And if ever you want to actually disable it too, see this function in the manual: application_surface_draw_enable();

When you disable this, GMS will not do certain stuff for you like resizing, centering and drawing the application surface every step.
 
Interpolate colours between pixels ON. (see below)
Keep Aspect Ratio ON. (irrelevant, for now, as I am not switching to full screen in any of my tests at present)

Turning Interpolate colours between pixels OFF seems to solve the issue of shimmering sprites with lines. However, it's catch 22, because then I am back to this problem;
Camera jitter on view scroll/view follow
https://forum.yoyogames.com/index.php?threads/solved-camera-jitter-on-view-scroll-view-follow.26054/
To elaborate on this so called "camera jitter"; the parallax scrolling backgrounds have very fine stars. Unless the scroll rate is above approximately 6 pixels, the stars "jump" and "jerk" about, and even then they're not perfect.
However, turning interpolation on, eliminates this, and they scroll perfectly, regardless of the scroll rate.
 
Last edited:
Top