Code Monkey home page Code Monkey logo

chess's People

Contributors

hacst avatar silenthoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

chess's Issues

Pausieren wir das Spiel bei Player vs. 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:

  1. Spiel fortsetzen
  2. Spiel speichern
  3. Spiel beenden (zurück zum Hauptmenü)

B) AI vs. AI:

  1. Spiel fortsetzen
  2. Spiel beenden (zurück zum Hauptmenü)

Captured piece list

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:

  • the pieces which were captured by the player
    or
  • the pieces which were captured from the player

AI is broken in end-game

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# [*]

Zobrist hashing

Implement incremental Zobrist hashing (Polyglot constants?) and add it to ChessBoard for later use in AI transposition tables, repetition detection and maybe opening books.

Integrate new mate/checkmate detection into overall GameOver detection.

  • Current check-mate/stale-mate detection isn't used by isGameOver and getWinner functions in GameState.
  • Previously scoring was based around the king being taken. Now that this can no longer happen the game-over itself has to affect the score. Either the incremental scorer or the getScore function in the board should factor that in or the AI won't actively try to play into check-mate as there are no score increases to gain from it. If you want me to handle that just create a new issue and assign it to me though I likely won't get to it in the coming weeks.

AI should prefer early check mate over anihilation

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.

Knight's turn is wrong

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

Implement difficulty levels for AI

Maybe something like:

Easy: No opening book, depth limit
Medium: Opening book with mediocre moves, depth limit
Hard: Opening book with best moves

Umwandlung des Bauers (2)

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.

Logic offers turns that put king into check mate

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.

King allowed to make turn which puts him in checkmate

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

Iterative deepening

Implement iterative deepening for dynamic depth / time trade-off. Maybe even do it in the ponder phase.

Transposition tables

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.

Fix test regressions in ChessBoard

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:

  • As the incremental* functions rely on being informed about specific board changes it is likely that one or more of these taps was broken. Also new ones are probably required for rochade and promotion.
  • FEN Roundtrip relies on board state being re-created from a FEN string. Most likely new state was added but not properly inferred from the game situation in the corresponding constructor.
  • Haven't looked into the integration test ones. Maybe they make outdated assumptions. Maybe something broke. Dunno ;)

Logic allows striking the king

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

Simple test board no longer generate turns

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

Fix opening book lookup for en-passant/castle/etc.

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.

Promotions aren't handled correctly

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.

BB_SCAN call with empty BitBoard

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.