Help!New to GameDevelopment

Hi, I’m new to Godot and I’m currently working on a new game project. When I move my sprite or AnimatedSprite, the quality becomes blurry /jittery i dont know what to call it. However, when it stops, it looks crisp. Is there any way to maintain the crisp quality while moving (I checked on both monitor and mobile)?
#godot4.3

You need to post your code if you want help on it. Paste it between two sets of tick marks ``` on their own lines.

Having said that, you’re probably not multiplying your velocity by delta which is causing jerky movement. I suggest you check out Your first 2D game — Godot Engine (stable) documentation in English and see how it’s done there if you haven’t already.

Just for testing, I created a new project to sort this out. V-Sync is on, and both my monitor and mobile have a refresh rate of 60Hz. This is the code:

extends Node2D

func _ready():
pass
#Engine.max_fps = 60

func _process(delta: float) → void:
if global_position.x > 500:
return

global_position.x += 500 * delta
global_position.x = round(global_position.x)  # Snap to integer

What other things should I do to fix the blur…?

Try setting global_position.x once.

global_position.x = round(global_position.x + (500 * delta))

Your setting it twice could potentially have it moving back and forth between pixels to reflect the difference between the rounded and not rounded values.

If that doesn’t fix it, try lerping between the old and new position.

I tried it on a 120Hz display as well, with the FPS cap turned off. The issue is that the image quality drops during movement on all devices I tested, but it remains crisp when idle. I’ve tried enabling pixel snap, set filtering to ‘nearest’, and used code rounding options—everything. What are the reasons image quality drops? :frowning:

This could be a function of your displays. Are you seeing this more on your test than on other games?

It may also be the scaling mode of the game window, or something related to that; rounding position (I’d suggest using floor(), personally) will only reliably make a difference if the sprite and display buffer aren’t being scaled.

One thing you could try is hooking up a pause button; slide your image, but make it so you can pause, and print the x position as you do. If you do that, you can see if you can pause the game somewhere that makes the image blurry while paused. That will give you a position you can put the image at which should (in principle) make it blurry, which will be a useful test case while fixing things.

Rounding can add a little bit of jitter, I only see two duplicate frames. As for blurry that sounds like your monitor’s problem, LCDs can “ghost” moving images.

this is the exact issue im facing right now… https://youtu.be/DsiDPJ_dl0Y?feature=shared

First, I didn’t see any blur in your video. Which leads me to the conclusion that it is your monitor.

Second, I cleaned up your code for you. But you’re not doing anything that would cause blurring. There’s no reason to round the global_position to an integer. It’s not an integer, it’s a float. And you don’t need a blank _ready() function.

extends Node2D

func _process(delta: float) → void:
	if global_position.x > 500:
		return

global_position.x += 500 * delta

If the position isn’t snapped to an integral value and the texture filters aren’t set to nearest, you can potentially get smearing/blurring from the filtering. Even with nearest, I’ve seen some systems where you can get some artifacting.

1 Like