RJ / bevy_timewarp

A rollback library that buffers component state. Useful for netcode.
MIT License
37 stars 3 forks source link

Bevy 0.12 #8

Closed ActuallyHappening closed 6 months ago

ActuallyHappening commented 10 months ago

This PR is a WIP but does compile For some reason, however, the tests don't pass! I believe this is because the FixedUpdate Schedule is not run, but can anybody tell me why the tests don't pass? I am at a loss @RJ .

Check the diff for commit: a0d48b3081428f04165bb26ec2df4749d761b58c

Updated (tests/test_utils.rs):

// Simulate that our fixed timestep has elapsed
// and do 1 app.update
pub fn tick(app: &mut App) {
    let mut fxt = app.world.resource_mut::<Time<Fixed>>();
    let period = fxt.timestep();
    fxt.advance_by(period);
    app.update();
    let f = app.world.resource::<GameClock>().frame();
    info!("end of update for {f} ----------------------------------------------------------");
}

Older:

// Simulate that our fixed timestep has elapsed
// and do 1 app.update
pub fn tick(app: &mut App) {
    let mut fxt = app.world.resource_mut::<FixedTime>();
    let period = fxt.period;
    fxt.tick(period);
    app.update();
    let f = app.world.resource::<GameClock>().frame();
    info!("end of update for {f} ----------------------------------------------------------");
}
RJ commented 10 months ago

nice, thanks. i'll be doing a 0.12 upgrade pass for my game, and various bits soon, and will check this out. just waiting on a couple of other deps. i'll have to read up on the new time and fixedupdate changes..

ActuallyHappening commented 10 months ago

OK I fixed the issue after asking it on discord https://discord.com/channels/691052431525675048/1174237039277908008/1174244738233286716

Also, I noticed a slight ambiguity in system ordering that I 'hackily' fixed in a6f6760e5f3ea74527dd70ef39ff6114f0e2cefc

test pass

ActuallyHappening commented 6 months ago

Lol, this was only closed after bevy updated to 0.13 :)

RJ commented 6 months ago

thanks for this, got there in the end šŸ«  i never really used 0.12 myself. not sure what to do about the 1 nanosecond period thing, leaving as is for now.