Chess Viewer Deluxe (CVD) is a full featured Java applet, designed to present chess games on the Web. Its main purpose is to let users enjoy the games in an intuitive, user-friendly environment. The presentation is complete, with support for recursive variations, annotations and glyphs. The games are being stored in their native PGN format which makes Web publishing simple and easy, free from any clumsy steps. In addition, many advanced features are included to provide robust chess-related functionality. Special effort is made to keep the applet's size small realizing that users can still be concerned about download speed.
This software was originally inspired by the well-known chess viewer MyChessViewer (by Michael Keating). I was impressed how elegant and efficient Mike's solution was and how he managed to implement it in such a small package. His viewer remains one of the most reliable chess viewers and is still very popular. I liked it a lot and I turned it into my personal stand-alone viewer.
After a while I felt the need and decided to introduce some new functionality. Going through Mike's code was fun and I could quickly identify the areas which I wanted to improve. Then, as I kept including more and more features, modifications affected whole modules and soon a complete re-design was inevitable. I made a lot of enhancements to the original GUI design but tried to preserve the main ideas. Also, the browser's program interface to the applet is quite compatible with the original.
Compliance with PGN Standard
One of the most important aspects of any publishing is sharing our ideas with others. The most valuable way of sharing chess information, no doubt, is by providing a notation that complies with the PGN format. By mean of such, well documented and widely spread, standard others are able to fully reproduce our ideas. In other words, PGN is for chess enthusiasts what sheet music is for musicians.
Thorough interpretation of every part of the PGN Specification is among CVD's best features. That expertise can be seen in several areas. Take for example the PGN file that is about to be loaded by the viewer. Being a text file makes it prone to errors and it often contains incorrect syntax or invalid chess moves. While parsing the PGN file a great effort is made to handle all possible situations. If a move is found to be "invalid" and cannot be played according to the rules it will be shown as "illegal" (drawn in red). A common bad practice, seen even in commercial parsers, is to turn such moves into annotations (as if by magic). Doing the right thing helps users get a better idea of what's wrong. Meaningful error handling also affects the rest of the game and improves the overall quality. If you want to learn more about PGN parsing in general and how CVD takes care of it feel free to visit this page.
Many examples can be found in the PGN Specification and Implementation Guide. Section 8 deals with PGN parsing and suggests ways of implementing it. A good parser should strictly comply in order to be taken seriously. Even better, attention should be paid to extra guidelines (eg 8.2.3) -- non-canonical SAN, applying transformations, etc. For instance, a check/checkmate indicator ('+', '#') must only appear on moves that are true check/checkmate and has to be removed from those that are not. That feature, alone, isn't as obvious or trivial as it may seem at first sight. On the contrary, many software titles don't bother implementing it. Once again, CVD won't disappoint and your source PGN will be improved wherever possible.
Another part of PGN Specification has to do with Date representation. To avoid the confusion of various international standards for representing dates, PGN defined date format to be "YYYY.MM.DD". This is the format used by CVD for on-screen and internal representation of Date fields (e.g. "Date", "EventDate").
Wasting time with the mouse can be very annoying at times.
Keyboard control allows you to stay focused on the chessboard (the only important thing).
Shortcuts are provided for faster game navigation and for most common GUI functions.
Note: If the applet doesn't get the initial focus you may need to click inside it once and use the keyboard onwards.
Copy/Paste is clearly a must-have feature of any software. The ability to quickly share data between applications has always been part of modern GUI design. In chess terms it means much easier transfer of position/game data for the purpose of analyses. I thought, for my own sake, how wonderful it would be to have this feature in a Web based chess viewer. That's why I put it on my high priority list when I started the CVD project. In the latest version, there are four types of commands in this category - "Copy/Paste Game" of PGN data which applies to the current game; "Copy Position" which applies to the current position and "Paste Moves Sequence" which insert a sequence of moves just after the current move.
Be aware that a security concern exists about whether to allow access to the clipboard from the content of a Web page loaded in the browser. If you are in habit of placing sensitive information in the clipboard you might be in danger. The question is big and some people consider it important. For example, Flash player's designers allowed only write (and no read) access to the clipboard. There are people who even consider that not safe enough. Java designers went further in JVM and completely disabled clipboard access from inside applets. Other people, not so paranoid about security, will explain that clipboard data is stored along with its data type (plain-text, image, spreadsheet etc.). Since only plain-text clipboard data has ever been accessible from a Web page content all our spreadsheets (and other proprietary formats) are pretty safe and not likely to be stolen by a malicious script reading the clipboard.
To implement copy/paste functionality CVD depends on copy/paste availability through the browser application. For example, IE6 always allows access and the functionality is available; IE7 gives us an option to allow/disallow it (so that we can decide) and Firefox always disallows it. In other words, if the browser of your choice doesn't allow so copy/paste functionality of CVD will not work for you.
All powerful GUI applications provide this feature to their users. Context menus enhance the experience by simplifying the interface. They are a very efficient way of getting the right function at the right time. Taking the shortcut allows us to get the job done as fast as possible. Such a convenience often makes us forget about the alternatives.
The Chess Viewer Deluxe is no exception. There are three different contexts -- Chessboard, Scoresheet and Toolbar. A pop-up menu will appear when right-clicking on the corresponding area of the GUI. (I'm told that people in Mac world call it "apple-click") A list of options, relevant to the current context, will be presented. Every implemented command can be found and executed from these menus. Simply put, everything is exactly the way we're used to from the real applications.
Making chess moves
In addition to viewing our favorite games very often we feel like trying some lines of our own. In this kind of computer-assisted analyses we do the thinking and the computer just helps us organize the process by keeping track of the moves. I think of it as an improved version of a real chessboard and a notepad. With Chess Viewer Deluxe this process is very straightforward. New variations and branching points will be created automatically if necessary. At any time you will be able to delete or promote the current variation using a keystroke or a menu command.
In a complex game, things can get really messy when you branch several levels deep inside several variations. Well, they won't if you are using Chess Viewer Deluxe. You will always have a clear idea of the exact game path and an easy way to navigate back to any branching point. I don't know about professional players but for a casual/average player (like me) this is a great help.
The client Web browser must support Java 1.1 (or above). Older machines are likely to have MS Java (e.g. preinstalled with Windows 2000) which will work just fine. On newer machines you will have to install Java in order to use the applet.
You only need to install the CVD on your Web server if you 1) are a Webmaster; 2) have the technical background and 3) are interested in having full control of your installation. In most cases, a much faster result can be achieved by following How to publish a chess game on your blog. Think of it as an alternative way of installing (so called cloud-version), which is not only simpler but also functionally identical.
If you're already using MyChessViewer on your Web site you will be able to install
Chess Viewer Deluxe with no (OK, a tiny) effort.
Here is the short list of steps to follow:
- Download the viewer's code Viewer-Deluxe.jar. It is compressed for fastest loading, packed for convenience and you don't need to unpack it. Just save it to any folder of the Web space on your server.
- Take a look at the HTML source of Games Samples
to get an idea how to use the applet on a page. Here is the essential part.
<APPLET archive="Viewer-Deluxe.jar" code="ChessBoard.class" codebase="/bin" width="631" height="560" mayscript="true"> <PARAM name=PgnGameFile value="/games/Samples.Pgn"> <PARAM name=LightSquares value=F3DCC2> <PARAM name=DarkSquares value=DDA37B> <PARAM name=Background value=CCCCCC> <PARAM name=ImagesFolder value=images> <PARAM name=PuzzleMode value="off"> Your browser is completely ignoring the <APPLET> tag! </APPLET>
- PgnGameFile specifies the actual GameFile relative to the Web page home folder. It could reside is any folder (accessible, of course) and have any extension. This parameter is mandatory.
- Use LightSquares, DarkSquares and Background to specify RGB custom colors to replace system defaults. These parameters are optional.
- ImagesFolder specifies a folder inside the JAR file that contains the images. It allows for alternative sets of chess pieces. Unless you have modified the JAR file to include an extra folder there is no need to modify the value. This parameter is mandatory.
- PuzzleMode is an optional parameter. The default value is "off". When turned "on" the viewer will start in puzzle mode -- showing the problem but hiding the answer.
- It is a good idea for your Web page to include code to verify if the client's browser supports Java first.
This will make it more pleasant for users who load the page and need further instructions.
- To make the previous step work you need to provide an "UpgradeBrowser.htm" file.
Easiest is to use the one here but feel free to modify or replace it to your taste.
Now you are ready to present the Chess Viewer Deluxe to your site's visitors.
Read the change log document.
This software is free for anybody to use. The meaning of "free" is exactly the same as in "free beer" - you don't have to pay for using it. You may like it or even enjoy it but no promises of any kind are made. The beer recipe is not included and there's no point asking for it. There are no special clauses and no freedom of yours is taken away from you. I mean no harm with my offering and my ultimate goal (or rather a dream) is to make this software bugs-free. (Note: For the very same reason I also like my beer to be bugs-free.)
ResourcesChess Viewer Deluxe quickstart guide
How to View Games Using Chess Viewer Deluxe
The Chess Nut Blog: 5 Steps to Chess Viewer Deluxe
Any suggestions or feedback can be sent to pilafov ‹at› hotmail ‹dot› com and will be appreciated.