Please Help; I have been trying to fix pixel art jittering in my 2d platformer for 2 days

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DaZel77

I humbly ask for someone to take a look at my project and try to figure out why this isnt working. I have followed many tutorials and I have no idea why this isnt working. My pixel art and animations continue to jitter. This media share has an exported version of the project Im working one if anyone has ANY advice for this problem i will be in your debt.

Heres the link: My Files

Sounds like the camera is shaking? Only “key A” working.

ramazan | 2022-01-31 08:31

It still happens even if the camera is off. The camera smoothing I put in place was a pixel-perfect camera to try to fix the problem. The pixels not being uniform is continuous, and its not because of the camera. Any other ideas, if you want I can send a video without a camera in the scene.

DaZel77 | 2022-01-31 14:38

:bust_in_silhouette: Reply From: rossunger

Did you change your project settings to accomodate pixel art? there’s a few to change… I think there’s the Stretch/Aspect setting under Display/Window in the project settings…

Also vsync settings might be relevant.

Also, make sure none of your nodes are being scaled :stuck_out_tongue:
I’m assuming the import settings on your image files are set correctly

What does node scaling do to pixel art? For example I do have some nodes scaled but the player is not and the tileset is not. Also I just tried a test with a regular pixel art background and the effects are even more pronounced. I will paste a picture of my settings and the background. GPU Pixel snapping is also on.

Heres the pictures(sorry don’t know how else to upload them): My Files

DaZel77 | 2022-01-31 17:19

In theory, scaling a node down means the computer has to make decisions about what to do with the pixels, and as your game changes from frame to frame, the decisions might change in a way that causes jitter. There’s different scaling algorithms that prioritize different things, and I can’t remember where in godot you control these settings… i thought it was in the project settings but it might be elsewhere

Or maybe I misunderstand what you mean by jitter?

I can’t tell what’s wrong from the images you posted. the character looks a bit blurry, but that seems like it’s just the way the art was made… and the lines look a little janky, but again, that seems normal…

rossunger | 2022-01-31 17:30

The main problem with the backround player was the lines especially the orange line on the far right. You might be able to see that the pixel width is not uniform. Also if you saw the exported project, you might be able to see that the players eye pixel changes widths on the idle animation and any other animation where the sprite moves vertically. Also if you know where those settings would be I would appreciate it. I just looked at the Mediafire files and the blur is from the screenshot I took srry abt that :stuck_out_tongue:

DaZel77 | 2022-01-31 18:29

the vsync setting is in project settings / display / window / use Vsync
(you might also try Vsync via compositor which i see in godot 3.4.2… )

Also maybe high DPI settings? are you using a high dpi display?

I think that’s all I’ve got for you :confused: sorry.

rossunger | 2022-01-31 18:47

Did you want me to turn off vsync? And where would one chack dpi? Thanks for all your help :slight_smile:

DaZel77 | 2022-01-31 18:51

Turn on vsync if it’s off :slight_smile:

display / Window / allow hidpi

p.s. There’s a search button under project settings that is super helpful in finding settings!

rossunger | 2022-01-31 18:53

OMG That partially worked I think! The big line on the right is now ok, but the player isn’t. If you think of something else please let me know, but tysm for your help and have a good one :]

DaZel77 | 2022-01-31 18:56

:bust_in_silhouette: Reply From: rossunger

Also, is this helpful?

I did try the solution in this but since my problem seems to happen regardless of camera this didn’t help. Do you think my resolution would be causing this?

DaZel77 | 2022-01-31 17:22

:bust_in_silhouette: Reply From: Karmavil

This answer might not be the solution to your problem however I will point out 2 things that might be related.

  • I spent hours figuring out why the UI I was creating didn’t fit in the screen 50% of the times I launched the project… the solution:
    Project Settings => Display > Window => Stretch > Mode: 2D

  • The other thing might be or may be not related but it resembles to something I read:
    Visualizations that are not that compatible with nodes, such as a tetris board. (The tetris example uses a custom draw function to draw the blocks.)
    Custom drawing in 2D — Godot Engine (stable) documentation in English

I hope that’s not the case to make things easy for you

I looked at the article but how would one do that for say the player sprite? Would I have to draw every pixel?

DaZel77 | 2022-02-01 01:57

I had to add the comment just to open the possibility that might be another problem here… I am pretty sure this is not your case there is a lot of pixel art games out there and I don’t think they’re all generated by script.
Honestly I thought the first suggestion could be helpful I strongly encourage you to review the project settings before start drawing, this approach is not just harder it is prone to errors.

I am sorry for not being more helpful than that but I cannot see the code and I am not using Windows, besides my experience is far behind others. I know it is hard I’ve been there

Karmavil | 2022-02-01 02:17

@Dazel77 did you tried changing the Stretch mode from viewport to 2D
Did it work?

I don’t know why you’re using a viewport. You’re making a 2D game. Check the documentation about viewport.
Maybe can be useful to play with the camera I don’t know but for now stick to 2D

Karmavil | 2022-02-01 02:35

Yes I tried 2D and it still did not work. I have been doing some testing and even when I open a fresh project and make a scene with just a node 2d and my test background, some of the pixels are still off. I am completely confused at this point and I cant find anyway to fix this

DaZel77 | 2022-02-01 03:11

If you still have that new project try to set the window size higher like the default I am not sure but I think it is 1024*600 (maybe it depends or your hardware not sure) but if your assets are small and you start your 640*360 in a 1920*1200 monitor sort to speak maybe you should expect to see that kind of things. Even in a 1400*900 your default values for the screen are too low (in my opinion) not sure if that’s what you want.

I don’t have all the answers obviously but I hope you understand that I don’t see all the details about this so I am doing my best guess

Karmavil | 2022-02-01 03:51

Yes I understand. I will try that. Thanks for all the help you’ve given and have a good day :]

DaZel77 | 2022-02-01 15:36

Hi again. I have one more suggestion for you to try but this could be a little difficult for me to explain.
You could apply a theme to the container of your sprite. Not all nodes support themes (AFAIK), in example you cannot apply a theme in the sprite (directly).
You should apply the theme to the container of your character but this theme should be exclusive for the scene of your character, or shared with other items that have the same problem if you know what you’re doing. Just remember that if you’re not specific, changes to this theme will affect other assets that make use of it.
Why am I suggesting this? Because I think you could apply anti aliasing to your sprite and that could do the trick.

So before start making changes to what you have already I suggest you take a look at themes and see if it fits your needs

Karmavil | 2022-02-07 00:15