Today is D-day for CS 4210. Here is an electronic copy of our final report.
Happy summer everyone!
Here is the most up-to-date release for the C++ ChessEngine.
Dann has asked that anyone, with some time and inclination, please help get this code working correctly. Thanks!
Here is the most up-to-date release for the C# ChessEngine.
I think I have the sorting working properly. I also complied it with the optimized flag and it seems to be doing great. If you play the exact same game with this compilation and the most recent java you do not get the same number of nodes searched, but the C# engine is searching less nodes and seems to be running slightly faster than the java. I am sure we will never get them to search the same amount of nodes because of the different implementations of sort. I think this is as close as it will get. I think it is fair to compare the two now with searching implemented but I don't think they will ever be exact.
John B. has added a lot more documentation for the project on his website. You can view it here.
Steven W. sent me a new update on the C# code. Please Download and test it.
It does not throw an exception when you close it down. He also fixed the time problem so it will print to a file the correct time and you can launch a C# Engine vs. C# Engine match without a problem.
I'm interested in which engine would win a match... C# or Java?
There is a new C# update as of 6pm today. I copied it over the original version, so just download it again.
The problem with writing to the file is fixed. It also has the changes that were made the two java files board and search that were posted today.
A complete C# release is ready for Download and testing. The following are Parker's notes:
You will find the ChessEngine.exe file in the bin/debug directory of
the ChessEngine directory which I have attached as a zip file. To run
it just throw ChessEngine.exe in the WinBoard directory and use the
same command we did for the java engine WinBoard /fcp="ChessEngine
-f -d 3" note:(-d is optional, -f is necessary)
There are a couple of problems that I have found.
1) When the game terminates with a checkmate it throws an exception. If you run it you will see and Microsoft's debug (if you have Visual Studio installed) feature will catch it. It acts like it is trying to get another move but is given null and doesn't like it. This is probably related to that fact that I couldn't figure out how to do a System.exit(0); like java does so I just commented that line out.
2) You might want to double check my timer implementation in Search.cs. It seems like it is searching a lot more nodes than the java engine but doesn't appear to be any faster.
New release available today! Download it and try it out. I was wrong about the last relsease... This one is better.
I did noticed that it will still make unneccesary sacrifices toward the end of the game when it is losing and when it is winning, it still doesn't go for the kill.
Castling seems to work fine now.
New release available today! Download it and try it out. Thayne says, "it's certified to kick the pants off of anybody...".
He also say it hasn't generated any errors yet and that this should be the final port version. They fixed a problem in generate moves that didn't tell if the king was moving itself into check. That seemed to fix all errors.
It will not handle en passant moves, so don't try.
Happy testing and porting!
Talayna and Lucia have been hard at work on the final report. They have come up with a list of elements for the report and would like our feedback. Please email your comments about the following list to Lucia from our contact form or at email@example.com.
1. Overview of the project requirements
2. Explain how we started the project
3. Explain why it didn't work
4. Explain how and why we changed it, and what we changed it into
5. Show graphs, diagrams, data dictionary, requirements document,
6. Show the code
7. Explain any problems, what was the hardest part of writing the code
8. Advantages/disadvantages of each language (speed, running time)
Also, they have finished the questionaire. We all need to download it, fill it out, and email it or give a hard copy to Lucia or Talayna. They would like to have all questionnaires filled out by Tuesday, April 15, to help with the final report. (if you cannot answer all the questions by this date, please return the incomplete form anyway) Please answer the questions thoroughly, insightfully, and extensively.
If you have any questions, please email them to Lucia or Talayna.
I have added a contact form to the contact page. Will everyone please use it to send me your email addresses? When I have all the emails I will set up a list that will email to anyone in the class from the contact form. Thanks, Will
New complete version available for download.
This version is the best so far. I changed the incheck function to the "attacked" function. it now takes a row and col as input to search instead of just looking for a king.
The performance is almost as fast as it was before we added castling. It runs at 8.7K nodes per sec. on my windows machine. I tried adding ep moves, but I just got a headache from it and I think we would have to add some new data structure to make it work, and so I just junked the ep stuff.
As far as I can tell there are no issues left with castling, and I believe the pawn promotion is working correctly.The only bad thing is that I can only beat the dang thing if I run it on 1 ply! I guess I suck at chess. Hopefully this will be good enough for us to get started on porting.
John B. gave me copies of the requirements document and class diagram today.
A code skeleton for the C++ file Move.h has been added to the downloads page.
New Board.java available for download. This version has castling enabled. Thayne says it works, but may have bugs. So check it out.
A quick fix has been released with bug fixes and new features. It is available for download now. WARNING: Do not use ChessPiece.java from the last version.
1) Fixed a bug which caused the values of all pieces to be zero. Made the engine play really stupidly.
2) Improved pawn promotion.
A BIG update has been released with bug fixes and new features. It is available for download now.
Here is a short list of bug fixes and added features:
1) Fixed the bug discovered by Will which caused the same move to be returned twice near the end of a game. This was a result of the inevitable end of the game being detected by the engine and not being able to handle the terminal cases like checkmate and stalemate.
2) The engine now gracefully handles game termination caused by checkmate and stalemate, but does not yet handle draw by repetition.
3) Added the ability to detect when a king is in check. Illegal checked moves are no longer pushed onto the stack for evaluation.
4) Fixed a bug introduced into the move generation when Thayne and I (Jason) added some code to speed it up. Some legal moves were not
being generated because I had imagined that there were initially twelve pieces on the board for each side, when in fact, there are sixteen for each side.
5) Added simple move ordering. Captures are now evaluated first. It
would be good to have an analysis of how this effects performance,
since the overhead involved in sorting the moves at every node
decreases the nodes per second speed of the search, but causes far
fewer nodes to be searched. I would be particularly interested to know
how this effects speed at higher depths. We could also investigate
ways of making the ordering more valuable, but none of this might not
be important at this point.
6) Added pawn promotion. This needs to be tested far more thoroughly than I have done, but I think that it works.
7) Many small changes were made to almost all of the classes in an
effort to make them more streamlined and efficient. See the code for
If you come across an issue when testing and the fix is not transparant, email me the information and a screenshot of it. I will post it on the Current Issues page ASAP. I have posted a couple issues that I have encountered already.
My email is firstname.lastname@example.org.
I worked out how to run the engine with winboard. Install winboard and copy the java sources to the winboard directory and compile them (javac *.java). Then run [winboard /fcp="java ChessEngine -s -d 4"] from the command line.
There seems to be a bug with running two instances of our chess engine against each other. White will make the first move but black didn't make a move in over 5 minutes.
New code has been released with a couple of bug fixes and new features. It is available for download now.
1) Fixed a bug which allowed some illegal moves involving white pawns
to be generated and pushed onto the stack.
2) Modified evaluation tables for pawns to make them clear out the
middle more quickly.
New features are:
1) Added ability to play on command line. (run java ChessEngine from the command line without any flags)
2 ) Added ability to play one engine against another. (use ./xboard -fcp "java ChessEngine [flags]" -scp "java ChessEngine" , then click modify when xboard opens and choose 2 computer players)
You must now enter at least one flag when using xboard. The flags are described in the ChessEngine.java source.
New code with bug fixes for Board.java, ChessPiece.java, and Search.java are available on the download page.
1) Fixed a bug with the Search class that caused it to return the wrong move.
2) Fixed a bug in the temporary move generation method which caused it to generate only black moves.
3) Implemented the value() method of the class ChessPiece so that it does not always return zero.
4) Fixed a bug in the evaluate() method of the Board class so that it returns correct values to the alphaBeta() method.
The finished java source code is now available on the download page. Please start testing it.
Compile the code, then run ./config, then make. To run with xboard, use ./xboard -fcp "java ChessEngine".
The available flags are:
-s: display debug in JFrame
-d #: set depth equal to #.
Here is our job chart:
Project Lead - Casey
Computer Architect - Thayne
Code Assemblers - Jason, Richard, Steve W
C++ Co-pilot - Dann
C# Co-pilot - David
Requirements - John B
Milestones, Scheduling, Web Page - Will
Final Report - Lucia, Talayna
The java code skeletons can be downloaded from the download page. Here are the javadoc pages to go with them.
These are our tentative milestones:
3/6 - pseudocode/code finished for board, move, and piece classes.
3/20 - all other code done(move generation, etc.)
3/25 - working prototype in Java done.
4/10 - C# and C++ prototypes implementation done.
4/22 - testing and documentation done.
4/24 - hand in finished project.
4/29 - Szabo brings doughnuts.
Here is the decomposition chart and chess dictionary that Thayne went over in class on Tuesday 03/04.
As you can see, I have updated the site so that it no longer uses margins... more changes are in the works as well as a lot of new information to be posted soon.
Thayne has provided me with the following information for the project: First are the piece-square evaluation tables. The other is the bitboard repersentation.
I also have a homepage format without any margins. Check it out and let me know which way you prefer at email@example.com.
Java Team has compiled a function list for MSCP. This list includes all the functions that each function calls and all the functions that call it. View it here.