Shogi is a game for two in which the players take turns moving pieces around on a nine by nine board. There are several different types of pieces and each type moves in different ways and we will describe each of them in detail later.
As in western Chess, the players are referred to as "white" and "black". However, unlike western Chess, black normally takes the first turn. Also, in traditional Shogi sets, the pieces are all the same colour (a piece's "colour" is decided by which direction it is facing). This is important in physical games of Shogi because once a piece is captured its "colour" changes, making all pieces necessarily colourless.
If a player moves a piece into a square already occupied by an enemy piece, the enemy piece is captured and placed in "the hand" of the attacker. Once a player has pieces "in hand", instead of taking their turn by moving a piece already on the board, he or she could instead "drop" a piece from their hand onto the board (certain restrictions apply).
Each player has a special piece on the board, a king piece. If a player moves into a position such that their opponent's king can be captured, this is referred to as putting the opponent into "check". It is not permitted to make a move that puts your own king into check. If a player puts their opponent into check such that their opponent has no moves available to escape check, they are said to be in "check mate" and lose the game. The game also ends if a player is not in check, but can make no moves (all possible moves would be into check); this is referred to as "stale mate".
Some pieces have the ability to "promote". If a player moves a piece such that the source or destination square of the move is within their opponent's first three rows, that piece might have the option of promoting. Some pieces do not promote, and a piece that is already promoted cannot promote either, however most pieces can be promoted. When a piece promotes it changes into a new piece that moves differently. In some cases, promoting a piece provides it with more freedom of motion, although occasionally it is advantageous to leave a piece unpromoted. Sometimes a piece has no choice but to promote; if a piece would become stuck and unable to move if it didn't promote, promoting is obligatory.
We will now look at the individual pieces in depth. There are two different forms the sprites can take: Kanji (Japanese characters) or Glyphs (Stylized icons); we will show both images side by side, oriented as if they were your pieces and you were playing against an opponent at the top of the screen.
Do not worry too much about memorizing how the pieces move; at any time you can right click on a piece to see what squares it can go to.
The pawn can only be moved one square forward. It can't be dropped into a column that contains any friendly unpromoted pawns, nor can it be dropped in front of the enemy king to cause check-mate.
|The promoted pawn can be moved one square in any direction except for diagonally backwards.|
|The lance can be moved any number of squares forwards provided it does not leap over any pieces.||
The promoted lance can be moved one square in any direction except for diagonally backwards.
|The knight can be moved in an L-shape forwards (two squares forwards, then one square to the left or right); it can't be moved backwards or the sides in this manner. It can leap over pieces in its way.||The promoted knight can be moved one square in any direction except for diagonally backwards.|
The silver can be moved one square diagonally or forward.
|The promoted silver can be moved one square in any direction except for diagonally backwards.|
|The gold can be moved one square in any direction except for diagonally backwards.||Gold pieces can not be promoted.|
|The bishop can be moved freely along the diagonals provided it does not leap over any pieces.||The promoted bishop can also be moved one square along the laterals.|
|The rook can be moved freely along the laterals provided it does not leap over any pieces.||The promoted rook can also be moved one square along the diagonals.|
|The king can move one square in any direction.||Kings can not be promoted.|
WinShogi can be played on one computer, over a local area network (LAN), or ever over the Internet. In order to make WinShogi's implementation homogeneous, all games are played in a client/server model. This means that the players run clients that communicate with the game server. The client handles the job of showing the game to the players and allowing turns to be taken at the appropriate time, while the server handles the job of coordinating the game and making sure that everybody's playing by the rules.
If somebody has started a game server, you can load up WinShogi and connect to that server to play. If you know the IP address and port number of the server, you can connect to it directly with the menu commands under "Game => Connect to a Server" menu or, if the game server is running on another machine on your LAN, you can use the "Game => Find Server on LAN" menu command to search for games.
If you want to create your own server, there's the "Game => Create Server" menu command. Remember, even if you only want to play against the computer, or play against a friend on the same computer, you still need to create a server to play on.
If you wish to disconnect from a server or cancel a connection attempt, there's a menu command for that too ("Game => Disconnect"). Warning: if you were the one who created the server, this command will shut-down the server.
Also, you don't have to be a player to connect to a server. WinShogi supports clients running as spectators. If you connect as a spectator you'll be able to watch the game as it progresses. You'll even be able to save the game, or export the turn history.
When playing on a server and it is your turn, left click on a piece on the board or in your hand, hold the mouse button down while dragging to a destination square, and then release the mouse button to complete the turn. If the piece is selectable, it will become highlighted when you select it. If the square you have dragged to is a valid target, it too will be selected. Once you have selected a piece, you can deselect without taking your turn by releasing the mouse when no destination square is selected.
To show all of the valid destination squares a piece can go to, right click on a piece. While you hold the button down, all possible destination squares will be highlighted.
After a turn is made the status bar will be updated to describe the turn just taken. Moves and drops are described in standard Shogi notation.
Standard Shogi notation uses a coordinate system originating in the upper right hand corner of the board. With the black player on the bottom, the horizontal axis is labeled with numbers starting at 1 on the right hand side. The vertical axis is labeled with letters starting at 'a' at the top. Thus, the upper right square of the board is labeled "1a" and the lower left hand square of the board is labeled "9i".
The pieces are identified by the first letter of their English name, excepting the knight which is identified by the letter 'n'. Promoted pieces are prefixed by a '+' character. Thus, a silver warrior is identified by the letter 's' and a promoted lance is identified by the letters '+l'.
Moves are described by first listing the piece type moving, its position on the board, an 'x' or '-' character to indicate that the move took a piece or moved into an empty square respectively, and the destination position. If the move involved promoting, a '+' is appended to the description. If the move allowed promotion but the piece did not promote, a '=' is appended to the description. Thus, "l9ax9f+" means that white's right lance moved into black's pawn row, killing a piece and promoting.
Drops are described by listing the piece, a '*' character to indicate that a drop was made, then the coordinates of the position it was dropped into. Thus, "p*1c" describes a pawn being dropped into white's pawn row.
If you wish to save a text file a listing all of the turns taken in a game, you can use the "Game => Export History" menu command. The file saved will look something like this:
- P9g-9f P6c-6d
- B8h-9g R8b-6b
- P2g-2f P1c-1d
- P2f-2e B2b-1c
- S3i-4h B1c-3e
- P3g-3f B3e-4d
- S7i-6h P6d-6e
- P1g-1f P6e-6f
- P1f-1e P6fx6g+
- S6hx6g P1dx1e
- L1ix1e L1ax1e
- P*1h R6bx6g+
- P*6h +R6g-6f
- G4i-5h +R6fx3f
- P2e-2d +R3fx9f
- B9g-8f +R9f-8e
- N8i-9g +R8e-6e
The first column lists moves made by the player who played first (usually the black player); the second column lists moves made by the other player. This is where we deviate from the standard format somewhat. Some people would argue that the turns should be listed in one column, and others would go as far as to say that they should be listed in a paragraph and not a column. We feel that the above format is more readable, especially when viewed with a mono-spaced font.
Saving the game is simple; there are the standard "Save" and "Save As" menu commands under the "Game" menu. However, because of the client/server model that WinShogi games work with, resuming a saved game is a little more complicated.
Just like creating a new game, to load a game you need to create a server. The "Game => Create Server from File" menu command will allow you to load a game and then create a server to play that game on. Most of the values saved in the file can be modified as the server is being created, too; this will allow you to do things like change what kind of opponent you want to play against, or change a player's time limit. Also, you can specify the saved game on the command line ("WinShogi Untitled.Shogi", for example).
At the bottom of the screen is a text-box where status messages will be printed. Whenever a turn is made, a description of the move will be printed in this box. Network status messages and debugging messages might also be printed in this box.
There are three buttons to the left of the text box for scrolling through the history of messages; the triangle buttons scroll the history up and down one message at a time (you can click and hold a button to scroll repeatedly), and the arrow-down button scrolls to the end (the most recent message). The up and down arrow keys, and the 'j' and 'k' keys also map to a press of the up and down buttons. The end key and the 'G' key map to the end button.
WinShogi was designed to be able to handle more than a few types of messages in the message history box and is capable of filtering out messages from the display. The "Messaging => Message Filters" menu command brings up a dialog containing a check-list of message types to display; you can filter out whatever messages you want. Note: several message types have been defined but remain unused (reserved for features to be done later).
If you want to permanently clear the message history, the menu command "Messaging => Clear Message History" will do that for you.
Most pieces lose nothing by promoting. For pieces like this, this option will enable automatic promotion. Promotion for other pieces will still be done based on a dialog prompt.
When enabled, a king in check will flash.
When enabled, WinShogi will try to get your attention if the window is minimized or in the background and the game state changes. It tries to get your attention by flashing the WinShogi button in the task-bar and will continue to flash until WinShogi has been brought to the foreground.
This feature is useful when playing against a slow computer opponent; you can make your move and then minimize WinShogi while it thinks and you work on something else.
When enabled, axis labels will be drawn along the edge of the board. These labels will change position when the board perspective changes.
The default colouring of the board and pieces is based on your Windows desktop appearance scheme. You can change the colouring for WinShogi, Explorer, and all other Win-friendly applications through the "Display => Appearance" dialog under your Control Panel.
The Customize Palette menu command brings up the colour customization dialog which will allow you to override the colours suggested by your operating system. As you make changes, they will be reflected in the game window behind the dialog window. The Reset button in the dialog will restore the operating system defaults. The cancel button will undo any changes made and return to the game. You can load and save and customized palettes you create.
This menu allows you to select how you want the timer in the lower right hand corner of the screen to be displayed. You can hide the timer, have it show the amount of time elapsed so far in the current turn, have it show the total amount of time the current player has spent thinking, or have it show the amount of time the current player has left (if a time limit was enabled). If no time limit is enabled and the "Total Remaining" setting is used, the timer is hidden.
At any point during the game you can switch sprite sets (the pictures used to represent the pieces). Two sets are provided: one based on the Japanese Kanji, the other based on the westernized glyphs.
This setting selects how you want the board to be displayed; you can choose which player's "chair" to sit in, so to speak.
Whenever a remote player takes a turn, or the "Game => Review Turn" menu command is issued, a turn will be "animated" on the screen. Calling it animation is kind of of pretentious because all it really does is highlite the squares involved in the turn. For remote taken remotely this looks okay because it looks as if the player was playing locally and had made the mouse drag required to make the turn. For review turns this doesn't look quite as nice because the pieces don't move and for drops the piece in hand isn't even selected (because it isn't in the players hand anymore). The animation speed setting adjusts how long the squares stay selected; a setting of instant will remove the animation entirely.
When creating a computer opponent to play against, you can change how smart your computer opponent is. A smarter opponent will take longer to think of counter-moves.
The move and drop depth settings set the number of moves and drops the brain will think ahead. In order to simplify one aspect of the AI, the drop depth must be equal to or lower than the move depth.
When playing against a computer opponent, there are occasionally times when it can't decide between more than one move that seem equally valuable. When the non-deterministic AI option is enabled, the computer will choose one at random. This is usually what you'd want, since it adds a little more spice to the game. However, if you're trying to reproduce a malfunction, leaving the option enabled will make it more difficult to re-create the problem and should be disabled.
The WinShogi brain was designed with distributed systems in mind. Multiple computers can be used co-operatively to run the brain. While this will not make the brain any smarter, it will make it faster, allowing you to play against more complicated brains without having to wait as long between moves.
The WinShogi brain is made up of two types of entity: master brains and slave brains. There is generally only one master brain and it partitions the work to be done into smaller pieces which it then hands out to the slave brains which actually do the work.
The master WinShogi brain and one slave brain run as a part of the GUI. If running on a multi-processor SMP machine, the GUI will create additional slave brain processes by running the WinShogi executable with additional command line parameters.
If you have more than one computer connected with a network supporting the TCP/IP and UDP/IP network protocols, you can go to other computers on your network and launch slave brains manually. All you need to do is run the WinShogi executable (WinShogi.exe) from a shell on the remote computer (you can either access the WinShogi executable through file sharing or you can copy it to the local disk). The command line syntax for launching a slave brain is:
WinShogi -slavebrain <masterAddress> <masterPort>
The <masterAddress> and <masterPort> parameters specify the IP address of the master brain. The <masterAddress> can be given as a numeric IP address or as a resolvable symbolic address. The <masterPort> value is determined when the computer opponent is created. A message is logged to the message history that gives this number (you can use the message history buttons to scroll back to find this value after the game has been playing for a while).
Once launched, Slave Brains detach from the console that launched them. Any errors would be detected at startup and would provoke a dialog box explaining the problem. If they successfully connect to a Master Brain, they produce no output and have no window. They run, for all intents and purposes, like a daemon. When the Master Brain shuts down (when the player quits) the slave brains shut themselves down.
The master brain can handle brains disconnecting and disconnecting at any time. Since it has its own dedicated brain in the main GUI process, it will always have at least one slave brain to do work.
If you want to create a slave brain that searches the LAN for games to help out with, you can create a persistent brain with the following command:
Brains created in this fashion will not exit and will remain resident until killed (using the task manager or whatever); once disconnected from a game they will continue to search for games on the LAN. This is useful for setting up WinShogi slaves on numerous hosts where they will use up any spare cycles the machines might have without the operator of the machine knowing that anything is going on. If you're really feeling sneaky you can put "WinShogi -persistentSlave" into the "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run" registry key so that WinShogi is run whenever a user logs into the machine. Unfortunately I don't know how to get WinShogi to run while Windows is sitting at the login prompt (where the CPU would spend most of its idle cycles).
Both types of brain can be forcefully shut-down with the task manager under Windows NT or with the shut-down menu under Windows 98 (Ctrl+Alt+Del).