bevy_ggrs icon indicating copy to clipboard operation
bevy_ggrs copied to clipboard

panic: `Rollback requested was not created using AddRollbackCommand!`

Open johanhelsing opened this issue 8 months ago • 0 comments

Describe the bug

Run the example in #78

To Reproduce

cargo watch -cx "run --release --example particles -- --local-port 7001 --players 127.0.0.1:7000 localhost --input-delay 0 --desync-detection-interval 1 --rate 1" 
cargo watch -cx "run --release --example particles -- --local-port 7000 --players localhost 127.0.0.1:7001 --input-delay 0 --desync-detection-interval 1 --rate 1" 

Press space a couple of times on one of the peers.

Sometimes, it will desync, and sometimes, it will panic with the below:

2023-10-26T09:25:03.902877Z DEBUG ggrs{name="HandleRequests"}:schedule{name="AdvanceWorld"}: bevy_ggrs::schedule_systems: advancing to frame: 122
2023-10-26T09:25:03.903039Z DEBUG ggrs{name="HandleRequests"}:schedule{name="AdvanceWorld"}: bevy_ggrs::schedule_systems: frame 122 completed
2023-10-26T09:25:03.918700Z DEBUG ggrs{name="HandleRequests"}:schedule{name="LoadWorld"}: bevy_ggrs::schedule_systems: restoring snapshot for frame 121
2023-10-26T09:25:03.919139Z TRACE bevy_ggrs::snapshot::entity: Rolled back 0 entity(s)
2023-10-26T09:25:03.919272Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Parent component(s)
2023-10-26T09:25:03.919355Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Sprite component(s)
2023-10-26T09:25:03.919279Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 ComputedVisibility component(s)
2023-10-26T09:25:03.919279Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Transform component(s)
2023-10-26T09:25:03.919289Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Children component(s)
2023-10-26T09:25:03.919299Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Visibility component(s)
2023-10-26T09:25:03.919311Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Ttl component(s)
2023-10-26T09:25:03.919324Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Velocity component(s)
2023-10-26T09:25:03.919337Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 GlobalTransform component(s)
2023-10-26T09:25:03.919345Z TRACE bevy_ggrs::snapshot::component_snapshot: Rolled back 0 Handle<Image> component(s)
2023-10-26T09:25:03.919278Z TRACE bevy_ggrs::snapshot::resource_snapshot: Rolled back ParticleRng
2023-10-26T09:25:03.920092Z TRACE ggrs{name="HandleRequests"}:schedule{name="LoadWorld"}: bevy_ggrs::snapshot::component_map: Mapped Parent
2023-10-26T09:25:03.920210Z TRACE ggrs{name="HandleRequests"}:schedule{name="LoadWorld"}: bevy_ggrs::snapshot::component_map: Mapped Children
2023-10-26T09:25:03.920346Z DEBUG ggrs{name="HandleRequests"}:schedule{name="AdvanceWorld"}: bevy_ggrs::schedule_systems: advancing to frame: 122
2023-10-26T09:25:03.920512Z DEBUG ggrs{name="HandleRequests"}:schedule{name="AdvanceWorld"}: bevy_ggrs::schedule_systems: frame 122 completed
2023-10-26T09:25:03.920601Z DEBUG ggrs{name="HandleRequests"}:schedule{name="SaveWorld"}: bevy_ggrs::schedule_systems: saving snapshot for frame 122
2023-10-26T09:25:03.920683Z TRACE bevy_ggrs::snapshot::component_checksum_hash: Component Velocity has checksum 987D2AEF7711FCF5
2023-10-26T09:25:03.920740Z TRACE bevy_ggrs::snapshot::checksum: Frame has checksum 987D2AEF7711FCF5
2023-10-26T09:25:03.920806Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 0 Parent component(s)
2023-10-26T09:25:03.920868Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 Transform component(s)
2023-10-26T09:25:03.920818Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 Sprite component(s)
2023-10-26T09:25:03.920824Z TRACE bevy_ggrs::snapshot::entity: Snapshot 1 entity(s)
2023-10-26T09:25:03.920825Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 GlobalTransform component(s)
2023-10-26T09:25:03.920836Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 Handle<Image> component(s)
2023-10-26T09:25:03.920841Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 Visibility component(s)
2023-10-26T09:25:03.920848Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 Ttl component(s)
2023-10-26T09:25:03.920856Z TRACE bevy_ggrs::snapshot::resource_snapshot: Snapshot ParticleRng
2023-10-26T09:25:03.920808Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 0 Children component(s)
2023-10-26T09:25:03.920879Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 Velocity component(s)
2023-10-26T09:25:03.920878Z TRACE bevy_ggrs::snapshot::component_snapshot: Snapshot 1 ComputedVisibility component(s)
2023-10-26T09:25:03.921549Z DEBUG ggrs{name="HandleRequests"}:schedule{name="AdvanceWorld"}: bevy_ggrs::schedule_systems: advancing to frame: 123
2023-10-26T09:25:03.921676Z  INFO particles: from [0, 0, 0] to [0.9723242, 2.198806, 0]
2023-10-26T09:25:03.921753Z DEBUG ggrs{name="HandleRequests"}:schedule{name="AdvanceWorld"}: bevy_ggrs::schedule_systems: frame 123 completed
2023-10-26T09:25:03.934996Z DEBUG ggrs{name="HandleRequests"}:schedule{name="SaveWorld"}: bevy_ggrs::schedule_systems: saving snapshot for frame 123
thread 'Compute Task Pool (4)' panicked at src\rollback.rs:99:14:
Rollback requested was not created using AddRollbackCommand!

Expected behavior

No panics, since all rollback components were actually added through the .add_rollback() extension

johanhelsing avatar Oct 26 '23 09:10 johanhelsing