Chess engines are computer programs able to find good continuations for a given position.
They wont give you the absolute best continuation, but belive me, they will give you very good lines.
The way they look for a line, is by evaluating certain movements. For example, after 1.e4 e5
it could be played Nc3 followed by Nf6,
or Nc3 followed by d6, or by
Bb4 and so on ...
This data structure becomes a tree, where each position, related to each possible movement, is a node.
This tree grows incredibly fast as you look deeper, and the engines have to evaluate a lot of lines in order to find an acceptable
one. It is so big that it is estimated to be bigger than the number of atoms in the entire observable universe, that's why
chess programs can't save every single line in a data base, it is still physically impossible (maybe with quantum computers).
As a result, it is not practical to try to find a winning line from the majority of positions, specially
for those in which there is no clear advantage.
The engine would have to look too deep to give you a winning line, consuming in most cases, too much time.
Those are the key concepts, depth and time.
You can tell the engine how many time you want to spend looking for a good line,
or you can tell the engine how deep in the tree it should look for it.
In the first case, line's depth is undefined, it depends on the computer the engine is running on, the position itself
and other factors. The response for different analysis will be of different depth.
In the second case, what is undefined is the time the engine will spend searching for a line with a given depth.
This time the consumed time will vary between different analysis, for different positions.
No method is better, it depends on the circumstance.
Engines have to evaluate each node in order to give them a punctuation, to make comparisons between
different continuations. Here is where the difference between engines resides.
Stronger engines evaluate each position more accurately than weaker engines,
and the same happens with the lines it discards in order to not evaluate the entire tree, stronger
engines discard lower scored lines better than weaker engines, saving wasted time.
Learn how to use the analysis tool at youtube.com
utilizes time based analysis only when a live match is observed.
You can change it in the movetime field.
A value of 0.4, it will tell the engine to spend 0.4 (almost a half) seconds per position.
Depth based analysis is made for automatic responses, like puzzles, and for position analysis.
A depth of 12, it will tell the engine to look for an acceptable line up to 12 movements (called plies).
The third value called multipv is for the quantity of lines you want to retrieve from the engine.
Most of the time you want to get only a good line, but there are engines that can give you more than a single scored line.
It is useful when a bad move was made, and you want to see better possible continuations.
A value of 3, it will tell the engine (if supported) that you want not only one, but up to 3 possible continuations.
comes with some integrated engines by default, but it is possible to add external engines.
Available integrated engines are:
- Garbo 6.0
- Lozza 1.16 a
- Stockfish 5 JS
- Stockfish 6 JS
- Stockfish 6 ARM
(only for Android app) ARM compiled Stockfish 6
- Custom HTTP server
(this is for adding external engines)
How to add external engines
You can add external engines by selecting "Custom HTTP server" from the available engines list.
It is necessary 2 components in order to make it work, namely, a server and the engine itself
Once node.js is installed you can run the following command in a terminal
nodejs EngineServer.js port=9080 engine=/path/to/your/engine
This command will instantiate a very simple http server. You can safely run it on your
local computer, but if you want to make it public you should make some security changes to the code, like a maximum allowed depth or evaluation time, etc.
Once running, by selecting "Custom HTTP server" the app will try to connect to it when necessary
Tested external chess engines
The Chess Programming Wiki
is a repository of information about programming computers to play chess