bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
34.34k stars 3.35k forks source link

Breakout Example is stuttering #2349

Open nonunknown opened 3 years ago

nonunknown commented 3 years ago

Bevy version

0.5

Operating system & version

Manjaro Gnome

What you did

Copied this example: https://github.com/bevyengine/bevy/blob/main/examples/game/breakout.rs

What you expected to happen

Game to run smoothly and without bugs

What actually happened

The red square is jittering, this sometimes causes collision detection to bug, and it gets out of screen.

Additional information

https://imgur.com/j52I6Kz

alice-i-cecile commented 3 years ago

Can you reproduce this with #2094?

mockersf commented 3 years ago

By "jittering", do you mean when the square is stuck between the paddle and the wall on the right? This should have been fixed by #685 but can still happen depending on your frame rate...

nonunknown commented 3 years ago

@alice-i-cecile I'll try

@mockersf nope, its the movement in general. Even if the FPS is low, for example 40, the square should not be jittering, because games doesnt work this way, the fixed timestep is one solution for this, but seems its not working?

nonunknown commented 3 years ago

@alice-i-cecile I tested here, and got the same result!

also I ran: cargo run --release

The game ran worse than the debug version, with way more jittery!

cart commented 3 years ago

I think theres a bug in #2094 that would make it stutter more. It moves the paddle without scaling it according to delta time, so framerate directly affects how fast it moves.

alice-i-cecile commented 3 years ago

@nonunknown I've updated #2094; is this resolved for you? I didn't notice any stuttering, but that may just be poor perception. A GIF (plus frame time information) may be useful for reproduction if this still persists.

nonunknown commented 3 years ago

tested it:

https://imgur.com/aQRCCez

You can compare the movement with the mouse movement, you can see how jittery it is.

cart commented 3 years ago

Yup thats pretty nasty. I'm also getting it to a lesser degree. I'll see what I can do. This behavior definitely isn't acceptable.

l0b0 commented 2 years ago

Seeing the same on NixOS 21.05, rustup 1.24.2, rustc 1.54.0, Linux kernel 5.10.60, AMD Radeon RX 5500 graphics card.