Thursday, January 27, 2011

On-line Chess - Part 1.2 - Client program

Every web site allowing users to play chess has a client program. A client program is a piece of software that interfaces the player with the game server. In the past the client program was downloadable but this solution is not considered very attractive because once you install it on a PC you are compelled to use that PC to play on-line. On the contrary, if the interface player-server is usable without downloading and installing any software, the player will be able to play theoretically from any PC or any device with an internet connection (play-everywhere-every-time principle). Anyway there are benefits using downloadable software: - the client is nicer, has better graphic and outstanding effects
- once installed you don’t have to wait for loading from internet any data to start a game

That’s the reason why the most popular chess servers are still accessible by downloadable software. Usually those servers have a standard interface allowing different programs to connect with (Fritz and WinBoard to mention a few).
Moreover downloadable clients are very easy to use for mobile devices because they can be customized for that platform so it is quite common to have a mobile application downloadable for free even if the desktop access is performed by web technologies.

Nowadays fat clients can be implemented with relatively recent technologies (actionscript, java, javascript, Ajax, Silverlight, …) usable by any browser, and faster computers and internet connections make downloadable software less and less attractive. Most of the client programs you can find on the web for chess are written in JavaScript. Java applets are also used but the time to load the program is notoriously greater. With latest version of java (JRE and JDK > 1.6) applets are faster than before so, even if they are not considered the best approach by most of people, maybe java applets deserve more consideration now than before. ActionScript is the language of Adobe flash (or Flex): it is not a free technology like java but it is powerful and allows exploiting the flash library for graphics. It is worth saying that at the moment Apple is attacking Adobe because flash is not performing well on its handset devices; Microsoft and Google are supporting Apple against Adobe so the future could not so brighter for Flash as in the past and other technologies like HTML5 will come soon.

Figure 1www.chesscube.com client interface implemented using flash technology.

Of course, in order to play using a java client, the local PC (or mobile device) must have java correctly installed and enabled in your browser. It is free and maybe you will find it already installed because java is used by many other applications.
Same for actionscript. You should have Flash installed on your PC. It is free and several web sites require flash for other purposes.

Typically the client program allows the user to pick up a piece from the chess board and perform the move. The move is validated and sent to the server (hopefully encrypted) which forwards it to the opponent client program. Client programs could be thin in the sense they could not perform any validity check but just reporting the move to the server which performs checks and holds the status of the game, or they could be fat in the sense they hold the logic to performs all the checks and may or may not hold the status of the game. Some clients have also the responsibility to show the list of connected players but sometimes the program does only the minimum required and other technologies are used to perform database accesses.

No comments:

Post a Comment