[Merged by Bors] - Change breakout to use fixed timestamp#1541
[Merged by Bors] - Change breakout to use fixed timestamp#1541hymm wants to merge 4 commits intobevyengine:mainfrom
Conversation
|
need a rebase to fix CI |
f442a65 to
eaaef00
Compare
alice-i-cecile
left a comment
There was a problem hiding this comment.
This is a clean change, and fixing strange behavior and obvious bugs in our example games is worth the added complexity.
71fff34 to
aa1542a
Compare
|
Changed the speeds to 8.0 and 6.0 as these were whole numbers close to the original speed and from my eye test it seems like whole numbers animate a little smoother. I should mention that this PR doesn't fix everything from #1240 as there are still some wonky collision detection between the ball and the paddle. |
aa1542a to
a46f6d6
Compare
examples/game/breakout.rs
Outdated
| }) | ||
| .with(Ball { | ||
| velocity: 400.0 * Vec3::new(0.5, -0.5, 0.0).normalize(), | ||
| velocity: 6.0 * Vec3::new(0.5, -0.5, 0.0).normalize(), |
There was a problem hiding this comment.
This is still "not velocity" with the new implementation. You effectively pre-multiplied TIME_STEP and velocity. This has the effect of changing object speed if someone changes the timestep value here: https://github.com/bevyengine/bevy/pull/1541/files#diff-4dcbfd17ebad2621b5605be8bd3b43859376e27f30793a937858d470627ed2b2R18
There was a problem hiding this comment.
movement speed should be timestep independent
There was a problem hiding this comment.
Whoops. I shouldn't read comments right before I fall asleep. Should be fixed now.
a46f6d6 to
c02bf1c
Compare
c02bf1c to
19a1863
Compare
|
Just adapted this to use the newly-added SystemSet. This slightly reduces boilerplate. |
|
bors r+ |
This PR fixes #1240, where the ball is escaping the playing field at low framerates. I did this by moving the movement and physics system into a Fixed Timestep system set and changing the movement steps to a constant. So we lose the example use of delta_time for changing position, but gain a use of FixedTimestep. If this is accepted bevyengine/bevy-website#102 will need to be updated to match. Co-authored-by: Carter Anderson <mcanders1@gmail.com>
|
Pull request successfully merged into main. Build succeeded: |
This PR fixes bevyengine#1240, where the ball is escaping the playing field at low framerates. I did this by moving the movement and physics system into a Fixed Timestep system set and changing the movement steps to a constant. So we lose the example use of delta_time for changing position, but gain a use of FixedTimestep. If this is accepted bevyengine/bevy-website#102 will need to be updated to match. Co-authored-by: Carter Anderson <mcanders1@gmail.com>
This PR fixes #1240, where the ball is escaping the playing field at low framerates. I did this by moving the movement and physics system into a Fixed Timestep system set and changing the movement steps to a constant. So we lose the example use of delta_time for changing position, but gain a use of FixedTimestep.
If this is accepted bevyengine/bevy-website#102 will need to be updated to match.