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

Graphics Help with removing blurry sprite effect

G

GreenPotion

Guest
I'm currently making a platformer game. I noticed that when the character sprite moves, there's a blurry effect that follows through. How do i remove that blurry effect and make the animation smoother? Search online and every posts suggests disabling interpolation, but it doesn't help.

Refer to the video link below at 26:00, when the character (green square) moves, the blurry trail is what i'm talking about.

 

Joe Ellis

Member
A thing to bear in mind is that this blur effect is alot more noticable when the graphics are really high contrast, ei. black then bright green then gray, so when you've got your actual game working it will be alot less noticable, if you look at any other game, the effect is still happening, you just cant notice it as much cus of the colors blending more gradually pixel to pixel

Also, it seems like your object is moving inter-pixel-ly and will make the movements more jittery and less regular, as the sprites pixels are drawn on the nearest pixel, so while its moving its best if it is moved by 1 or 2 pixels at a consistent rate

If your using speed, hspeed or vspeed, these are measured by how many pixels the object moves per step/frame, so if this is on a decimal number its going to be irregular

I would recommend using code like this instead:

Code:
if keyboard_check(vk_left)
{
if hsp>-5
{
hsp-=0.2
}
}
if keyboard_check(vk_right)
{
if hsp<5
{
hsp+=0.2
}
}
else
{
if !keyboard_check(vk_left)
{
hsp*=0.95
}
}

if hsp!=0
{
xx+=hsp
x=floor(xx)
}
the xx variable is for the sub-pixel movement and is the exact position of the object, but x (the object's draw position) is always rounded down to the nearest whole pixel
you can round up aswell using ceil(xx) (stands for ceiling)
and normal rounding using round(xx) but floor is probably best due to the way that pixels are measured left to right


This should make movements look alot more regular
 
M

Master Maker

Guest
Actually, the real problem is probably interpolation between pixels. You can turn it off in global game settings.
 

RangerX

Member
This is the refresh speed of the pixels of your screen. You can't do anything about that and everybody with different monitors will see it differently.
Nothing you should worry about me thinks.
 
M

Master Maker

Guest
'Me thinks' not to be rude, but you sound sort of like Gollum for the lord of the rings. LOL!
 
Top