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

Simplify JSON sent #3

Open
coyotte508 opened this issue Oct 10, 2018 · 1 comment
Open

Simplify JSON sent #3

coyotte508 opened this issue Oct 10, 2018 · 1 comment
Milestone

Comments

@coyotte508
Copy link
Member

With engine.options.map, we now have the configurations (sectors, rotations).

We just need to send that configuration, and changes (transdim planets gaiaformed, and other extra data like buildings, federations...).

This would cut down a lot on network traffic & database storage.

This can be done on a toJSON() or toString() method of GaiaHex:

  • only include planet if it's a gaia planet (as it may have been changed)
  • include remaining data

Actually since the map is grouped into sectors, the export can be done like this:

[{"sector": "1", "data": [,,,{"planet": "gaia", "building": "m", "player": 0},,,,,{"federations": [1,2]},]}, ...]

There's no need to even serialize coordinates as we can extrapolate the info from the sector & the index of the hex

@coyotte508 coyotte508 transferred this issue from boardgamers/gaia-engine Feb 18, 2021
@coyotte508
Copy link
Member Author

We can also, like with Take 6, only send log slices when a game is updated

@coyotte508 coyotte508 added this to the Breaking milestone Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant