|
Engine: Stan's Chess |
Author: Stan Arts, Netherlands. |
|
|
Move Now |
Edit Mode |
Analyze Mode |
Opening Book |
Create book |
Ponder On/Off |
Hash Tables |
Table Bases |
|
v1.42 |
No |
Yes |
No |
Yes |
No |
No |
16MB |
No |
|
Draw claim |
Resign |
Force and go |
Program language |
Source available |
Learn |
XBoard |
UCI |
First release |
|
Yes |
No |
Yes |
Pascal |
No |
No |
No |
No |
26-07-2002 |
|
WinBoard.ini lines: |
|
Homepage:
Stan's page |
S-chess By Stan Arts 31 January 2003 --------------------------------------------------------------------------------- This is release 1.42 of S-chess for winboard, and the 1st release of S-chess3D! S-chess is my own attempt at writing a computer-chessplaying program, my name is Stan Arts, I'm from Holland and I am 21 years old. I like to do some computer- programming purelly for fun! I started my first computer-chess experiments in February 2002 and onwards, and step by step I got further, and later on the 7th of May 2002 I started working on my current chess program S-chess. S-chess is not based on any other chessprogram and uses all my own ideas and techniques. It's written in Pascal, and compiled with the Free-Pascal (v1.0.6) compiler. And my program (the winboard version) is about 6500 lines big. The 3D version is over 10.000 lines of Pascal code. S-chess is freeware, and can be distributed freely, as long as all the files are unmodified. Contents of this README.TXT file. : ----------------------------------- 1. About me and the history of S-chess. 2. How to use S-chess 3D. (The 3D stand-alone version) 3. How to use S-chess WB. (The winboard version of my program) 4. A little bit about the techniques I'm using in S-chess. 5. The rules of chess in short, and some strategical tips! 1. About me and the history of S-chess. --------------------------------------- My interest in computerprogramming started when at about age 8 my parents bought me a commodore 64, and quickly after I started writing my own computergames. And my interest in computerprogramming kinda stuck from then on.. Because of my bad health (due to Cystic Fibrosis) for most of my childhood I could never spend much time at school, but I spent a whole lot of time digging through scientific books and books about computerprogramming instead.. After writing many many programs and games on the C64 in interpreter basic and assembly language, in 1994 it was time to switch to a 486sx-25 that my parents bought for me. First carefull steps on the PC were in Qbasic, but only a few months later I could get my hands on a Turbo Pascal v7.0 compiler. I quickly learned this language and also bought books on assembly language for the PC and I could quickly do some nice things on the PC. I always stuck to the TPv7.0 compiler combined with using it's internal assembly to write games. In 1995 I mainly learned to program the PC and use many of it's internal features, but graphics have always been my biggest interest, and in 1996 I started experimenting with 3D graphics. This went very well and I quickly finished my first 3D game called 3D-ball, that was somewhat like a one-on-one soccer game using 32x32 bitmaps that got scaled to create a 3D effect. This made me under- stand some about 3D perspective and the same year I worked on my first real 3D engine that used polygons (surfaces in 3D space) and with that I created my first true 3D game called Raceboat-simulator. Where you had to race in a small 3D course against a computer opponent. I learned a lot from writing my first 3D code and I started with my second and much more advanced true 3D engine that my new "racing machines" game was going to use. However I never finished this game and used my new 3D code to write "Scratches" instead, which is a destruction- derby type game where you have to drive a car in an arena and hit your opponents for points. :-) Then I also used my 3D code for a flight-simulator experiment. Where you can fly around in an F16. At the end of 1997 (age 16) I lost interest in computerprogramming. I knew how to play chess since I was very young because my father taught me the rules, and I always found it interesting however I never played much chess because I didn't have anyone to play chess against but near the end of 2001 I found out it was possible to play chess on the internet against other human opponents. This really got my interest in chess going and also I found out there were some free computerchessprograms available on the internet and from then on spent quite a bit of time playing chess.. I was really enjoying these computer-programs that could play chess, and I knew I would still be capable of programming and in February 2002 I fired up my TPv7.0 compiler once more to give it a go! I had NO idea how a chessprogram works but I just started with an array of 64 bytes and made a system for the chesspieces and it was then possible to shuffle the pieces around in the array. Then after a few days it could even select a move from a 1 ply search. Then it went a bit quiet and again weeks later of headaches and drawing on paper had me a system that could choose a best score from a 2 ply search. (Basicly I drew out a minimaxing algorithm) and then it was also possible to make the program search deeper. First 3 ply which was very neat because it found it's first pawn-forks for instance, and then days later it was doing a 4 ply search. But by then it was taking nearly a minute to return a move on 4 ply as my program was doing a pure minimax search. I knew 5 ply would take many many minutes per move so I never implemented this 5 ply search. And my program searching on 4 ply was as far as I could go. Also this first program had a lot of other problems, for instance the program code was a total mess..and it didn't understand en-passant pawncaptures and it didn't know all the rules of castling. At the start of May 2002 I had to stay in the hospital for a few weeks and it was a good opportunity to start on a new chessprogram! I wanted a program that would atleast know all the correct rules of chess and also be a lot cleaner written. I got my hands on a PC computer in the hospital and my TPv7.0 compiler and by the time I got to go home I had a new chessprogram that knew all the correct rules and would search in a pure minimaxing way starting at 3 ply and upto a maximum of 30 ply! I was very happy with it and the initial name of my program was "woops" . However I was stuck on pure minimax as I didn't understand selective searching or any other techniques, but around that time I discovered there is actually a lot of info about chessprogramming on the internet, and not much later I discovered a technique called "Alpha-Beta pruning" . And months later woops was doing 6-7 ply searches in reasonable time, using my own intrepetation of alpha-beta pruning that would work with my program. By then I didn't like the name woops anymore, and changed it back to S-chess. (That was also the name of my first experiment in February) I started searching for other people interested in computer-chessprogramming and I meet José Lauro Strapasson (The creator of Pre-Chess) and I'm very thank- full that he pointed me to a modern 32-bit pascal compiler called "Free-Pascal" and suggested I should try to make a winboard-engine out of my program! He explained to me how I could make my program communicate with winboard and not much later my program was capable of running in the winboard GUI! , and I released my first version. Since then I have made many improvements to my chessprogram, and it has gotten faster and stronger. (There is some technical info about my chessprogram later on in this readme.txt) I still had a lot of old 3D-code..and I couldn't resist to try and make a 3D interface for my program! I started on S-chess 3D in September 2002. If you are interested in any of my programming please let me know! 2. How to use S-chess 3D. (The 3D stand-alone version) ------------------------------------------------------ Before running S-chess 3D, make sure your computer can meet the following requirements: - It's atleast a Pentium. - Atleast 32 MB free internal memory available. - Can run at 800x600 at 65536 colours (16-bit colours) as a full-screen mode. - Make sure your mouse works without problems. - All the data-files that belong to S-chess 3D are in the same folder as the Schess3D.exe main file and that you start the program from this folder. Also when you want to save a played game make sure you aren't running the program from a CD-ROM and that your disk isn't full. The games will be saved in the same folder all the S-chess 3D files are in. After starting S-chess 3D you are in the main menu. With "set game-options" you are able to set all the options for the game. Enable or disable options by clicking the small boxes with your mouse. Select a timecontrol to play at. Currently this only sets the computers playing- speed, and you won't get flagged for thinking too long. With "show computers thinking" you can select wether you would like to see what the computer thinks of the position and what it would like to play and expects you to play. The "show move-list" option will show a small box with the chess-game in long notation. You can scroll up and down by clicking the up and down arrow at the left side of the box. There are 3 levels of play. Default is S-chess at full speed, and it will use all the computers speed for thinking. It is for strong players. The middle option will limit S-chess's speed to about 5000 nodes/second and will play quite a bit weaker. At the lowest option S-chess will run at just approx. 1000 nodes/sec, and it will not be able to think very deeply. It is a good level when you are learning to play chess! There are 3 available backgrounds/enviroments for the 3D room. Default is none, but you can select the background to be a room. Also you can select the dots as a bit of a computeristic background. You can select stone or wood as boardcolours. Also you can select a different colour for the white pieces. These can be wood or pure white. The black pieces are always grey. Click "Save to PGN-file" to save your current game to a pgn datafile. Many other chessprograms such as winboard will be cabable of reading these files. (The PGN's are in readable format so you can also open them with any text-editor and print them for instance.) After clicking this option you have to select game1 to 5 as a filename. Note that existing files will be overwritten! When you play many games please copy existing files to another folder to keep them. "Help and info" is a screen with some info about S-chess 3D and short help on how to use the program. With "Start new game" a new game at the selected timecontrols and playside will start. By pressing the ESCAPE key while in the game you can return to the menu and select different options. Then you have to use "resume" to return to your current game. When selecting the opposite side to play, you have to select a new game! Click "quit the game" the exit S-chess 3D and return to windows. S-chess 3D uses my fully free movement and rotational 3D engine, and you are capable to fly around completely freely! And it's very easy to do. : Hold the right mousebutton or spacebar and move the mouse around to change your viewing direction. Press the up, down, left or right arrowkey on the keyboard to fly into the direction you like. Playing chess with my program is very easy. Just select the piece you would like to move by clicking (with your left mousebutton) on the square the piece is on. It will then light up slightly brighter than the surrounding squares. Then move your mouse to the square you would like to move the piece to and click again. S-chess will make sure your move is legal, so when the piece doesn't move make sure you selected the right square and that it is a legal move and that it is your turn and your king isn't in check! Please refer the bottom section of this readme file or chess-documentation if you are unfamiliar with the rules of chess. Note that S-chessWB might be slightly stronger than the 3D version because the WB version is capable of running a little faster (because it doesn't need to do the 3D calculating) and it divides it's time a bit more dynamic then S-chess 3D. Some people prefer a 2D board to play chess on.. Then S-chess 3D is not the right program for you, but if you like a 2D board perspective instead, you could just fly higher over the board and look at it from the top down to create a near-2D effect! 3. How to use S-chess WB. (The winboard version of my program) -------------------------------------------------------------- The main difference between v1.42 and previous release v1.41 is that v1.42 is slightly faster because I wrote a separate movegenerator for Q-search moves and that speeds up my program. I invested this extra speed in better move-ordening however so you won't see much more nodes/sec but a smaller searchtree instead. I estimate my program's strength to about 1800+ ELO on an average computer playing against humans. Note that all the datafiles (.s3d and .dll) aren't needed to run SchessWB.exe and you can move it separatly to another folder if you would like. When you run the WB version of S-chess outside any GUI, it's still possible to play a game of chess against my program with white and black and with various timecontrols. Type : huh [enter] to get a list of commands you can use, and each time after the computer has calculated a move, it will show a little chessboard, like this: (CAP-letters are the white pieces, also when you want to play black and the board will be flipped) r n b q k b n r p p p p p p p p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P P P P P P P P R N B Q K B N R In communication with winboard or another GUI (Arena for instance) , it has the following user-options: -edit position. So it's possible to setup a position, and play on from there. When using edit position, please skip edit-game mode, and set my program to play directly. So after setting up a position, click machine white or machine black right away. Although my program doesn't support analysis, you can set a timecontrol and use edit position to see what my program thinks in a position, which is similair to analysis. -hint. After S-chess has calculated a move, it can send a hintmove if you request one. -It understands all possible timecontrols. (Tournament timecontrols, Fisher/ incremental timecontrols, but also fixed depth (Note that my program can't search less than 3 ply, or more than 30 ply. Setting a higher or lower number will have no effect, and S-chess will set the value to 3 or 30 ply when you set a value outside this range.) and fixed time per move. ) -remove. To take back 2 halfmoves at a time. -S-chess WB will parse illegal moves, and notify winboard or another GUI that the move the user or opponent tries to play is illegal. (It replies with the "Illegal move : xxxx" command) S-chess WB requires a 386 or up and 16MB of free memory for hashtables. 4. A little bit about the techniques I'm using in S-chess. ---------------------------------------------------------- My program knows all the rules of chess. Including en-passant, castling and it knows underpromotions etc. It understands when a game has ended by mate, or draw. It understands draw by stalemate, 3x repetition of the same position and it knows the 50 move rule. S-chess has quite a bit of chess-knowledge. For instance, it knows things about king-safety, piece-development, pawnstructure, (double/tripple pawns, isolated pawns, pawn groups, passed/free pawns, etc.) centre-control, and other than that itīll usually try to put "pressure" on the opponent. Etc. All in all it looks at a lot of things. For the opening, it uses a very small opening-book of about 50 moves so it will know most common openings and will vary itīs opening-play to some extent. In the future I will add an external book, but I haven't been able to yet because I am trying to create the book myself. S-chess is a real brute-force program, and uses a pure minimaxing search, with alpha-beta pruning to improve searchspeed. It is not fixed depth, but uses "extensions" (=looking deeper in interesting parts of the searchtree) mainly of (re)capture-moves. S-chess doesnīt do extensions of checks and checkevasions yet, because they cost too much speed. Right now it will find a mate in N, on N*2 ply, (for instance a mate in 3 on the 6th ply) and it will find itīs being mated in N on (N*2)+1 ply. (for instance, mated in 3 on the 7th ply) I use checks, and mate/ stalemate detection everywhere in the searchtree to eliminate illegal moves and illegal positions in the searchtree. This makes the program slower but also far more accurate. Because I only use alpha-beta pruning and no "risky" pruning-techniques, S-chess is a very accurate searching program!, (it will investigate even the sillyest positions upto the full depth, "solving" chess and finding every possible combination upto the depth it reaches) but is also a slow searcher. :-( I hope in the future to find ways to speed up my programīs search without sacrificing too much accuracy. It uses a hashtable of 16 MB, and that's enough to store about 2 milion positions. I use the hashtable to improve move-ordening (it speeds up my program about 2x) But not to prune transportations yet, because I think it's important that my program runs and searches very stable. S-chess searches with iterative deepening. It starts to search on 3 ply and then keeps searching 1 ply deeper each time until the time runs out or it reaches 30 ply. Because of the way S-chess searches it's not so strong at very short timecontrols or (very) slow computers but benefits a lot from extra time or faster hardware. You'll find S-chess will get stronger at longer timecontrols similair to the way human chessplayers do. 5. The rules of chess in short, and some strategical tips! ---------------------------------------------------------- Here is a quick explanation of the rules of chess. Please refer to other chess- documentation for a more detailed explanation! Chess is a boardgame, and it's played on 64 squares. (8 "rows" and 8 "collums") There are always 2 players and one side has the "white" side, and one side has the "black" side. Each side has pieces, which could resemble an army or a kingdom if you like. The goal of the game is to capture the opponents king. When the opponents king can not avoid capture anymore the game ends and you win. (This is called check- mate, the actual capture is never played.) For each side, there are 6 different pieces, and they can all move in a different manner. As you'll find out, the way each piece can move will turn out to be very important for it's value or importance in the game. A list of the pieces and their movement : The Pawn. The pawn is the least important of pieces, and that is because it is most limited in it's movement. It can only move forward (and never backward) one square at a time. And it may only move forward when there is no piece on the square infront. There are however a lot of exceptions to the pawns movement where it can move in a different way.: When it is still in it's original place on the 2nd row, it may jump forward 2 squares, when both squares infront are free. . . . . . . . .8 black . . . . . . . .7 . . . . . . . .6 . . . . . . . .5 . . . . . * . .4 - it may go here because it was still on the 2nd original row . . . . . . . .3 . . . . . P . .2 - 2nd row . . . . . . . .1 white a b c d e f g h A pawn can "capture" a piece (capturing in chess is done by landing on the enemy piece and taking it's square. Unlike checkers for instance where you jump over the enemy piece to capture it.) when it is 1 square up and to the left or right of the pawn. . . . . . . . .8 black . . . . . . . .7 . . * . * . . .6 - It can only capture pieces on the *'s . . . . P . . . .5 . . . . . . . .4 . . . . . . . .3 . . . . . . . .2 . . . . . . . .1 white a b c d e f g h A pawn can become very important, and that is when it "walks" all the way across the board and is near or reaches the 8th row. Then it "promotes" and you can choose it to become eighter a Queen, a Rook, Bishop or Knight. There is one very special chessmove, that is called an en-passant pawncapture, and it can be played when you reach the 4th row of the opponent (5th row of the board in the case you are white) and the opponent has a pawn on the original row eighter 1 square left or right of your pawn. When the opponent chooses to play his pawn on the original square 2 squares forward so it lands directly left or right from your pawn, you can choose to capture it! This is the only case in chess where a capture doesn't happen on the square the enemy piece is on. And you place your pawn 1 square forward and 1 square eighter left or right (depending on what side the opponent pawn is on) and take the opponent's pawn of the board. It can only be done DIRECTLY after the opponent plays up his pawn. . . . . . . . .8 black . . . . = . . .7 - original square of the opponents pawn . . . . * . . .6 - You can capture to the e6 square, and take his pawn off! . . . . p P . .5 - Before it was your turn the opponent moved to e5 . . . . . . . .4 . . . . . . . .3 . . . . . . . .2 . . . . . . . .1 white a b c d e f g h The Knight. The knight is more important than a pawn, because it can move a lot more freely over the board. Unlike the pawn, it can move forward but also backward. When capturing it always has to land on the square occupied by the opponents piece. The knight is special because it can jump over any piece, and move in an L shape. It always moves eighter 2 squares up or down or to the left or right, and 1 square up or down or to the left or right but always in a 90 degree angle to the 2 square direction. In english notation the Knight is often refered to as N, because the King also uses the K. . . . . . . . .8 black . . . . . . . .7 . . . * . * . .6 . . * . . . * .5 . . . . N . . .4 - your knight can land on all the *'s . . . * . . . * .3 . . . * . * . .2 . . . . . . . .1 white a b c d e f g h The Bishop. The bishop is capable of moving in a diagonal manner. This may be forward, left or right but also backward. It can not jump over any pieces so the line must be free and the square you want it to go to can't be occupied by any of your own pieces. But it can capture an opponents piece by landing on it. You'll notice each side has a bishop on a light square and a dark square, a bishop can never leave the light or dark squares it started on. . . . . . . . *8 black * . . . . . * .7 . * . . . * . .6 . . * . * . . .5 . . . B . . . .4 - your bishop can go to all the *'s . . . * . * . . .3 . * . . . * . .2 * . . . . . * .1 white a b c d e f g h The Rook. The rook is one of your more important pieces, because it has greater power and force. Opposed to the bishop, the rook moves in straight lines. These can be left, right but also forward and backward. Just aslong as the line is free and the square you want to go to isn't occupied by any of your pieces. It too may capture opponent pieces by landing on them. . . . . * . . .8 black . . . . * . . .7 . . . . * . . .6 . . . . * . . .5 * * * * R * * *4 - your rook can go to all the *'s . . . . . * . . .3 . . . . * . . .2 . . . . * . . .1 white a b c d e f g h The Queen. The queen is probably your most important piece, because she has the greatest power in movement and force. She is a combination between a bishop and a rook. * . . . * . . .8 black . * . . * . . *7 . . * . * . * .6 . . . * * * . .5 * * * * Q * * *4 - your queen can go to all the *'s . . . . * * * . .3 . . * . * . * .2 . * . . * . . *1 white a b c d e f g h The King. Although the king is the most important of the game, it can't move as far as the queen. The king can move the same as the queen but it can only go 1 square at a time. It can capture similair to other pieces but you can't let it capture a piece after it could be captured itself ofcourse. . . . . . . . .8 black . . . . . . . .7 . . . . . . . .6 . . . * * * . .5 . . . * K * . .4 - your king can go to all the *'s . . . . * * * . .3 . . . . . . . .2 . . . . . . . .1 white a b c d e f g h When any of the opponents pieces "aim" (fall in the movement reach of that piece, and could capture your king next move) at your king, then your king is in "check" and you MUST get out of check, eighter by moving out of the way or capturing the opponents piece or place something in between. When you can't avoid the check it is checkmate and the game is over. However, when you are not in check but you can not move without putting your own king in check or have no other legal moves then it is stalemate and the game is a draw. The game also ends in draw when the same boardposition occurs 3 times, (with all conditions being the same those 3 times) or there hasn't been a pawnmove or capture by any piece for 50 moves. Then the game ends in a draw by the 50 move rule. As I already wrote some pieces are more important than others because of their movement. A queen can be far more helpfull than a pawn. The goal of the game is to "win" the opponents king, however this is made difficult by the army forces the opponent has, and this makes that you have to try to break his/her army! Usually this is done by outsmarting your opponent in traps or so called combinations where your opponent loses more material then you do. Then it will become easyer to win his king. It is important to keep your eye on your material and try to keep your valuable pieces! When trading, you should think and calculate it is a good idea..and in general you could award the different pieces the following scores. : King : has infinite importance Queen : 9 to 10 points Rook : 5 points Bishop : 3 points kNight : 3 points Pawn : 1 point There are however a lot of exceptions to this. A pawn near the 8th rank can be worth as much as a queen!, and a bishop is usually worth slightly more then a knight. (Depending if the opponent has many pieces on the square-colour of your bishop for instance, and many other factors) A knight near the centre or near the opponents weak points can be very valuable and maybe worth a rook! And an undeveloped knight in the back can be worth very little to give a few examples. The starting position is as following: (CAPS are the white pieces) r n b q k b n r8 black p p p p p p p p7 . . . . . . . .6 . . . . . . . .5 . . . . . . . .4 . . . . . . . .3 P P P P P P P P2 R N B Q K B N R1 white a b c d e f g h Where you can remember that the queen of both white and black is always on the d-collum and kings are always on the e-collum. (The white queen is always on a light square, and the black queen always on a dark square) Some strategical tips : At the beginning of the game, try to get your pieces of the back row and make them active on the board! You should try to occupy and control more space then your opponent, this will make it easyer for you to come up with plans and make it difficult for him/her to move around. In chess it turned out that it is important to control the "centre" of the board! (Because of the same reasons of control and limiting space for the opponent.) Therefore it is a good idea to get your d or e pawn forward so your opponent can't put his pieces in or through the centre so easelly, and won't be able to move so freely. And you'll open up many lines for your own pieces to get off the back- row and get into action. All in all you try to create opportunity's by opening important lines and trying to get your pieces to be able to move around freely and limit your opponents movement. ---- For any comments, ideas or suggestions or anything else please write to : stan_live@hotmail.com Hope you will enjoy my programs!
Đ COPYRIGHT 2001 - 2012 All Rights Reserved wbec-ridderkerk.nl