Skip to content
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

Stop units from seeing the post-update versions of other units #38

Open
46bit opened this issue Oct 4, 2020 · 0 comments
Open

Stop units from seeing the post-update versions of other units #38

46bit opened this issue Oct 4, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@46bit
Copy link
Owner

46bit commented Oct 4, 2020

RTT's update loop iterates over each player, running an update function on every unit one by one. This means that different units see a different state of the world. Worse it means that some players are at advantage as they see the future positions of their opponents.

I previously experimented with an Entity Component System. I've uploaded that to https://gist.github.com/46bit/aca9571c67c553c7223c1f9f1c61d879. That setup prevents this problem very efficiently, by having two buffers of the same size and alternating them similar to blue-green deploys. So long as RTT uses dynamic state and references (even circular references) this is not so easy.

Unless I really want to adopt an ECS or command-passing architecture, the best thing I can do is to get rid of most of the direct references and refer to things by ID instead. That will simplify cloning.

@46bit 46bit added the bug Something isn't working label Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant