-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wobbling/Jittering of tiles in Godot 3.3 but not Godot 3.2.3 on Linux with 75 hz display #48200
Comments
Also wanted to add - this only affects my 2D Platformer - my 3D project is totally fine after upgrading. |
Maybe making a video would help? |
@Daniel-da-Silva Please upload a minimal reproduction project to make this easier to troubleshoot. Also, try installing, enabling and configuring the smoothing-addon to add physics interpolation to your project. It's expected that there will be jitter when the monitor refresh rate isn't a multiple of the physics update rate, so you need to add interpolation. See Fixing jitter and stutter in the documentation. |
@lawnjelly The ThinkPad I use isn't very strong, I don't think I could really show it since the framerate would be so choppy. I don't have a capture card and you don't really see it when I captured it with my smartphone :/ @Calinou I used the addon but it didn't change anything. I'm confused because of two things: It wobbles, jitters when nothing moves - the tilemap - and secondly it wasn't the case with 3.2.3 Anyways - I deleted the import folder and now my game is small enough Instructions: Walk to a language door. Press space. |
I couldn't see any wobbling / jittering of tiles (Linux Mint 20, Intel HD graphics 630), so it's really hard to give much feedback, there can be lots of source of wobble / jitter. Vibrations can sometimes happen as a result of physics, I would try having the camera / player not use physics and see if that cures it. |
@lawnjelly Do you have a monitor with above 60 hz? Because on 60 hz I also see no wobbling. I'm just wondering if it has to do with the changes from 3.2.3 because it works without any wobble in 3.2.3 and if I could change something there but turning Batching off didn't change anything. The only way if someone has a 60 hz monitor would maybe be overclocking it to 65-70 hz, sometimes this possible but I don't think the effort is worth it. Do you mean putting the code instead of physics process into process? This didn't change anything. And camera is on idle. Sorry, I'm not sure, what you mean with not using physics. Thanks for putting the time in! I don't even know if this would be a dealbreaker for upgrading to 3.3 because it could be very well only my machine making something weird and who uses 75 hz? |
My monitor seems to be 60hz on looking it up. But in godot you can change the physics tick rate from 60. At odd tick rates I can see some nasty jitter, but that is what fixed timestep interpolation is used to correct for, if you see the link Calinou posted. What I mean by not using physics, is to not move your player / camera with the physics engine. In godot you can move something either by applying a force to e.g. a rigidbody in the physics engine, and letting that move your object, or you can move the object position directly, and not use a physics object. Maybe you aren't using physics already, but your project is rather large and it is hard to work out. Basically if you press left you can move the player position directly in process or physics_process, and use the delta to decide how far to move. Probably in process if you want to remove the possibility of aliasing between physics ticks and frames. If that removes the wobble then you know it is something physics related. In 3.3 I can think of two things which may have changed and could be affecting you:
Other than that without seeing what is happening for you, it is pretty difficult to diagnose. Maybe another contributor will see this wobble. |
Hey, thanks again for putting time into an oddly specific issue that's unlikely to be common. The delay would seem an odd reason since I stand a longer time on one place. Maybe jitter or wobble is the wrong word - a slight constant shivering on the tilemap? And also text it seems - I saw that in the options. But! Good news - it's really bad quality but I could catch it on camera! VID_20210426_234803.mp4 |
In this case, this issue seems to be very close to #48130. |
@Calinou I saw that issue but I thought this was a problem which was also in Godot 3.2.3 or before since in my case it's only in Godot 3.3. 3.2.3 (and 3.2.2 for that matter) are totally fine. |
This kind of thing is usually due to a small vibration in the camera position, which can cause a relatively large change in the image because of sampling error (to pixels) - i.e. float to integer conversion. If some texels are just on a boundary of a whole pixel, and you have any tiny fractional variation in the camera / object, you can get vibration of this sort. As I say this is most likely to be caused by your physics (or even a bug in your gdscript, I haven't examined it). It is also possible that some filtering mode / offset has changed between 3.2.3 and 3.3 and accentuated the effect, but you need to use a process of elimination to find the cause, you have to act as a detective - there are multiple possibilities. Things like the match between object positions and the camera, off by one errors in scaling, especially with viewport sizes can also accentuate this. If you programmatically set your camera position to a fixed value, and the objects, and still get vibration, then it would be very odd, so I would suggest you test this. If fixed camera and object still gave vibration it might suggest a problem with double buffering, when it is swapping between a previous and current frame in slightly different positions, and these are never being updated. This does cause the kind of effect seen (regularly though, every pair of frames), but usually we'd get lots of users experiencing this, unless it was an issue with your specific GPU. |
@lawnjelly You were right! Thanks! It's the physics - at least as far as my understanding goes. I put in a piece of code to teleport the character to the level where the wobble was. In one test I had move_and_slide commented out and there was no shiver. When I commented it back in it shivered again. Even with no movement (maybe the player falls half a pixel after getting into the level when move and slide is processed? The camera is btw just attached to the player it doesn't have an extra script) But how can I fix that? |
You will have to get creative. This is similar to the problems involved with 2d snapping and jitter, and there has been a considerable amount written in various issues trying to solve it. |
That's a bummer ... I can't really justify investing the time to solve this issue since I don't really need any of the features of 3.3 for that game (the learning would be awesome but I need to work on my 3D game which had no problems after upgrading but doesn't use any physics). Staying on 3.2.3 and trying out 3.3.1 etc. is likely the best option for me at the moment. |
I have an workaround update to this issue THE ISSUE SOLUTION in reproduce project
SOLUTION in my main project SOLUTION that I tried but not work
VIDEO REPRODUCE PROJECT (This issue I met on both 3.x and 4.x version of GODOT) PS. on your hardware maybe not met with any issue. I asked my friend that test on GODOT 3.x with 90 and 144 Hz, result in He's not met any issues My PC Monitor1 : Acer VG240Y (50 and 75Hz tested and met issue) , this monitor limit at 75Hz OS : Windows 10 64 bit |
Closing in favor of godotengine/godot-proposals#2753, as this issue is dependent on the lack of built-in physics interpolation in 2D (and in 4.x in general). Note that even once physics interpolation is implemented, you will need to make sure your camera movement is a multiple (or divider) of the monitor refresh rate for it to look perfectly smooth without any stuttering. This is not specific to Godot – it's mathematics 🙂 |
Godot version:
3.3
OS/device including version:
ThinkPad X220, Mx Linux always updated,, i5-2520m
Issue description:
When I opened the same game with Godot 3.3 there is sometimes a small but noticeable jitter/wobble on the Tilemap when not moving while playing.
This only happened on my 75 hz monitor, not on 60 hz monitor and it only happened on Linux on this monitor (tested it on Windows with the same monitor). This doesn't happen with Godot 3.2.3.
Minimal reproduction project:
I wanted to upload my game but it was too big and since it seems oddly specific I don't know how much of use it is. Still wanted to mention it. Maybe there's a setting I can try? GPU Pixel Snap seems to improve the problem but not solving it and the character movement looks awful with it - so it won't be of much use.
The text was updated successfully, but these errors were encountered: