Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit 1d85b02

Browse files
committed
Move documentation from wiki to .md files
1 parent b1e2ceb commit 1d85b02

File tree

3 files changed

+141
-10
lines changed

3 files changed

+141
-10
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ You can find it here: https://github.com/MahjongRepository/mahjong
1414

1515
For research purposes we built a simple bot to play riichi mahjong on tenhou.net server.
1616

17-
Here you can read about bot strength: https://github.com/MahjongRepository/tenhou-python-bot/wiki/Bot-versions
17+
Here you can read about bot played games statistic: [versions history](doc/versions.md)
1818

1919
# For developers
2020

2121
## How to run it?
2222

2323
1. `pip install -r requirements/dev.txt`
24-
2. Run `cd project && python main.py` it will connect to the tenhou.net and will play a game
24+
2. Run `cd project && python main.py` it will connect to the tenhou.net and will play a game.
2525

2626
## Configuration instructions
2727

@@ -30,12 +30,6 @@ They will override settings from default `settings.py` file.
3030
2. Also, you can override some default settings with command arguments.
3131
Use `python main.py -h` to check all available commands.
3232

33-
## Round reproducer
33+
## Game reproducer
3434

35-
It can be useful to debug bot crash or strange discards: https://github.com/MahjongRepository/tenhou-python-bot/wiki/Round-reproducer
36-
37-
## Contribution to the project
38-
39-
All PRs are welcomed anytime. Currently the project is in early stage and
40-
I'm working on the different parts of it in the same time, so before making any
41-
big changes it's better to check with me to avoid code duplication.
35+
It can be useful to debug bot errors or strange discards: [game reproducer](doc/reproducer.md)

doc/reproducer.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## Round reproducer
2+
3+
We built the way to reproduce already played round.
4+
This is really helpful when you want to reproduce table state and fix bot bad behaviour.
5+
6+
There are two options to do it.
7+
8+
### Reproduce from tenhou log link
9+
10+
First you need to do dry run of the reproducer with command:
11+
12+
```
13+
python reproducer.py -o "http://tenhou.net/0/?log=2017041516gm-0089-0000-23b4752d&tw=3&ts=2" -d
14+
```
15+
16+
It will print all available tags in the round. For example we want to stop before
17+
discard tile to other player ron, in given example we had to chose `<W59/>` tag as a stop tag.
18+
19+
Next command will be:
20+
21+
```
22+
python reproducer.py -o "http://tenhou.net/0/?log=2017041516gm-0089-0000-23b4752d&tw=3&ts=2" -t "<W59/>"
23+
```
24+
25+
And output:
26+
27+
```
28+
Hand: 268m28p23456677s + 6p
29+
Discard: 2m
30+
```
31+
32+
After this you can debug bot decisions.
33+
34+
### Reproduce from our log
35+
36+
Sometimes we had to debug `bot <-> server` communication. For this purpose we built this reproducer.
37+
38+
Just use it with already played game:
39+
40+
```
41+
python reproducer.py -l d6a5e_2017-04-13\ 09_54_01.log
42+
```
43+
44+
It will send to the bot all commands that were send from tenhou in real game.

doc/versions.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
### 0.4.0 version
2+
3+
Version with various improvements in hand building and melds calling.
4+
5+
This version had played ~1000 games (hanchans) and achieved fourth dan (四段) a couple of times.
6+
7+
Stable rank was a second dan (二段) and stable rate was ~R1600.
8+
9+
Stat:
10+
11+
| | Result |
12+
| --- | --- |
13+
| Average position | 2.53 |
14+
| Win rate | 19.21% |
15+
| Feed rate | 11.78% |
16+
| Riichi rate | 18.48% |
17+
| Call rate | 24.41% |
18+
19+
| Places | |
20+
| --- | --- |
21+
| First | 20.92% |
22+
| Second | 27.46% |
23+
| Third| 30.17% |
24+
| Fourth | 21.45% |
25+
| Bankruptcy | 6.19% |
26+
27+
The number of fourth places was decreased.
28+
29+
### 0.3.2 version
30+
31+
Version with various improvements.
32+
33+
This version had played 600 games (hanchans) and achieved fourth dan (四段) once.
34+
35+
Stable rank was a first dan (初段).
36+
37+
Stat:
38+
39+
| | Result |
40+
| --- | --- |
41+
| Average position | 2.53 |
42+
| Win rate | 19.97% |
43+
| Feed rate | 10.88% |
44+
| Riichi rate | 15.80% |
45+
| Call rate | 36.39% |
46+
47+
| Places | |
48+
| --- | --- |
49+
| First | 22.41% |
50+
| Second | 25.52% |
51+
| Third| 28.28% |
52+
| Fourth | 23.79% |
53+
| Bankruptcy | 4.48% |
54+
55+
### 0.2.5 version
56+
57+
This version is much smarter than 0.0.x versions. It can open hand, go to defence and build hand more effective.
58+
59+
This version had played 375 games (hanchans) and achieved second dan (二段).
60+
61+
Rate was somewhere around R1500.
62+
63+
Stat:
64+
65+
| | Result |
66+
| --- | --- |
67+
| Average position | 2.65 |
68+
| Win rate | 18.60% |
69+
| Feed rate | 10.59% |
70+
| Riichi rate | 15.64% |
71+
| Call rate | 34.89% |
72+
73+
### 0.0.5 version
74+
75+
It can reach a tempai and call a riichi. It doesn't know about dora, yaku, defence and etc.
76+
Only about tempai and riichi so far.
77+
78+
This version had played 335 games (hanchans) and achieved only first dan (初段) on the tenhou.net so far
79+
(and lost it later, and achieved it again...).
80+
81+
Rate was somewhere around R1350.
82+
83+
Stat:
84+
85+
| | Result |
86+
| --- | --- |
87+
| Average position | 2.78 |
88+
| Win rate | 20.73% |
89+
| Feed rate | 19.40% |
90+
| Riichi rate | 36.17% |
91+
| Call rate | 0% |
92+
93+
So, even with the current simple logic it can play and win.

0 commit comments

Comments
 (0)