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,666Admin

    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: 417Admin 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 18

    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

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file