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

Improve Server endpoint for fetching the game state #268

Open
merowin opened this issue Jun 10, 2024 · 0 comments
Open

Improve Server endpoint for fetching the game state #268

merowin opened this issue Jun 10, 2024 · 0 comments

Comments

@merowin
Copy link
Collaborator

merowin commented Jun 10, 2024

The implementation of the server function for fetching the game state (getGameState) is not ideal. The basic problem is that there can be multiple moves within a round, and it is not 100% clear at which point we should return the state (e.g. at the start of the round or at the end of the round, etc.).

For example for parallel moves variants, we want to display the staged moves of the current round, but not for past rounds. So we implemented it s.t. the start of round is returned for past rounds, and the latest state is returned for the current round. But I'm not sure if this system is sensible for all kinds of variants.
Also for variants without staged moves and such, the implementation is not as efficient as possible (we compute the game twice in the case that we fetch a past round).

Here are the points that we should think about / improve if possible:
1.) Is the current system sensible for all possible variants? (If not, what would be a better way?)
2.) Can we make the implementation more efficient? (E.g. avoid computing the game twice)

See also this conversation:

I used a naive solution for the gameState endpoint on the server, that is probably not as efficient as possible

🥳 looks good! For efficiency, I'm not too concerned, but feel free to open an issue (we could mark as "good first issue" since it seems relatively self contained, and isn't causing much harm as-is)

Originally posted by @benjaminpjones in #267 (comment)

@merowin merowin added the good first issue Good for newcomers label Jun 10, 2024
@merowin merowin removed the good first issue Good for newcomers label Nov 17, 2024
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