Shogi in Unix/Linux?

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Re: Shogi in Unix/Linux?

Postby Josh Pettus » 29 Oct 2013, 17:15

Speaking of missing files, but completely unrelated. I just keep forgetting to let you know.

In your polyglot branch on your site for 1.4.70b. It says you are missing pgheader.h and pgheader.c to compile. I guess that would explain why.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Shogi in Unix/Linux?

Postby Josh Pettus » 30 Oct 2013, 02:02

Ok, I created a SVG set based on the shogi font. With it including some pieces for the elephant. As well as King and JewelKing for both directions.

The best way to do it i find is to create png images of the pieces in gimp and then use inkscape to trace the bitmaps to create the svg images. The pieces aren't the complicated so they come out well. I did want to do a woodgrain texture for the pieces with only 6 colors but that pushed each piece to 300k+ which is too much for xboard. Particularly with a lot of pieces. (it would work, just slow everything down)

https://dl.dropboxusercontent.com/u/50486448/kanji.zip

{edit]
I uploaded another set with the elephant same size as the king. That's what it seemed more or less the size after looking at a few boards on google anyway
Last edited by Josh Pettus on 30 Oct 2013, 04:47, edited 1 time in total.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Shogi in Unix/Linux?

Postby Josh Pettus » 30 Oct 2013, 02:39

Oh I see the elephant just becomes another King tile as oppose to the Crown Prince. Is that the way it is suppose to be? If so, should I make the elephant out of the King size tile so there isn't as much of a discrepancy?

To be honest I don't understand the 2 kings. How does one capture 2 kings? Must both be checkmated? And if one is mated, is it removed from the board leaving your pieces free to go after the second one? Wouldn't the double opportunity to be checked be a disadvantage? If so, I would think a king would be too important to be of any use and in many ways the elephant would more powerful as it can be threatened.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Shogi in Unix/Linux?

Postby H.G.Muller » 30 Oct 2013, 09:00

In Shogi there is no 'absolute royalty' (first King capture wins) bit only 'extinction royalty' (capture of last King wins). Similar to Spartan Chess (except that there are also rules for 'duple check' there, but in Shogi there is no check, and the aim is to capture the King.

This is the reason the Elephant was abandoned when they inveted piece drops: it made it trivial to create an 'impasse' situation, by dropping the Elephants in the zone and promoting it there.

And indeed, the Crown Prince is logically equivalent to King, so in western representation there was no reason to use another image for it. (Same for promoted Phoenix and promoted Kylin in Chu Shogi.) I guess it should be possible to equip XBoard with a few optional piece images, that are only loaded when they exist (e.g. WhitePrince.svg etc.), and otherwise would be substituted by an image for another piece (like WhiteKing.svg). I also could simply put duplicats of WhiteKing.svg in the default piece set, under the name WhitePrince.svg, because in absence of a piece in the pieceImageDirectory it would automatically fall back on the default pieces.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Shogi in Unix/Linux?

Postby H.G.Muller » 30 Oct 2013, 14:59

I pushed a patch for XBoard that should allow it to display Crown Prince different from King, if an svg file White/BlackPrince.svg is available. I renamed the svg files in the HaChu source package accordingly to also make this work in Chu Shogi.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Shogi in Unix/Linux?

Postby Josh Pettus » 30 Oct 2013, 16:51

That's great work I'll certainly give it look.

Is my shogi svg set acceptable? I know it isn't the xShogi set you were thinking of but the windows Shogi font did have a 3d look that seems to have carried through. Or do you prefer the way xShogi did it? For the elephant I merged the piece with your chu kanji piece which I think came out passably. It also had both a Jeweled and Regular King for both directions so you could experiment.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Shogi in Unix/Linux?

Postby H.G.Muller » 30 Oct 2013, 19:46

the new Shogi kanji pieces look very nice. I wonder what the best strategy would be for distributing board & piece themes. I don't want to include multiple sets of Shogi pieces with the regular XBoard install. In fact it is sort of dubious we include any kanji pieces at all; most people would never use them. Perhaps we should set up a web page at GNU Savannah where people can download piece themes. Then we could offer several Shogi sets.

Was it very much work to convert the pieces to SVG with inkscape? I think it would be great if we would also have the old xShogi pieces in svg.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Shogi in Unix/Linux?

Postby Josh Pettus » 30 Oct 2013, 21:33

Not too long, a minute a piece once you get the process down. The number of pieces does make it time consuming though. It's really creating the origional raster images in the first place that was the tricky part. I like do all my coloring work at that stage, though you can do stuff to the image once it is SVG.

A step by step in inkscape
1. open the .png image directly in inkscape or under the file open and click embed. This will create the appropriate workspace as well the "size" of the image.
2. select the image with the arrow tool
3. go to Path->Trace Bitmap
4. It gives you a bunch of methods to trace the bitmap. for these, I like multiple scans by color. Limit the number scans to the number of colors in the image including the white background. Id check Smooth (will limit the size by simplifying the geometry and not try to copy any aliasing) Stack Scans, and Remove Background.
5. click update to give you a preview and press OK. It will generate the SVG image.
6. This method will generate the image by taking each color and creating an object and stacking them together like a layer cake. you can click on each object and change its color if you want.
7. Delete the old raster image underneath (which is easily selectable if you had it remove the background when generating the svg image) and save the new svg image.

This works well with simple colored images, but if you want something like textures, that makes the geometry complex and increases the files size drastically. Also try to keep the number of layers down to the number of colors, or you will get redundancy.
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Re: Shogi in Unix/Linux?

Postby Josh Pettus » 30 Oct 2013, 23:07

A spot the the GNU webpage for extra pieces and themes probably wouldn't be a bad idea. Even for chess, I could see people getting bored with the default ones and downloading pieces they like. Yah, I highly doubt most people would use the kanji pieces and xiangqi tiles
Josh Pettus
 
Posts: 317
Joined: 11 Mar 2009, 01:11

Previous

Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 32 guests