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

Add the ability to download maps #46

Open
1 of 4 tasks
billyb2 opened this issue Aug 2, 2021 · 0 comments
Open
1 of 4 tasks

Add the ability to download maps #46

billyb2 opened this issue Aug 2, 2021 · 0 comments
Labels
enhancement New feature or request HARD This is difficult, and will require a lot of time and effort net Networking code stuff

Comments

@billyb2
Copy link
Owner

billyb2 commented Aug 2, 2021

Currently, two players need to both have the same map that the host requests for the game to work, if not, it'll crash (probably should be its own TODO to handle error cases).

The ability to download a mpa that a client or host doesn't have would make the playability of the game much easier, and would allow for a much easier use of custom maps.

How could this work?

What I'm currently thinking is making it so bevy_networking_turbulence first sends the metadata of the map (obviously), then it sends the length of the MapObjects vector. Then, iti sends every map object as a byte aray, with a u32 to show the index of each map object. Why do this? Map objects, currently, need to be in a very exact order for the CRC32 to properly identify them, and even one change to the order can change the CRC32 significantly. (A way of fixing that would be to first sort the map objects by their coords, then do the crc32, so that no matter what order the map objects are in it'll be exactly the same, but I don't care enough to do that). Anyways, so the client receiving the maps keeps telling the host who's sending the maps what map objects are missing, until the length of the map_objects vectors match up on both sides, then, the client sends a "finished" message to tell the host to stop sending map objects.

  • Sends metadata
  • Sends map objects
  • Checks CRC32 + map corruption
  • Works consistently
@billyb2 billyb2 added enhancement New feature or request HARD This is difficult, and will require a lot of time and effort net Networking code stuff labels Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HARD This is difficult, and will require a lot of time and effort net Networking code stuff
Projects
None yet
Development

No branches or pull requests

1 participant