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 batch module for analyzing and replaying games #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zeitlinger
Copy link
Member

@zeitlinger zeitlinger commented Aug 14, 2021

Based on #162

add batch module for analyzing and replaying games

@gitpod-io
Copy link

gitpod-io bot commented Aug 14, 2021

@coyotte508
Copy link
Member

Very nice!

@coyotte508
Copy link
Member

The scripts should probably be in boardgamers-mono (maybe add a function in wrapper.ts to collect the stats)

@zeitlinger
Copy link
Member Author

The scripts should probably be in boardgamers-mono (maybe add a function in wrapper.ts to collect the stats)

both replay and stats?
Can you elaborate a little how this could work?
The idea is to run the stats and replay locally - it uses quite some CPU.

@coyotte508
Copy link
Member

The stats code - getStats and getDetailStats can be moved to wrapper.ts in this repo, maybe gameStats() andplayerStats().

The batch replay code can definitely be moved to boardgamers-mono.

The batch stats code can definitely also be moved to boardgamers-mono.

Both batch code could be in a game-server/scripts folder. They would use the getEngine function of game-server/app/services/engine.ts.

As for running locally - it's possible! The only thing needed is to run the seed command (maybe update the GP version as well in seeds.json) to configure boardgamers-mono with the correct GP version. You can run the scripts locally. I could also give you ssh access to the server to run stats locally but on the distant server (with port forwarding).

@zeitlinger
Copy link
Member Author

OK, sounds like a solid plan - but will take some time.

We can either merge the PR as is and create a follow-up ticket - or I'll extract the other useful changes (permissive replay) into another PR.

And any help is welcome, of course 😄

@coyotte508
Copy link
Member

I modified the batch replay command in boardgamers-mono/game-server to also be available as a script: boardgamers/boardgamers-mono@3138d8a

I added doc about a stats command: http://docs.boardgamers.space/guide/engine-api.html#stats (the corresponding script will still need to be added in game-servers)

I think you can:

  • keep the replayability changes to Engine
  • move getStats to a new exported stats() function in engine/wrapper.ts

All that will be left is to create a stats writer script in boardgamers-mono/game-server, which should be fairly simple!

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

Successfully merging this pull request may close these issues.

2 participants