-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to rollback game state if derialize the world won't delete new created entities? #70
Comments
good question! i hadn't considered a situation like this. luckily i'm in the process of rewriting serialization, and i believe i have a solution for keeping everything in sync, component adds and removals. sit tight and i'll try my best to cater to your scenario :) |
I am in a similar position. I am currently serializing the world on a server and deserializing it on a client and need to know when an entity has been removed by the server. I would like to be able to potentially miss an update from the server and still keep the client and server synced, so specifically sending a list of ents to remove is not preferable. Rather, I'd like to be able to just have the client determine when an entity has been removed because it is no longer being serialized.
It would make my setup much much simpler if bitECS's deserialization automatically removed entities from the world or returned a list of existing entities which are not present on the world. |
@briancw i can cater to removals being serialized, but i don't think i can generically cater to your specific scenario. it is not typical of networked games to serialize and send the state of all entities every single frame as that is highly inefficient, unless i'm misunderstanding something about your scenario. for example, in the networking system i have devised, i only serialize and send a value for an entity component when the value changes. i also have reliable messages separate from unreliable data updates, and i use a specific |
after pondering this for a bit longer, i think i see where you guys are coming from and what a generic solution might be: |
I use bitEcs in my step-lock game as game states, somehow i let the client to predict next game frame state, if the predict state does not match the server's state, then I want to rollback the state to previous state. I tried to serialize the world every frame and save the packet, then derialize the world with certain frame if the predict is wrong. But the derialization won't delete the entitis created by the prediction. How can I achieve this idea? Any suggestion would be helpful. Or is there any way I can directly repace the world's state with the packet?
Many thanks!
The text was updated successfully, but these errors were encountered: