shogi variant software

Discussions about Winboard/Xboard. News about engines or programs to use with these GUIs (e.g. tournament managers or adapters) belong in this sub forum.

Moderator: Andres Valverde

shogi variant software

Postby kuribas » 08 Jan 2015, 15:27

Hi,

I noticed that there has been some work to port shogi variants to x/winboard.
It may interest you that I have written some code to support shogi and chess
variants. I wrote a service for several shogi variants which can run on the generic
game server (https://skatgame.net/mburo/ggs/).
https://github.com/kuribas/ShogiGGS
It is currently ofline, since it wasn't used, but I could put it back online if requested.

I also wrote an interface library for chess variants, similar to xboard,
but adapted for most variants. It is independend of the toolkit and platform.
It was designed to handle dragging pieces, highlighting, etc.. without extra
effort for the programmer:
https://github.com/kuribas/gcboard
It hasn't been updated in a while, so it probably doesn't work out of the box anymore.
I am planning to port it to wxhaskell, to make a chess variant interface.

There are also several shogi pieces that I modified from Steve Evans
shogivar software. You can find them on: https://github.com/kuribas/ShogiVariant
Both me and Steve Evans own the copyright, but I allow the use in any free software
project. Just drop me a note if you want to use it for anything else.

Kristof Bastiaensen
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby H.G.Muller » 08 Jan 2015, 19:25

Interesting projects. Win/XBoard has been evolving in the direction of a general strategic-board-game interface too. That the engine can now (in version 4.8) configure the GUI to get full rule knowledge of the game at hand has been a big leap forward. Before that supporting a new variant required addition of new game-specific code, or accepting the loss of a lot of functionality (like move-legality checking and target-square highlighting). Now a variant like Team-Mate Chess that I added to the Fairy-Max engine, about which WinBoard knows nothing at all, can be played like it was a standard variant.

Servers for rarely played games are always a problem. Even on 81dojo.com the Chu-Shogi server is hardly populated. Although it seems to help a lot to have an AI bot running there.

For rare games peer-to-peer seems a better solution, but unfortunately it raises many technical problems with port translation and firewalls, which many people would not be able to overcome. I experimented a bit with a relay server, which could be used to connect two parties using the same password, without posing any requirement on the content that was relayed. This worked fine with the WinBoard p2p adapter.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby H.G.Muller » 09 Jan 2015, 11:12

Btw, I did not manage to build gcboard. It does not recognize GtkType as a defined type, and replacing it by GType still leaves errors in many other places. This is on Ubuntu 10.04, but even if the GTK2+ I have there is too old, the ./configure should have caught that.

Code: Select all
gtkcboard.c: In function 'set_timer':
gtkcboard.c:81: warning: assignment from incompatible pointer type
In file included from gtkcboard.c:179:
gcb_common.c: In function 'gcb_new_board':
gcb_common.c:555: warning: incompatible implicit declaration of built-in function 'memset'
gcb_common.c: In function 'gcb_set_grid':
gcb_common.c:665: warning: incompatible implicit declaration of built-in function 'memset'
gcb_common.c: In function 'gcb_set_grid_highlight_pixmap':
gcb_common.c:729: warning: incompatible implicit declaration of built-in function 'memset'
gtkcboard.c: In function 'gtk_cboard_destroy':
gtkcboard.c:380: error: expected expression before 'GtkCBoard'
gtkcboard.c: In function 'gtk_cboard_realize':
gtkcboard.c:407: error: expected expression before 'GtkCBoard'
gtkcboard.c: In function 'gtk_cboard_expose':
gtkcboard.c:480: error: expected expression before 'GtkCBoard'
gtkcboard.c: In function 'gtk_cboard_button_press':
gtkcboard.c:497: error: expected expression before 'GtkCBoard'
gtkcboard.c: In function 'gtk_cboard_button_release':
gtkcboard.c:521: error: expected expression before 'GtkCBoard'
gtkcboard.c: In function 'gtk_cboard_motion_notify':
gtkcboard.c:539: error: expected expression before 'GtkCBoard'
make: *** [gtkcboard.lo] Error 1
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby kuribas » 09 Jan 2015, 14:52

I haven't updated the gcboard code for a long time, so I am not surprised it doesn't compile. It wouldn't be difficult to port it to the new gtk API though. I'll keep this board informed of my progress.

The GGS game server I wrote the service for is still running, even though my service isn't. It seems it is mostly used by computer programs, with the exception of some strong human othello players. My service can run remotely, so I could run
this service from a raspberry pi anytime. For rare games it would be important that players can find eachother, so it would be best to keep the community in one place. On the other hand the UI could inform the user which players are available for which games (which GGS supports), and maybe support multiple servers.
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby kuribas » 12 Jan 2015, 02:36

Both the gtk library and the ruby library should now build with recent libraries. There is also a demo
in the ruby/gtk directory, which shows an interface for gnushogi.
Strangely flashing seems to have stopped working, but I am still looking into it.

https://github.com/kuribas/gcboard
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby H.G.Muller » 12 Jan 2015, 13:32

Well, please forgive me that I am a bit of a noob concerning Linux build procedures. But I went to the last link you gave, downloaded a zip file from there, unpacked it, and ran ./configure in its root directory. This complains about install-sh not being present. So I started to copy files from the earlier gcboard-0.3.0 sources, and it turned out I also needed a config.sub, config.guess and ltmain.sh to be able to prevent ./configure aborting with an error. I copied them all from the 0.3.0 release. (No idea if that would be valid).

Then I can do 'make', but this produces the error

Code: Select all
hgm@hgm-xboard:~/gcboard-master$ make
/bin/bash ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -pthread -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12      -g -O2 -c gtkcboard.c
./libtool: line 680: X--mode=compile: command not found
./libtool: line 830: *** Warning: inferring the mode of operation is deprecated.: command not found
./libtool: line 831: *** Future versions of Libtool will require -mode=MODE be specified.: command not found
./libtool: line 974: Xgcc: command not found
./libtool: line 974: X-DHAVE_CONFIG_H: command not found
./libtool: line 974: X-I.: command not found
./libtool: line 974: X-I.: command not found
./libtool: line 974: X-I.: command not found
./libtool: line 974: X-pthread: command not found
./libtool: line 974: X-D_REENTRANT: command not found
./libtool: line 974: X-I/usr/include/gtk-2.0: No such file or directory
./libtool: line 974: X-I/usr/lib/gtk-2.0/include: No such file or directory
./libtool: line 974: X-I/usr/include/atk-1.0: No such file or directory
./libtool: line 974: X-I/usr/include/cairo: No such file or directory
./libtool: line 974: X-I/usr/include/pango-1.0: No such file or directory
./libtool: line 974: X-I/usr/include/gio-unix-2.0/: No such file or directory
./libtool: line 974: X-I/usr/include/glib-2.0: No such file or directory
./libtool: line 974: X-I/usr/lib/glib-2.0/include: No such file or directory
./libtool: line 974: X-I/usr/include/pixman-1: No such file or directory
./libtool: line 974: X-I/usr/include/freetype2: No such file or directory
./libtool: line 974: X-I/usr/include/directfb: No such file or directory
./libtool: line 974: X-I/usr/include/libpng12: No such file or directory
./libtool: line 974: X-g: command not found
./libtool: line 974: X-O2: command not found
./libtool: line 974: X-Wp,-MD,.deps/gtkcboard.pp: No such file or directory
./libtool: line 974: X-c: command not found
./libtool: line 999: Xgtkcboard.c: command not found
X: user not authorized to run the X server, aborting.
./libtool: line 1027: libtool: compile: cannot determine name of library object from `': command not found
make: *** [gtkcboard.lo] Error 1

Then I am kind of lost...
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby kuribas » 12 Jan 2015, 16:59

Sorry, the build system was still in a bit of a mess. If all is well, the following should work now:

sudo apt-get install git autotools-dev libtool gcc libgtk2.0-dev
git clone https://github.com/kuribas/gcboard # (or unzip master.zip)
./autogen.sh
./configure
make
sudo make install

For the ruby lib:

sudo apt-get install ruby-dev ruby-gnome2-dev
cd ruby
ruby extconf.rb
make
sudo make install

Running the demo:

cd demo
./shogi.rb
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby kuribas » 12 Jan 2015, 17:03

Also, the demo needs gnushogi in the path, for example
sudo apt-get install gnushogi
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby H.G.Muller » 13 Jan 2015, 10:27

Nearly there:

I followed your prescription after cloning, and everything worked flawlessly, until I got to the ruby-make. There I got a warning, which later proves to be a fatal error:

Code: Select all
hgm@hgm-xboard:~/gcboard/ruby$ make
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -I/usr/local/lib/site_ruby/1.8/x86_64-linux  -DHAVE_RB_DEFINE_ALLOC_FUNC -DHAVE_RB_BLOCK_PROC -DHAVE_OBJECT_ALLOCATE -DHAVE_NODE_ATTRASGN -DHAVE_GTKCBOARD_H    -fPIC -fno-strict-aliasing -g -g -O2  -fPIC  -Wall -pthread -D_REENTRANT -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12    -c rbgtkcboard.c
rbgtkcboard.c: In function ‘piece_set_pixmap’:
rbgtkcboard.c:232: warning: implicit declaration of function ‘RARRAY_LENINT’
gcc -shared -o gtkcboard.so rbgtkcboard.o -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -pthread    -lruby1.8 -lgtkcboard  -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lpthread -lrt -ldl -lcrypt -lm   -lc
hgm@hgm-xboard:~/gcboard/ruby$ sudo make install
/usr/bin/install -c -m 0755 gtkcboard.so /usr/local/lib/site_ruby/1.8/x86_64-linux
/usr/bin/install -c -m 644 ./lib/gtkcboard.rb /usr/local/lib/site_ruby/1.8
hgm@hgm-xboard:~/gcboard/ruby$ cd demo
hgm@hgm-xboard:~/gcboard/ruby/demo$ ./shogi.rb
ruby: symbol lookup error: /usr/local/lib/site_ruby/1.8/x86_64-linux/gtkcboard.so: undefined symbol: RARRAY_LENINT
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby kuribas » 13 Jan 2015, 14:48

It seems RARRAY_LENINT was introduced in ruby1.9. I have added
the macro to rbgtkcboard.c for backwards compatibility, but I don't have ruby1.8 anymore,
so I couldn't test it. I have only tested the library with ruby1.9.1.
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby kuribas » 13 Jan 2015, 14:52

In any case, I'd recommond using at least ruby version 1.9.
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby H.G.Muller » 13 Jan 2015, 16:09

No luck: now I gat a similar error on 'rb_long2int'.

I then installed the package ruby1.9-dev and ruby-gnome2-dev after removing all ruby-1.8 stuff. But now I get an error already when running ruby:

Code: Select all
hgm@hgm-xboard:~/gcboard/ruby$ ruby1.9 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf-gnome2 (LoadError)
   from extconf.rb:1:in `<main>'

So I guess the infra-structure of my system is not compatible with ruby1.9.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby kuribas » 14 Jan 2015, 02:53

Installing ruby1.9 probably doesn't install the ruby-gtk2 libraries for that version. I've tried to
make it backwards compatible, so you could try again, keeping only the
default ruby versions.
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby H.G.Muller » 14 Jan 2015, 09:47

YES! It works now. :D

When I run ./shogi.rb I get a nice Shogi board, on which I can select, deselect and drag around pieces.

Image

Unfortunately it doesn't seem compatible with GNU Shogi anymore. (I have version 1.4.2+.) First time I ran it, it crashed on the GNU Shogi message that it is going to create book. (And as it tried to create that in a directory where it did not have write permission, it would keep giving that message.) After running "sudo gnushogi" to allow it to create the book and get rid of the message, it still exits after making a move, because it chokes on a message it does not expect.

Code: Select all
hgm@hgm-xboard:~/gcboard/ruby/demo$ ./shogi.rb
./shogi.rb:469:in `parse': Unexpected error: incorrect move by gnushogi: #  1. moves=40,39 time=30000,29256 ResponseTime=100+46 (RuntimeError)
   from ./shogi.rb:445
   from ./shogi.rb:887:in `call'
   from ./shogi.rb:887:in `main'
   from ./shogi.rb:887


But that is another issue. At least it gives me a good impression as to how it is supposed to work.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby kuribas » 14 Jan 2015, 23:20

I have changed it so it will just write the message to stderr, instead of crashing. It strange that
the distro wouldn't set the right permissions on the book directory.
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby H.G.Muller » 15 Jan 2015, 10:55

I probably did not do a proper make-install when I installed GNU Shogi from source. I use a git version, because the latest official release of GNU Shogi does not contain the XBoard-compatibility patches yet.

But back to gcboard, just to make sure I understand what it is about (as I hadn't even heard of Ruby before this...):

Ruby is an interpreted language, which could be used by programmers to implement a GUI. Gcboard is a library with routines that can be called from Ruby (and from C, I suppose), to do the commonly required time-critical tasks of rendering the board and animation of moving and dragging pieces. The latter have to be supplied as xpm images. The library contains services to handle complete creation of the GUI window, including menus etc., all on specifications provided by the Ruby script.

This is a lot more general than XBoard, which aims to provide a ready-to-run binary, with a given menu structure and window design, where the user can only configure the board format and piece images within certain limits (e.g. maximally 16x16 board and upto 44 different piece types), and would need a code change and recompiling to stretch up these limits. Apart from the GUI part XBoard also provides configurable infra-structure for move generation (legality checking, indicating possible destination squares) and game notation, but these services are rather Chess specific, and only configurable within certain limits, if at all.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: shogi variant software

Postby kuribas » 16 Jan 2015, 00:47

In general lines yes, but not intirely accurate:

It's a widget, so doesn't support menus, window generation. That has to be handled by the
system toolkit (gtk in this case). It does provide nice integration.
It's toolkit and platform agnostic, the gtk and gtk-ruby library are a thin layer on the
core functionality. It was written to support shogi-variants, but is not restricted to
it, any chess-like game would work.

You can load any image, it's not restricted to xpm, and supports full alpha transparency.

Gcboard is just a widget, so there is no file loading, move checking, etc... I intended
to write that, but never came to it. I do however have other components:

- Nice wood pieces, based on steve evans's program and other sources, including a nice pictorial tori shogi set.

- A shogi service on the GGS that implements 21 shogi variants. I have managed to compile the service on my raspberry pi,
and you can try it out with telnet:

telnet skatgame.net 5000

Here is a short guide to using GGS: https://github.com/kuribas/ShogiGGS/blo ... GGS/GGS.md
kuribas
 
Posts: 10
Joined: 03 Jan 2015, 16:08

Re: shogi variant software

Postby musketeerchess2015 » 05 Dec 2015, 11:04

Hi
use the Musketeer Chess pieces to play shogi in a western staunton chess set.

www.musketeerchess.com
musketeerchess2015
 
Posts: 1
Joined: 20 Nov 2015, 14:49

Re: shogi variant software

Postby noname003 » 15 Feb 2018, 08:10

musketeerchess2015 wrote:Hi
use the Musketeer Chess pieces to play shogi in a western staunton chess set.

http://www.musketeerchess.com


Thanks a lot. :wink:

แนะนำเมืองบาเซโลน่า

ยาเสพติด
noname003
 
Posts: 4
Joined: 14 Feb 2018, 03:51


Return to Winboard and related Topics

Who is online

Users browsing this forum: No registered users and 21 guests