[Question] What Will Be the New Snapshot Strategy?
zicklag opened this issue · 2 comments
Hey there!
I saw this in the README:
Since I am not happy with using bevy-reflect to save and load snapshots of the world, I am looking forward to this refactoring!
I've been working on and exploring some Bevy networking stuff and I ended up using Reflect
and a custom CompactReflectSerializer
/Deserializer
to serialize byte-efficient versions of all the components for snapshots.
It sounds like you were using Reflect
too, but aren't going to be anymore and I was curious how you were going to do the snapshots when the new stageless implementation lands, if it isn't going to use reflection.
I might be able to make use of whatever it is.
I have not figured what I am going to do, but I would really like to only require impl Clone
for components that get rolled back instead of impl Reflect
, since all I do is copying data around. I recommend to check out the solution that bevy_backroll uses. Maybe there is something useful for you there :)
Yeah, it looks like they get away with just a Clone
bound and storing everything in HashMap<TypeId, Box<dyn Any + Sync + Send>>
. Quite simple.
Thanks for the reference. :D 👍