mkhan45 / ssshmup

super small shoot 'em up
GNU General Public License v3.0
10 stars 2 forks source link

Frame rate independence is kind of meh #2

Open mkhan45 opened 4 years ago

mkhan45 commented 4 years ago

Right now all there is to enforce time rate independence is

let time_diff = time_since_start - last_update;
if time_diff < std::time::Duration::from_millis(15) {
   return Ok(());
}

in the update method.

This leads to some possibly noticeable jittering from my testing at limiting it to 30 fps on my 60fps display.

Another problem is that the game will be too slow if the fps is less than 60.

Ideally, everything is done with some Delta resource but I tried implementing it that way and everything got worse. A lot of timers are based off of number of frames passed which is somewhat problematic.

I read some article on frame rate independence a while ago with ggez but I can't find it

Edit:

List of timing based thing to fix:

jakeklassen commented 4 years ago

Maybe this is the article you're thinking of? https://joetsoi.github.io/fix-your-timestep-rust-ggez/

mkhan45 commented 4 years ago

yep, that's definitely the article I was thinking of. Thanks!