hacst / chess Goto Github PK
View Code? Open in Web Editor NEWChess game with OpenGL GUI and AI
Chess game with OpenGL GUI and AI
Während des Spiels soll es ein Menü geben, womit man das Spiel unterbrechen kann, um (bei Player vs. AI) zu speichern. Bei AI vs. AI gibt es diese Möglichkeit nicht und das Spiel kann im Hintergrund auch weiterlaufen.
Soll das Spiel bei Player vs. AI dann pausiert werden, oder im Hintergrund weiterlaufen?
Zur Info: Beide Spielmodi sollen dieses Menü haben, es unterscheidet sich wie folgt:
A) Player vs. AI:
B) AI vs. AI:
The captured list of the black player seems to be the same as the list of the white player or vice versa - its not fully clear what is meant with captured pieces:
It seems like the AI even with considerable material advantage isn't able to win a game like:
7k/8/1B6/5K2/8/3Q4/8/8 w - - 1 135
Which can be be brought to the end in two moves (http://chessok.com/?page_id=361):
[#] Mate in 2 moves 1. Kg6 Kg8 2. Qd8# [*]
Implement incremental Zobrist hashing (Polyglot constants?) and add it to ChessBoard for later use in AI transposition tables, repetition detection and maybe opening books.
Ich brauche für die Ausgabe der Texte neben dem <<-Operator zusätzlich den Operator + um Strings konkatenieren zu können.
Kannst du das noch einbauen?
Current scoring gives an advantage to striking all enemy pieces before reaching a check-mate compared to achieving it as fast as possible (maybe while incurring losses). This leads to unnecessarily long play.
Winning should probably have a fixed, very high score so a check-mate is taken as soon as possible. Some though should be given on how to prefer quicker check-mates of ones with more turns (depth?).
For this to be properly implemented the game-over/check-mate detection in the game logic has to be fixed first though. Until then this issue is deferred.
Show if players king is in check.
e.g. gamestate->chessboard->getCheckmate[White] is set when white king is in check position
We still don't detect threefold repetition in the logic which violates the FIDE rules (and makes the AI behave stupid in some cases).
http://en.wikipedia.org/wiki/Threefold_repetition
The GUI displays the files the wrong way around. Atm. the leftmost is H while the rightmost is A.
See also: http://i.imgur.com/NosJqtO.png
r - b q k b n r
p p p p - p - p
n - - - - - p -
- - - - - - - -
- - - - - - - -
p - - - P - - -
- P P P - P P P
R N B Q K - N R
r1bqkbnr/pppp1p1p/n5p1/8/8/p3P3/1PPP1PPP/RNBQK1NR w KQkq - 0 4
Hash: 1213add0f1596a9
Score estimate : -430
Maybe something like:
Easy: No opening book, depth limit
Medium: Opening book with mediocre moves, depth limit
Hard: Opening book with best moves
These Actions are needed to implement a proper way of dealing with promotion, castling, ... in the GUI.
Der Bauer soll umgewandelt werden können.
Erster Ansatz: Die Zugliste enthält eine "Action" vom Typ "Promotion" und kann dann durch eine Figur getauscht werden. Sobald der Spieler das Feld auswählt und in einem Zug eine Umwandlung möglich ist, wird ihm die Möglichkeit zur Umwandlung angeboten. Das kann dann durch Tastaturbefehle getan werden.
Die Figur wird auf dem Feld platziert, auf dem der Bauer vor der Umwandlung stand.
GUI does not handle games ending in a draw.
Der Spieler soll durch Tastatursteuerung das Spiel beeinflussen können.
Given the situation:
- - b r - - k -
- p p n - p - p
- - - - p - p -
r - - - - - P -
- - - P - - - P
- - - - q N K -
- - - - - - - -
- - - - - - - -
2br2k1/1ppn1p1p/4p1p1/r5P1/3P3P/4qNK1/8/8 w - - 0 33
Hash: 76048dfc55020cec
Score estimate : -2575
The logic offers moves for the white knight putting the white king into check mate by blacks queen.
Given the situation:
- - b r - - - -
- p p - - p - k
- - - - p - - P
- - - - P r - p
- - - - - - K -
- - - - q - - -
- - - - - - - -
- - - - - - - -
2br4/1pp2p1k/4p2P/4Pr1p/6K1/4q3/8/8 w - - 0 38
Hash: 24bcc649cd59a281
Score estimate : -2575
The logic offers moves for the white king to strike the black pawn putting himself into check mate by blacks rook.
In the situation below the black king is offered striking the white queen on f2 which would put him in checkmate by the White Bishop on D4
2014-Feb-20 05:56:00.068821 | info @ <GUI:GamePlay>:
- - - - - - K -
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - B - - - -
- - - - - - k -
- - - - - Q - -
- - - - - - - -
6K1/8/8/8/3B4/6k1/5Q2/8 b - - 33 163
Hash: 493789b0dced742c
Score estimate : -1240
Implement iterative deepening for dynamic depth / time trade-off. Maybe even do it in the ponder phase.
Die Methode wird immer zwei Mal aufgerufen. Deswegen erscheinen auch die Züge immer zwei Mal in der GUI.
How should you handle the castling of the rook and king? This should be done in one turn.
Implement transposition tables. Requires #7 . As we cannot validate moves we probably have to rely on the turn list to catch collisions in the tables.
If the resources aren't available the game crashes instead of shutting down cleanly. Not really a big issues but not exactly ideal either.
logic_test shows the following test regressions introduced by additional commits after 9c9adb6:
[ FAILED ] ChessBoard.fromFENRoundtrip
[ FAILED ] ChessBoard.IncrementalHashing
[ FAILED ] ChessBoard.IncrementalScoreEvaluation
Additionally all tests in integration_test now fail:
[ FAILED ] Gen_Alg_Eval.PawnOnesidedStandoff
[ FAILED ] Gen_Alg_Eval.PawnOnesidedStandoffReverse
[ FAILED ] Gen_Alg_Eval.KnightStrikesPawn
Notes:
There should be more information on the GUI about the field where the cursor stands.
Black rook made turn e5h5 striking the white king instead of triggering game over due to check-mate.
Situation afterwards:
- - b r - - - -
- p p - - p - k
- - - - p - - P
- - - - - - - r
- - - - - - - -
- - - - q - - -
- - - - - - - -
- - - - - - - -
2br4/1pp2p1k/4p2P/7r/8/4q3/8/8 w - - 0 40
Hash: 8ce1971b46174f34
Score estimate : -22565
It seems like the turn generation got more strict in when it tries to generate moves. At the moment various tests use the assumption that very simple boards without King can be used to "play" to annihilation which no longer seems valid as this game state is detected as GameOver as no turns are generated. If we want to retain the possibility to play with very simple boards this should be fixed.
Test regressions in integration_test:
[ FAILED ] 3 tests, listed below:
[ FAILED ] Gen_Alg_Eval.PawnOnesidedStandoff
[ FAILED ] Gen_Alg_Eval.PawnOnesidedStandoffReverse
[ FAILED ] Gen_Alg_Eval.KnightStrikesPawn
Moves taken from the opening book only could represent normal "moves" as that was all the engine supported at that point. Now that the other moves are supported it should be possible to play them from the book if available.
See also: http://i.imgur.com/ryFBR6O.png
r n b q k b n r
p p p p - p p p
- - - - - - - -
- - - - p - - -
- - - - - - - -
N - - - - - - -
P P P P P P P P
R - B Q K B N R
rnbqkbnr/pppp1ppp/8/4p3/8/N7/PPPPPPPP/R1BQKBNR w KQkq e6 0 2
Hash: cba54e0168262b64
Score estimate : -30
It must be possible to save and load a game. To save a game the player can store each game state in one of three slots. To load a game the player can load a previously saved game from one of the slots.
The option for a promotion is given when a pawn reaches the eight (/first) rank and isn't a separate move done once standing on that field as currently implemented.
This bug also has implications for scoring, hashing as well as opening book play.
Figuren werden sichtbar auf dem Feld verschoben.
Ungefährer Aufwand: ~6 Std.
BB_SCAN mustn't be used with an empty (0) bitboard as then the behavior is undefined. With 0d737b4 assertions for this case were added which are triggered by logic_test and gameplay.
We either must decide on fixed semantics for BB_SCAN for this case or prevent it from being called that way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.