Shogi plea

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: Shogi plea

Post by Laskos »

hgm wrote:Image

Shogi (Japanese Chess) is a truly fantastic game, if you consider the abstract board game, cleansed from any cultural excesses (such as kanji pieces). The more games I watch, the more I start to appreciate how much better it is than FIDE Chess. Draws are virtually non-existent, and a game is really never decided before checkmate. I have seen pretty strong engines lose from positions that evaluated as +22 (where Rook = 5, as usual).

It is really a pity that we, Chess-engine authors as a group, do not create more Shogi engines. It is a much more challenging task than creating a Chess engine, as for the latter it is pretty much known how exactly you have to do it, and you just follow the recipe. For Shogi, OTOH, there is still very much to discover and invent.

It is perfectly possible to write a Shogi engine without ever having played the game. My own Shogi engine, Shokidoki, is virtually without knowledge, but I had its rating determined by playing it on the 'Floodgate' server. This is a server that continuously plays medium-TC (15min sudden-death) comp-comp games, and calculates a rating based on those that should be comparable to human ratings on 'Shogi Club 24'. The rating corresponded to a good 2-Dan ranking on that server. Not bad at all, for a knowledge-poor 1-CPU program. And I haven't even tuned the piece values.

Millions of people play Shogi, and the yearly computer-Shogi World Championship has many times more participants that any computer-Chess tournament.

As WinBoard supports Shogi, the usual tools are available for developing an engine. You can play fast games, a fair amount of opponent engines are available for setting up a gauntlet (including many strong ones that can be brought into the required rating range by time odds, saving extra CPU time).

So people, please consider Shogi. Otherwise you don't know what you are missing! 8-)
From what I saw several years ago, Shogi seems VERY tactical game, with all its promotions and even worse, drops. I think, if it would have been taken much more seriously by serious programmers, a bot would beat all humans in a year or so.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Shogi plea

Post by hgm »

It is a very tactical game, but strategy (building of King fortresses) also plays a significant role. A technical problem is that, because of the drops, there aren't really any quiet positions. Again because of the drops, the branching ratio is far larger than that of Chess.

AI researchers do take Shogi very seriously (in Japan...), and have written extremely strong codes. This year's man-machine contest against Shogi professionals was won by the machines. But it is not as easy as for Chess. Data mining / expert-knowledge extraction has been a very important ingredient. Quite unlike Chess, where you can simply think up an evaluation with piece values, mobility weights, Pawn structure and King safety behind the drawing board, and be already at GM level.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Shogi plea

Post by Ferdy »

hgm wrote:Then perhaps your /uxiAdapter option is not set for Shogi. -fUSI invokes this adapter, by replacing the engine command by the uxiAdapter string (and ignoring any -fd), where in that string it again replaces any %xxx by the value of WB string option -xxx. So the uxiAdapter string should be set to

UCI2WB -s "%fcp" "%fd"

to call UCI2WB with the engine.exe and engine folder as parameters (as UCI2WB likes it). It could still be set for UCCI Xiangqi engines.
I just know this /uxiAdapter :), now I change its value, and your sample command lines work now.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Shogi plea

Post by hgm »

I managed to get SPEAR 1.4 running under UCI2WB as well. Before it always crashed when it had to move. Turns out it has no valid hash size by default, and needs a setoption command for it, but does not get it from UCI2WB, because it does not announce the hash option. So by putting a file DefectiveEngineOptions.ini in the folder with the SPEAR .exe containing

Code: Select all

option name USI_Hash type spin default 32 min 1 max 256
option name USI_Ponder type check default false
I can now run it, and it even responds to WinBoard's hash setting. I added it to the rating list, but did not play against the engines weaker than ~1300 (which is mostly a waste of time). Adding SPEAR 1.4 is interesting, because between 1.4 and 1.5 Reijer Grimbergen completely rewrote the evaluation, so that it really should be considered a different engine.

I was puzzled a bit why the rating difference between Spear 1.5 and Shokidoki i found here was about twice what it was on the Floodgate server, where I also played both of them for nearly 200 games. The strongest engines in a rating list are usually asymmetrically tested, playing only weaker opponents, which can produce systematic errors. So I decided to restore that balance by adding a still stronger engine, my own (32-bit) compile of Bonanza 6.0, severely handicapped by 15x time odds. (Even then it still wipes the floor with the other engines...) It turns out that Shokidoki is much better at scoring points against stronger engines than SPEAR (probably because it is dependent on luck for chosing a good strategical plan, rather than on knowledge). I played Bonanza only against Shokidoki, SPEAR 1.5 and SPEAR 1.4 (the latter already having great problems scoring any wins at all against Bonanza, only 10%). I did not want to play it against too many versions of the same engine, and to compensate for the low number of opponents and small losing rate I played it about 50 games against each of those.

This gives the following updated list:

Code: Select all

Rank Name                        Elo    +    - games score oppo. draws
   1 Bonanza 6.0.WB1 t/15       2244   73   73   158   83%  1962    0%
   2 SpearCSA2009v1.5 (USI2WB)  2041   66   66   265   76%  1606    0%
   3 SPEAR 9                    2009   81   81   210   88%  1440    1%
   4 Shokidoki tori             1930   65   65   262   69%  1603    1%
   5 SPEAR 8                    1916   74   74   210   83%  1445    2%
   6 SpearCSA2008v1.4 (USI2WB)  1908   68   68   171   52%  1868    1%
   7 SPEAR 7                    1896   74   74   210   80%  1446    0%
   8 SPEAR 6                    1725   68   68   210   69%  1454    1%
   9 Laramie V3 (USI2WB)        1671   68   68   209   64%  1460    0%
  10 TJshogi 0.10               1641   67   67   210   62%  1458    0%
  11 SPEAR 5                    1525   67   67   200   56%  1441    2%
  12 Shokidoki t/15             1490   66   66   210   50%  1465    1%
  13 ssp (USI2WB)               1420   66   66   210   45%  1468    2%
  14 NebiyuAlien_1.43           1419   66   66   210   45%  1468    0%
  15 Laramie t/15               1332   68   68   206   37%  1487    0%
  16 SPEAR 4                    1302   68   68   200   37%  1452    2%
  17 SPEAR 3                    1262   69   69   200   34%  1454    4%
  18 Siyam v0.27                1258   70   70   200   34%  1454    2%
  19 TJshogi t/15               1236   72   72   200   33%  1456    0%
  20 SPEAR 2                     917   93   93   200   14%  1472    0%
  21 SPEAR 1                     913   91   91   200   14%  1472    2%
  22 GNU Shogi 1.4.0p0           725  113  113   195    6%  1483    1%
  23 Lesserkai 1.3.6 (USI2WB)    720  112  112   200    6%  1481    2%
The distance between SPEAR 1.5 and Shokidoki is now very close to what it was on Floodgate (~100 Elo). SPEAR 1.4 is significantly weaker than 1.5 (i.e. switching to an evaluation automatically tuned from GM games was a good move), and even scores below Shokidoki.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Shogi plea

Post by JoshPettus »

For one thing it would be nice to have more shogi engines i can compile for OSX :) There are only a few I can use, and most of them are all thanks to Mr. Muller!