This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

2D rendering seems glitchy

sparkskapilsparkskapil Posts: 2Member

I created a 2D pong game with Godot 3.1 on Ubuntu
The ball movement seems glitchy sometimes.

Can anyone tell me what did I do wrong?

Code for the game:
https://github.com/sparkskapil/Pong-Game

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,561Admin

    I downloaded the project and I didn't notice any glitchy movement.
    If possible, can you record a short clip of the glitchy movement?

    I've let the project run and watched the ball, and sometimes it looks like the ball is jittering around a little, but taking a closer look at it, I think the jittering like motion is actually just a blur caused by the monitor's refresh rate and the rapid movement of the ball.
    Slowing the ball down to 100 made the jittering much less visible. That said, I only noticed the slight blur when I was tracking the ball carefully, so this might not be the issue, though it might be something to test.

    I did have the physics one do a short teleport, so I changed the physics jitter fix property in the Project Settings to 1.0, and as far as I can tell that seems to have fixed that issue, though I have no idea what caused the small teleport. I looked at the code, and I didn't see anything that looked like it would cause that behavior.

    With both of the occurrences I wrote above, I had to watch pretty carefully to notice them, so it might be I'm missing something.

    Hopefully this helps a bit!
    (Side note: Welcome to the forums!)

  • CalinouCalinou Posts: 376Admin Godot Developer
    edited August 2019

    Slowing the ball down to 100 made the jittering much less visible. That said, I only noticed the slight blur when I was tracking the ball carefully, so this might not be the issue, though it might be something to test.

    Ghosting is caused by the display updating its pixels at a "finite" speed. There's nothing you can do about it as a game developer :)

    Some monitors allow you to enable antighosting at various strengths, but setting it to a value that's too strong will cause reverse ghosting artifacts to appear.

  • sparkskapilsparkskapil Posts: 2Member
    edited June 2020

    Sorry for late feedback.
    In Godot 3.2.1 there is a project setting "VSync Via Compositor".
    I tried enabling "VSync Via Compositor" setting and the jitters were fixed.
    Now the game is running smooth.

    This worked with my desktop.
    I can see the jittery motion of the pong on my laptop even after enabling "VSync Via Compositor"

    Thanks

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.