donkirkby / donkirkby/zero-play

Save a game

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
10
Forks
1
PR merge metrics
No merged PRs in 30d

Description

It would be nice to be able to save a game to a text file like `my_game.zpl`, and load from that text file for later review. Redo the step numbers in the log display to match the standard chess notation of both players' moves on a single number.

Some ideas for formats:

### Plain Text
```
Tic Tac Toe (zero_play.tictactoe.TicTacToeState)
mcts 500 vs. human

1. 1A 1B
X values: 1A: 0.8, 1B: -0.2
O values: 1C: 0.8, 1B: 0.3
2. 2B 2A
X values: 2B: 0.9, 3A: -0.9
O values: 2A: 0.9, 3A: -0.9
```

### Markdown
One benefit is that this format would be easy to include in a journal entry.

```
* Tic Tac Toe (zero_play.tictactoe.TicTacToeState)
* mcts 500 vs. human

1. 1A 1B
* X values: 1A: 0.8, 1B: -0.2
* O values: 1C: 0.8, 1B: 0.3
2. 2B 2A
* X values: 2B: 0.9, 3A: -0.9
* O values: 2A: 0.9, 3A: -0.9
```

### YAML
```
- step: 1
x:
move: 1A
values:
- move: 1A
value: 0.8
- move: 1B
value: -0.2
o:
move: 1B
values:
- move: 1C
value: 0.8
- move: 1B
value: 0.3
```

### Other Ideas
* Maybe append ? for moves with significantly lower value than the best choice.
* Allow reanalysis of the moves in a game, and choose how many iterations to run, or just run a continuous analysis while displaying the number of iterations so far. Separate issue?
* Include other annotations, like the number of times each choice was explored?

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by locating the game log display and the existing game-state or move-handling code, then determine how save/load and the proposed text format should fit together. Done means a game can be saved and loaded for later review, with log step numbers showing both players' moves under one standard chess-notation number.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.