Giter VIP home page Giter VIP logo

headsup's Introduction

HeadsUp

A uci chess engine adapter that can combine 2 engines and play as one. First engine may play in the middle and the other engine may continue to play for the rest of the game. The switch from engine1 to engine2 and vice versa can be controlled by move number and/or total piece value remaining on the board.

A. Create a uci engine from 2 actual uci chess engines

1. Using headsup.py
  • Download python 3.8 and up
  • Install python-chess 0.31.2 and up
  • Modify headsup.cfg
  • Put headsup.cfg and headsup.py in the same folder
  • Create a batch file headsup.bat, see example in the repo.
    • write python.exe headsup.py
  • Install headsup.bat as a uci engine in cutechess GUI or Arena GUI
2. Using headsup.exe
  • Download headsup.exe
  • Modify headsup.cfg that can be found in this repo.
  • Put headsup.cfg and headsup.exe in the same folder
  • Install headsup.exe as a uci engine on the following tested GUI.

B. What it can do

  • You can play against it
  • You can play it against another engine
  • You can use in infinite anaysis.

C. Limitations

  • Can only use uci engines

D. Sample match

Pondering play at TC 60s+0.1s between HeadsUp and Stockfish

E. Credits

headsup's People

Contributors

fsmosca avatar

Stargazers

 avatar

Watchers

 avatar  avatar

headsup's Issues

connection stalls in CuteChess

a few times i used HeadsUp to play engine-vs-engine in CuteChess (on Linux) .. HeadsUp seems to work fine, but once stopped with a "White's connection stalls" message .. see game PGN and log below. Could some extra / other settings be needed ? I use a simple cfg.

NOTE: the CuteChess comment of the last move shows the other engine took 108 sec to return its best move Re7 and this is the longest thinking time in this game : was HeadsUp still idle to receive UCI commands ? btw. in the Python code i see a simple infinite "while True" construction .. is this a common / robust way ?

[Event "?"]
[Site "?"]
[Date "2021.08.01"]
[Round "?"]
[White "HeadsUp"]
[Black "SF asmFish"]
[Result "0-1"]
[FEN "2rqr1k1/pp1bbp1p/4p1pB/4P3/1Q1pN3/P4N2/5PP1/3RR1K1 b - - 0 2"]
[GameDuration "00:13:50"]
[PlyCount "39"]
[SetUp "1"]
[Termination "stalled connection"]
[TimeControl "720+5"]

1... Bxb4 {+2.38/30 23s} 2. axb4 {+0.01/39 86s} f5 {+0.13/35 0s}
3. Nf6+ {-0.02/41 35s} Kh8 {0.00/37 4.6s} 4. Rxd4 {+0.01/40 21s}
Re7 {0.00/37 0s} 5. Red1 {+0.01/44 61s} Rc7 {-0.15/39 0s} 6. b5 {0.00/41 23s}
b6 {0.00/33 9.9s} 7. Ng5 {+0.01/39 22s} Qc8 {-0.97/33 26s} 8. Kh2
Rb7 {-1.11/34 52s} 9. Kg1 {1.0s} Rc7 {-1.10/34 21s} 10. Rd6 {/40 1.1s}
Rb7 {-1.30/35 41s} 11. R6d2 {/44 5.1s} Rc7 {-1.62/30 20s}
12. Rd4 {+3.11/30 7.3s} Rb7 {-1.09/30 7.8s} 13. Kh2 {+3.51/31 5.4s}
Rc7 {-1.65/36 61s} 14. f4 {+4.01/40 0.77s} Qd8 {-2.78/39 63s}
15. Nxe6 {+4.99/42 2.9s} Rxe6 {-3.45/40 16s} 16. Rxd7 {+5.07/39 5.5s}
Rxd7 {-3.80/40 22s} 17. Rxd7 {+5.15/40 0.80s} Qxd7 {-3.12/40 14s}
18. Nxd7 {+5.23/38 9.4s} Kg8 {-4.07/39 10s} 19. Nf6+ {+5.30/35 4.5s}
Kf7 {-4.10/41 14s} 20. Nxh7 {+5.31/37 9.7s}
Re7 {-4.56/44 108s, White's connection stalls} 0-1

log_headsup.zip

new switch engine criteria

i see the cfg file : it has 2 factors which determine the switch .. could another criteria exist which determines the engine-to-use in a certain "position type" ? :: closed centre, with(out) queens, nr of open lines, nr of pieces attacked, etc. or combination of such factor values to create some new hybrid engine concept ?

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.