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

Figuring out the data layout #35

Open
bskinn opened this issue Oct 21, 2023 · 4 comments
Open

Figuring out the data layout #35

bskinn opened this issue Oct 21, 2023 · 4 comments
Labels
type: question ❔ Something to investigate

Comments

@bskinn
Copy link
Owner

bskinn commented Oct 21, 2023

What thoughts on data topology? 3P3 gives six options:

  1. Player-turn-stat
  2. Player-stat-turn
  3. Turn-player-stat
  4. Turn-stat-player*
  5. Stat-player-turn
  6. Stat-turn-player

Implicit in any of these is a 4th layer, of per-card data where relevant (cached food count, etc.)

As with the current score scraper, I'd consider per-round stuff as happening in its own turn, between rounds. Same for end-of-game.

Non-player-specific per-turn info (NPSI) would have to be handled differently depending on where Player falls in the hierarchy. To my mind, this argues for Player being at the innermost level, because then NPSI could live as a sibling to it.

The current scraper uses format 4. Game-invariant data (first turn assignment, winner, etc.) lives at the root of the object. I feel like 3 and 4 would be the easiest for me to code on the creation side, but they might be more awkward on the usage side. Not sure, though. And, since I'm not sure, I'm inclined to go with what'll be easiest now.

@bskinn bskinn added the type: question ❔ Something to investigate label Oct 21, 2023
@jbialo
Copy link
Collaborator

jbialo commented Oct 21, 2023

I've been running with an approximation of #3 on my end, representation of a game looks something like:

  • Game
    • GameState[]
      • Birdfeeder/Tray/etc.
      • Player[]
        • Score
        • Food
        • Hand
        • Habitat[3]
          • BirdState[5]
            • Eggs
            • CachedItems
            • ActivationCount

@bskinn
Copy link
Owner Author

bskinn commented Oct 21, 2023

Mmm, activation count.

@bskinn
Copy link
Owner Author

bskinn commented Oct 21, 2023

I would really like to have Typescript for this. It would help avoid a lot of mistakes. Will have to check if it's possible.

Maybe a manual TS->JS build step to /dist...

@bskinn
Copy link
Owner Author

bskinn commented Oct 21, 2023

Looks like that should be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question ❔ Something to investigate
Projects
None yet
Development

No branches or pull requests

2 participants