Page 1 of 1

edit position for Chu Shogi / HaChu engine

PostPosted: 11 Mar 2017, 23:43
by evertVB
Hello,

I would like to enter a simple end game position. I've found the menu options:
-> Edit -> Edit position
-> Mode -> Edit position
and also copy and paste position. I can drag pieces that are already on the board, or make the square empty.

But I can't find an option to choose a particular piece. Right-clicking a square will only put a Sente pawn there.
So if I would like to make up an endgame position with King + gold + White Horse versus King + Prince + Free Ox + GB, I don't see how to enter that.

Re: edit position for Chu Shogi / HaChu engine

PostPosted: 12 Mar 2017, 22:20
by evertVB
The winboard + Shogi install works fine with me as for editing a position. A right-click shows a nice panel where I can pick a piece. So there is something incomplete about the Chu install I picked from internet.

Re: edit position for Chu Shogi / HaChu engine

PostPosted: 13 Mar 2017, 08:28
by H.G.Muller
WinBoard has two modes for editing positions, with or without piece menu. This is controlled by the command-line option -pieceMenu true|false . (There is no interactive way to change this, so you would have to type it in the 'Additional options' field of the Startup Dialog.) Not all WinBoard installs are configured the same way.

Problem with the piece menu is that it really is designed only for orthodox Chess / Xiangqi / Shogi. For variants like Chu or Tenjiku (let alone Tai Shogi) it would become unwieldly large. Problem is also that even the same pieces have different names in different variants, so that you would need a dedicated menu for each variant, and that all the names would need translations in all languages. (Shogi and Spartan Chess have such a dedicated piece menu.) And for engine-defined variants, where WinBoard has no idea of the rules (or piece names), it seems an unsolvable problem.

I have experimented with a graphical piece menu, where there would pop up a window with a board showing all pieces as the same images as used on the board, so you could click on one to choose it, but this turned out to be also quite cumbersome in variants with many pieces.

So as an alternative to the piece menu I finally settled on 'sweep selection': When you make a stationary right-click on the board, a white Pawn is created in the clicked square (because that is the piece you need most often). A middle click (or Shift + click) would give you a black Pawn. (The Shift key is a general means to swap the function of the right and middle mouse button.) But if you vertically move the mouse between the (right- or middle-)button press and release ('sweep'), a Pawn will appear in the square on the press, but then cycle through all other pieces participating in the current variant. The piece that is shown when you release the button will then stay in the square.

This works quite well in western Chess variants, where you have 10-12 piece types. But for Chu Shogi, with 36 piece types, it can still be very cumbersome, because you don't have enough room to make the sweep you need. (Sweeping diagonally helps a bit.) In the latest WinBoard version of the main branch I have added several ways to facilitate setup in such large variants, (but the WinBoard fork that knows the large Shogi variants and kanji unfortunately does not have those yet):
1) Existing pieces can be duplicated by moving them with the Ctrl key pressed
2) repeatedly clicking the clock in Edit Position mode (which originally just cleared the board) produces a board where every piece occurs only once ('piece pallette')
3) stationary right clicking on a piece you just created 'upgrades' it to the next piece type, rather than initiating a sweep for an entirely new piece.

But I guess in the kanji-enabled version of WinBoard you will have to live with the sweep selection, because the piece menu, even if you would enable it, is grossly inadequate for Chu Shogi. In theory it is possible to get pieces not in the menu by (repeated) use of the 'promote' and 'demote' entries in that menu: when you try to demote a piece that is not a promoted one, it would upgrade its type to the next one in line. But having to do that 18 times is also a royal pain...

Re: edit position for Chu Shogi / HaChu engine

PostPosted: 14 Mar 2017, 07:49
by evertVB
The position can be exchanged with the clipboard and I think I understand the coding:
Code: Select all
lfcsgekgscfl/a1b1txot1b1a/mvrhdqndhrvm/pppppppppppp/3i4i3/12/12/3I4I3/PPPPPPPPPPPP/MVRHDNQDHRVM/A1B1TOXT1B1A/LFCSGKEGSCFL w - 0 1

lfcsgekgscfl/a1b1txot1b1a/mvrhdqndhrvm/pppppppppppp/3i4i3/12/12/3I2P1I3/PPPPPP1PPPPP/MVRHDNQDHRVM/A1B1TOXT1B1A/LFCSGKEGSCFL b - 1 1

...

lfcsgekgscfl/a1b1txot1b1a/mvrhdq1dhrvm/pppp1ppppppp/3ip3i3/12/7n4/3IPPP1I3/PPPP3PPPPP/MVRHDNQDHRVM/A1B1TOXT1B1A/LFCSGKEGSCFL w - 6 4

Could you only explain the meaning of the last two numbers 0 1 resp. 1 1 resp. 6 4?

Re: edit position for Chu Shogi / HaChu engine

PostPosted: 14 Mar 2017, 23:51
by H.G.Muller
These are the usual reversible-ply counter and move counter that all FENs have. The move counter is not very useful, and WinBoard ignores it, and doesn't mind if you omit it. (But it does write it, for compatibility with more pedantic software.) In Chess the reversible-ply counter is part of the game state, because of the 50-move rule.

Now Chu Shogi does not have a 50-move rule. But in computer Chess this is a big problem, because computers have infinite patience, and would continue a game for thousands of years if they both think they are margially ahead. You really need a rule to terminate games between stubborn opponents. Especially if repetions would be a loss. (In Chu-Shogi-renmei rules they fortunately can be draws.)

It is not easy to define 'progress' when pieces with reversible moves can promote, though. In Chess a Pawn push obviously brings you closer to promotion. But moving a Kirin back and forth not. In addition many Chu end-games are theoretical wins by virtue of the perpetual-check prohibition. (Like K + 2 Tigers vs K + Q.) It takes near-infinity to exhaust the non-repeating checking possibilities of a Q, however, so that you get the chance to advance the winning plan one move, after which he can safely start checking again.

Perhaps there should be a rule that limits even checks that are not repeating. I see no legitimate reason for checking more than 10 times in a row with the same piece. Checking with more pieces usually ends in a mate. Perhaps there should be a rule that you can check not more often than 10 times with the same piece before you capture something, or check with another. And then allow 100 moves to capture or promote before it is a draw.

As to the FEN: note that WinBoard uses a 1-letter representation of the pieces. This did force a few less obvious ones, such as N for Lion, O for Kirin, X for Phoenix, I for Go Between and A for Reverse Chariot. The other 16 are pretty reasonable. O, X and I were inspired by the shape of the move.