lichess.org
Donate

King of the Hill computer analysis

If I improved Stockfish to analyze KotH games, would lichess consider using it?
If it was reasonably good, yes! That would be really awesome!

Make sure stockfish main branch can be merged back into yours, so we don't stick to an old version forever.
I love King of the Hill chess. Computer analysis would be an awesome feature.
<Comment deleted by user>
Admittedly I'm finding this task much more challenging than expected, but I haven't given up yet. Theoretically this would only require changing however Stockfish defines "checkmate", assuming it defines such a thing...

My main performance concern would be to what degree this additional logic slows performance (or perhaps adds more "killer moves" resulting in better search tree pruining!) and whether it can be optimized.
Whoa! I'm thoroughly impressed.

I guess there's two ways that we can test it:
1. Go to http://en.lichess.org/games/search and filter the Variant by King of the Hill. Then download games individually and test them with your modified engine.

2. The engine is added to lichess and players can analyse their KotH games. This will of course be in beta-form testing, but it will be able to give you widespread feedback.

I'm personally happy to see option 2 implemented.
Toadofsky, this is nothing short of awesome. Once your branch is thoroughly tested, I'll totally integrate it to lichess. In an ideal world it would make it to Stockfish official repository (as proposed by your pull request). Even if that doesn't happen, I'm willing to use a forked version of Stockfish on lichess.org, if you agree to backport Stockfish updates to your branch from time to time. Because I like my AI up to date :)

Note that due to the way the AI cluster works, lichess can't pick a specific engine for a given game. Therefore, your engine would be used everywhere and for every game.

So, what's required:

- solid automated testing
- availability as Stockfish runtime option: comparable to "UCI_Chess960", have a "UCI_KingOfTheHill" option, that can be set through "setoption name UCI_KingOfTheHill value true"

What would be nice:

- frequent backports of Stockfish master branch
or
- inclusion in Stockfish official repo

Excellent work so far! I'd love to see it happening!
Thanks. This modification was largely inspired by and is in many ways simpler than SCIDB's modification to support 3-checks (with option UCI_VariantThreeCheck), and uses option UCI_VariantKOTH, which I should probably change to the more explicit UCI_VariantKingOfTheHill.

I now understand that the Stockfish official repo isn't interested in variants other than 960 at this time.

I'll look into whether Stockfish has an automated test which can be added to. If so, I can just add a few tests to it for this variant. If not, Stockfish is a rather sophisticated engine and it would be very time-consuming to develop a full automated test for it.

I'll make some general observations:
1. The new code is guarded by "pos.is_koth()" such that for standard chess, the new code will not execute
2. The new code is activated by Makefile specifying -DKOTH and can be disabled at compile time
3. The new code adds few data members to existing data structures like Position.
4. Although only 122 lines of code were added:
http://github.com/ddugovic/Stockfish/commit/59e8c595038baaa88f29141c80607e3ac72180fa
and although those lines are guarded by "pos.is_koth()" in order to not affect standard or 960 analysis, for KOTH analysis these lines of code need to be tested for accuracy and performance.

I'll change UCI_VariantKOTH to UCI_KingOfTheHill for clarity's sake and do some manual testing. I'm not sure how to discover whether or not automated Stockfish testing exists. I saw perft functions defined in the code, so perhaps that's where I'd need to start... thoughts, anyone?
Regarding "frequent backports of Stockfish master branch" this is the beauty of open-source software: even supposing I can't guarantee that I'll provide frequent enough updates, my code change is simple and anyone could apply it to a copy of the main branch (and improve upon it - for example, static evaluation functions can be improved, e.g. koth_distance fails to account for attacked squares that the king cannot pass through).

I see a typo in my previous message: I will change UCI_VariantKOTH to UCI_KingOfTheHill, not UCI_VariantKingOfTheHill (since UCI_Chess960 doesn't use the term variant either).

This topic has been archived and can no longer be replied to.