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
Networking & Multiplayer #16
Comments
This lays in the future, but |
Just putting down some thoughts for different multiplayer architecture Distributed Actor SystemWhere actors are distributed between different systems and messages between different systems will just be passed using the internet. Pros
Cons
Deterministic Delayed LockstepEach player keeps a version of the game state and receives the "actions" which other players did, which is then applied on the game state. So only the input and initial game state need to be sent between players. Pros
Cons
ExamplesSee Factorio, they used this method successfully in a simulation game with tens of thousands (maybe even millions) of objects. |
I believe DAS to be the superior system; if we can get it to work correctly. Right now we only have some loose idea of how, and if, it would work. I think we should build a small test in the near future. That test should only depend on kay and the networking stack. We can then benchmark network usage and see if it is at all viable. |
I think the problem with DAS is that it should be easy to make it work, but under the naive implementation (every actor which needs to be rendered receives a render message every frame and replies with the geometry it would like to be rendered) the bandwidth requirements would be absolutely massive (100k cars =~300mbps). |
I won't disagree with that, but we can make some assumptions about what resources the game has available. E.g. geometry could simply be a model ID. DAS would initially be a beast to optimize to useable levels, but the payoff is potentially pretty big. |
Just to clarify, the 300mbps is not sending the polygons over the network (which would be in the 10s of gbps), it is calculated by (16 bit model id + 3*32 bit XYZ cords) * 60 fps * 50k cars. |
You're right. I guess I didn't think of the mathematics of scale. DDL is probably the only realistic option for a scalable implementation, even with the drawbacks. |
Hrm, with since more thought, it might be possible to make DAS possible. We would need to be able to extrapolate from the car data for maybe a second, which would allow a 10x reduction in bandwidth. |
With DAS, we would want to use UDP, and build a reliable and ordered layer on top of that. Something like a 16-bit message ID number and after that just push as many bytes of messages up to a user configurable max packet size (maybe we should have a custom checksum as well, as the UDP one is very weak and only 16 bits). |
No description provided.
The text was updated successfully, but these errors were encountered: