Tarnasa / doc-scratch

A C++ chess-playing AI for SIG-Game's framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chess C++ Client

This is the root of you AI. Stay out of the joueur/ folder, it does most of the heavy lifting to play on our game servers. Your AI, and the game objects it manipulates are all in games/chess/, with your very own AI living in games/chess/ai.h and games/chess/ai.cpp files for you to make smarter.

How to Run

This client has been tested and confirmed to work on the Campus rc##xcs213 Linux machines, but it can work on your own Windows/Linux/Mac machines if you desire.

Also make sure NOT to try to compile this in your Missouri S&T S-Drive. This is not a fault with the client, but rather the school's S-Drive implimentation changing some file permissions during run time. We cannot control this. Instead, we recommend cloning your repo outside the S-Drive and use an SCP program like WinSCP to edit the files in Windows using whatever IDE you want if you want to code in Windows, but compile in Linux.

Linux

make
./testRun MyOwnGameSession

If you are on your own machine, make sure you've installed boost. The libboost-all-dev package should be up to date. You'll also need the cmake package for make to work.

Windows

Be aware that getting this C++ client to build on Windows, while possible, can be a headache.

For Windows, Boost has a simple way to compile from source using bootstrap. You'll need to do that. This client does work with VC++, you can create a solution at the root or ask a dev for the sln file. Just add the directory you built Boost in the Project's linker configuration. You'll also need to set command line arguments like the other clients.

Other notes

The initial make step may take upwards of 2 minutes. You should see a percent progress updating on your screen, but it will be slow. Subsequent makes should be only a few seconds if you don't make clean.

Additions

The files starting with "Skaia" in the games/chess directory are the core of the chess library. The Skaia.h file contains the Position data structure, and functions to convert from Skaia's notation into the notation that SIG-Game's framework expects. The SkaiaAction.h file contains a structure which represents an action. The SkaiaPiece.h file contains a structure which represents a piece on the board. The SkaiaState.h file contains a structure and a buttload of functions for manipulating a state of the game. The SkaiaState_internal.cpp contains definitions for functions which aren't too interesting. The SkaiaState.cpp contains definitions for funcitons that do alot of wacky stuff.

Things to note: The moves that a piece can make are actually a member of that piece, that way, when they need to be updated, only that piece's moves need be changed. Every square on the board contains a bitset which tells which other pieces can attack that square.

These two caches add alot of complexity to the code, I'm sorry.

About

A C++ chess-playing AI for SIG-Game's framework

License:MIT License


Languages

Language:C++ 98.1%Language:CMake 0.9%Language:Python 0.5%Language:Makefile 0.4%Language:Shell 0.1%