The new Tafl engine (AI)

Post Reply
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

Draganov wrote: Sun Apr 26, 2026 6:36 am On a smartphone it is difficult to review a game. The move history is bellow and to see the next move we need to scroll down and click on the exact move. Can you add back and forward buttons that are close to the board for easier navigation in a game?
I managed to upload a game in our format. However, to see the move evaluation I need to press the 'Go back' button and then the button 'Make engine move'. Then, the move history is rewritten and the game can't be reviewed forward until I import the moves again.
Is it possible to make the move evaluation visible on each move while reviewing a game? If this is done, we can analyze the games of the world champions and see how well they played.
Maybe it's possioble, but seems to me better to do analyze feature in local interface. I can add something for analyzis maybe, but engine here slower than local one.

I can automate the analysis of many games locally and provide it + statistics, I thought about this yesterday.
And refine it over time as the engine improves :)

Also plan to open source engine today!
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

Engine is open-source now 🚀
https://github.com/sovelin/taflzero
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

Today, I'll try analyzing real player games from a website and automating it to collect statistics (game accuracy, etc.).

We'll see how this correlates across champions and how accurate the engine's assessment is. Currently, it's known that it may not recognize certain strategies, so its assessment won't be the most objective, but it will get stronger in the future.

@Draganov also will add some analysis features in web version I think since the GUI still needs a long time to be developed
Ytreza
Posts: 45
Joined: Tue Aug 27, 2019 5:56 pm

Re: The new Tafl engine (AI)

Post by Ytreza »

That's really great work!

It clearly doesn't know the edge fort rule at the moment. Hopefully it'll soon learn. It makes sense that reinforcement learning takes time to discover complex long-term strategies.

At the very least it will be a good tool for beginners to quickly learn basic tricks. Any AI we had up to now could be trivially beaten even by beginners.
Draganov
Posts: 75
Joined: Fri Oct 30, 2020 2:59 pm

Re: The new Tafl engine (AI)

Post by Draganov »

Sovaz can you try to analyze these games as a beginning. In this forum topic I listed all of the championship games of Schachus from 2014 and all of the championship games of Nath in 2013. I think it is a good point to start analyzing the world champion games from the year they won the championship. I normalized the games so as to start from the most frequently played board side.
viewtopic.php?t=151
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

Draganov wrote: Sun Apr 26, 2026 5:39 pm Sovaz can you try to analyze these games as a beginning. In this forum topic I listed all of the championship games of Schachus from 2014 and all of the championship games of Nath in 2013. I think it is a good point to start analyzing the world champion games from the year they won the championship. I normalized the games so as to start from the most frequently played board side.
viewtopic.php?t=151
Hey, I'm started! :)
I can do this for all games, but it's as example:

Code: Select all

Game 1/100: Draganov vs Alex hnefatafl  [2026.04.24]  (9 moves)
  [1/9] black d1d3  winrate 38.6%
  [2/9] white e5e2  winrate 39.1%
  [3/9] black g1g3  winrate 42.5%
  [4/9] white h6h3  winrate 41.1%
  [5/9] black g3e3  winrate 45.5%
  [6/9] white g7j7  winrate 45.2%
  [7/9] black f10i10  winrate 56.7%
  [8/9] white g5j5  winrate 56.5%
  [9/9] black f2j2  winrate 59.0%
  White accuracy: 99.5%  |  Black accuracy: 95.5%
(Locally I have downloaded ~15K games)

Also will take a look your games too.
Of course it's engine eval and not absolute. In some positions engine could not be right.
Draganov
Posts: 75
Joined: Fri Oct 30, 2020 2:59 pm

Re: The new Tafl engine (AI)

Post by Draganov »

This type of evaluation looks good. It will be nice to analyze the championship games of the world champions in this way and see how accurate they played in their best years.
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

Ytreza wrote: Sun Apr 26, 2026 4:53 pm That's really great work!

It clearly doesn't know the edge fort rule at the moment. Hopefully it'll soon learn. It makes sense that reinforcement learning takes time to discover complex long-term strategies.

At the very least it will be a good tool for beginners to quickly learn basic tricks. Any AI we had up to now could be trivially beaten even by beginners.
Thank you!
We'll see what happens next. Patterns can learn like a snowball.

This happened with corners: after about 15-20 million positions, it understands them and starts quickly using them in the game. This happened in all my runs.

Other patterns are more complex, and I hope they will appear as well.
6x64 is running in the browser. I think it could have been stronger, and I stopped training early and started lowering the learning rate too early.
The current size of the network learning is 10x128 (about 5 times larger). I think it will take a long time to finish training. It should accommodate everything, I think.
Alpha zero and Lc0 had 20x256 (8 times larger) some time ago, but that's currently excessive and very expensive to train. They also started with small networks.


--------

About forts: engine do it in training but it's not enough to learn it for now. In the future it should be changed, but we don't know when.

Code: Select all

Chunk #172 [games 1720001–1730000]  avg_len=117
  ATK 6105 ( 61.1%)  DEF 3895 ( 39.0%)  DRAW    0 (  0.0%)
    atk_capture          4462  ( 44.6%)
    atk_surrounded        246  (  2.5%)
    atk_no_moves         1397  ( 14.0%)
    def_corner           3881  ( 38.8%)
    def_fort               14  (  0.1%)

Chunk #173 [games 1730001–1740000]  avg_len=119
  ATK 6142 ( 61.4%)  DEF 3858 ( 38.6%)  DRAW    0 (  0.0%)
    atk_capture          4462  ( 44.6%)
    atk_surrounded        198  (  2.0%)
    atk_no_moves         1482  ( 14.8%)
    def_corner           3844  ( 38.4%)
    def_fort               14  (  0.1%)

Chunk #174 [games 1740001–1750000]  avg_len=124
  ATK 6130 ( 61.3%)  DEF 3870 ( 38.7%)  DRAW    0 (  0.0%)
    atk_capture          4506  ( 45.1%)
    atk_surrounded        227  (  2.3%)
    atk_no_moves         1397  ( 14.0%)
    def_corner           3861  ( 38.6%)
    def_fort                9  (  0.1%)
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

I analyzed some people's games:

Code: Select all

Plantagenet          overall 96.9%   white 97.1% (31g)  |  black 96.9% (85g)
Casshern             overall 96.5%   white 95.6% (288g)  |  black 97.4% (281g)
Luizz                overall 95.8%   white 95.9% (420g)  |  black 95.7% (425g)
Draganov             overall 95.7%   white 95.3% (486g)  |  black 96.1% (485g)
Alex hnefatafl       overall 95.7%   white 95.5% (453g)  |  black 95.8% (454g)
Rollo                overall 95.3%   white 96.0% (18g)  |  black 94.6% (18g)
Zubin                overall 93.7%   white 94.6% (53g)  |  black 92.9% (53g)
I believe the engine isn't powerful enough yet to accurately analyze top players' games.
This is also a quick analysis on 100 nodes, as there are a lot of games. :)
But perhaps individual games could be analyzed better.
sovaz1997
Posts: 46
Joined: Fri Apr 24, 2026 9:47 am

Re: The new Tafl engine (AI)

Post by sovaz1997 »

@Draganov I tested 1st game between Schachus and Duruk:
On 100 nodes

Code: Select all

Game 1/1: Schachus vs Duruk[2026.04.27]  (12 moves)
  [1/12] black f2i2  winrate 50.0%
  [2/12] white f4c4  winrate 37.1%
  [3/12] black b6b3  winrate 47.6%
  [4/12] white f5f2  winrate 42.7%
  [5/12] black d1d2  winrate 49.0%
  [6/12] white c4c2  winrate 45.3%
  [7/12] black b3b2  winrate 58.9%
  [8/12] white f6f3  winrate 61.0%
  [9/12] black j6j3  winrate 52.5%
  [10/12] white f3a3  winrate 91.7%
  [11/12] black b2a2  winrate 96.4%
  [12/12] white a3b3  winrate 97.0%
White accuracy: 96.4%  |  Black accuracy: 94.2%
And on 10K nodes analysis was much better:

Code: Select all

Game 1/1: Schachus vs Duruk[2026.04.27]  (12 moves)
  [1/12] black f2i2  winrate 43.0%
  [2/12] white f4c4  winrate 36.5%
  [3/12] black b6b3  winrate 45.4%
  [4/12] white f5f2  winrate 44.5%
  [5/12] black d1d2  winrate 50.1%
  [6/12] white c4c2  winrate 44.5%
  [7/12] black b3b2  winrate 63.7%
  [8/12] white f6f3  winrate 62.7%
  [9/12] black j6j3  winrate 98.5%
  [10/12] white f3a3  winrate 98.3%
  [11/12] black b2a2  winrate 98.4%
  [12/12] white a3b3  winrate 98.4%
White accuracy: 97.6%  |  Black accuracy: 87.7%
Post Reply