#How to get rid of jittery/shaky/hacky/choppy diagonal movement with camera and views?

17 messages · Page 1 of 1 (latest)

astral badger
#

Step Event:

#region Movement
var key_left  = keyboard_check(ord("A"));
var key_right = keyboard_check(ord("D"));
var key_up    = keyboard_check(ord("W"));
var key_down  = keyboard_check(ord("S"));
var key_run   = keyboard_check(vk_shift);

moving = key_left || key_right || key_up || key_down;

movespeed = 0.2; // Walking speed
if (key_run && moving && sta > 0) {
    movespeed *= 2;
}

var speed_adjust = (key_left || key_right) && (key_up || key_down) ? (sqrt(2) / 2) : 1;

if (key_left && !place_meeting(x - movespeed * speed_adjust, y, obj_collisions)) {
    x -= movespeed * speed_adjust;
    sprite_index = spr_player_left;
    facing_direction = "left";
} else if (key_right && !place_meeting(x + movespeed * speed_adjust, y, obj_collisions)) {
    x += movespeed * speed_adjust;
    sprite_index = spr_player_right;
    facing_direction = "right";
}

if (key_up && !place_meeting(x, y - movespeed * speed_adjust, obj_collisions)) {
    y -= movespeed * speed_adjust;
    sprite_index = spr_player_up;
    facing_direction = "up";
} else if (key_down && !place_meeting(x, y + movespeed * speed_adjust, obj_collisions)) {
    y += movespeed * speed_adjust;
    sprite_index = spr_player_down;
    facing_direction = "down";
}

image_speed = moving ? (key_run && sta > 0 ? 0.3 : 0.15) : 0;
#endregion
#

these:

gpu_set_texfilter(false);
gpu_set_tex_filter(false);

are also set to false in an ini object
(that might have not been needed at all, but I read on a reddit post that it was recommended)

#

setting "movespeed" to 1, for example, completely rids the project of this issue.

#

but I really do want a very low movespeed to begin with

digital solstice
#

Absolutely do not do this

Object following sucks.

Make sure you do NOT have this enabled as it does interfere with camera objects

#

Elaborate on what kind of distortion you are seeing

#

A video would be helpful

astral badger
astral badger
#

dang it, wrong format. hold on

#

so when sprinting, (as movement speed becomes 2) the jittery, shaky feeling is gone

#

even when movespeed is set to 1, it works without issues

#

but when I'm moving diagonally with 0.2 movement speed, it's jittery and shaky

#

it has got to do, most definitely, with sub-pixel movement

#

but I'm not sure how to "flatten" it out, to get rid of it

#

okay, so apparently I was wrong!
I set movespeed to 1, but the issue was still there. However, it isn't there when I'm sprinting, which sets the movespeed to 2.
so I thought, I'll just set the base speed to 2 then... BUT NO, it's still "vibrating" when moving diagonally, even with movespeed set to 2. What's more, if my movespeed is 2, and I sprint, meaning same speed just holding down left shift, it does not jitter at all...