Week 7: Building The Bridge
“No one ever won a game by resigning.” -Savielly Tartakower
Hello everyone!!! Welcome back to my blog. This week, I finally had the opportunity to start incorporating my old code into my senior project. I still have a long way to go, but good progress is coming along! Let’s go over what I’ve done this week.
- Summary Of Capstone Project
- Translating Old Code
- Implementing The Move Reader
- Plans For Next Week
Summary Of Capstone Project
As I have mentioned through my senior project blogs, I was actually able to work on a piece of my senior project for the Capstone CS final project! Before I start going over the new stuff I’ve added, let me quickly explain what my former project was about.
Basically, the project was to create a chess database system that can store professionally annotated master chess games. These are games played by top players and are analyzed by other strong chess masters. I personally believe that they are very strong resources for serious chess players to use to study and improve their own playing style. Thus, by storing these games in a database and implementing a UI system for players to access and review them, I hope to offer a very instructive and useful training application.
I won’t go over the implementation details too specifically, but essentially, I wrote a couple of classes to create the Database object and read the chess game text files. If you want to learn more, feel free to check out my first blog.
Unfortunately, all my code for my Capstone CS class was written in Java, so I had to take some time to rewrite all of it into C#. It wasn’t that hard, since C# and Java are pretty similar. However, they have very different method names and slightly different implementation syntax, which took me a while to work out. Right now though, I’m getting an error, which is a bit annoying.
I know that my Java code works perfectly fine, so this probably means that I copied something wrong, or a part of my Java code isn’t compatible with my C# implementation. Whatever the issue is, I need to find it fast.
The Move Reader
Now, even after copying the code over, I still have a lot more to do. My java code simply iterates through the moves in the text files and displays them as a string. However, I need those moves to be shown on the actual chess board, not just as chess notation. Thus, I spent a lot of time this week creating a move reader script, which reads in the chess notations and then makes the move on the 3D chess board. This script is super easy to use. All I need to do is call the method to pass in a string, and then it’ll play the actual move on the board.
Although users would not be moving the pieces by typing in the move (they are using augmented reality after all), I still created a typing system just to double check that the code is working.
Now, by entering the move in the text box shown above, the corresponding move will be played on the chess board as well. Of course, I had to deal with a few special moves, such as castling. However, that went by pretty easily this time. Once I know that the reader is working, I can get rid of the text box. The only time I will need to use it is when I process files. Instead of printing each move, I will just pass each move in the game to the move reader, which will make the move on the board. Of course, this system is still in development because I am getting some errors, but hopefully it will be working very soon!
Plans For Next Week
So, I actually have quite a few things I need to finish by next week. First of all, my presentation. I really need to start working on the framework of my slides because I literally have a month left. Next, I need to start implementing the UI system. In my Java code, I was using user console input to determine what to do. For example, if the user enters ‘n’, then the program plays the next move. If the user enters ‘q’, then the game closes. Obviously, I can’t use user input for AR, so I need to create a bunch of buttons as an alternative.
Finally, I need to implement a way for the user to go back a move. Although going back is very simple when I’m just printing text, it’s a bit complicated when I actually need to undo moves on the chess board. This can be especially annoying when I need to replace captured pieces. But don’t worry! I’ll finish all this by next week.
That’s all for today! Thanks for reading my blog, and I hope to see you next week!