DanaSah Chess Engine
UCI and Winboard compatible
 DanaSah and DanaSah LimitStrength
---------------------------------------------

DanaSah is an freeware chess engine with xboard and uci protocols compatible. Their name comes from two words, Dana of Daniela and Sah that it means chess in Romanian. It can play on Windows in interfaces (GUI) such as Fritz, Shredder, Arena, Winboard or ChessGUI. On Linux in interfaces such as Xboard and Arena. On Android in interfaces such as Droidfish, Chess for Android, Acid Ape Chess or Hawnk Chess. There is even an older version to play on a Pocket PC with Mobile Thinkerboard. His Elo in the CCRL list is approximately 2600 points.

DanaSah LimitStrength is a version that plays with a reduced strength and is oriented mainly to play against humans, dedicated machines or other weaker engines.


DanaSah and DanaSah LimitStrength configuration with xboard Protocol
---------------------------------------------------------------------------------------

To configure the engine, we select in GUI during intallation the necessary file depending on the operating system that you use (for example "danasah___.exe" in Windows), the same file used for the xboard and uci protocol, only you have to indicate to the GUI the protocol which we will use. If there is a problem you can add the command xboard.

On Windows we can use Winboard, Arena, ChessGUI or even Chessmaster GUI, on Linux we can use Arena and Xboard, on Android we can use Chess for Android but in this case it is recommended to use the UCI version in order to install the engine in the favorite folder and not a given and thus not depend on the configuration file.

Engine will start with a series of parameters by default, these parameters may be changed with the help of Notepad or an editor by opening the "danacfg.txt" configuration file located in the same folder as the executable. These parameters are explained later in this document. Important: for changing these parameters is necessary save the file and start or restart the engine, since otherwise the engine does not know changes.


DanaSah and DanaSah LimitStrength configuration with uci Protocol
-----------------------------------------------------------------------------------

The configuration of the engine in uci mode is similar to xboard mode, we will have to indicate to the GUI the file and the protocol used if this is asked.

In Windows we can use uci version for example on Fritz, Shredder, chessGUI or Arena, In Linux with Arena and in Android on any interface that supports engines.

With the uci protocol not exists a configuration file, normally the parameters of configuration normally is modified within the own interface. The update of the values of the parameters usually is instant, except in the case of Arena. Anyway, I recommend restarting the engine or start a new game to be sure that the changes are made correctly.

Some old gui not sent to the "ucinewgame" command, in this case so that the engine has no problems in starting a new game it is necessary to select in the configuration the parameter "GUI Has Ucinewgame Command". So far the only GUI in which I've seen necessary to use this is the old Fritz 9 GUI.


Engine parameters
-----------------------

If we change the engine parameters in the "danacfg.txt" configuration file or from a window in the GUI, we have:

*  ELO Regulation (only in DanaSah LimitStrength).

- limitstrength: can take 2 values; true or false to enable or not the regulation. In uci version this parameter is enabled by checking the checkbox, it can occur that the gui does not display this option in the configuration and handle it from a special menu as occurs for example in Arena.

- elo: adjust its value between 500 and 2500.

- elo_type (opponent): engine, computer or human. When engine plays in "engine" mode against another engine will adjust its Elo as listed in the following page: https://sites.google.com/site/motoresdeajedrez/motores-hispanos/elo . List similar to the CCRL list, both list use BayesElo for the calculation. When the engine plays in "computer" mode against a dedicated chess machine (chess computer) it will do so with Elo active as we can see on the page:
http://www.schach-computer.info/wiki/index.php/Wiki-Elo-Liste . If the engine play in "human" mode try to adjust your Elo's agreement to the Elo FIDE.

- style: its value can be adjusted between very passive 1 to very aggressive 5 being 3 normal value  (not implemented at the moment).

- diff_engine: Elo engine may differ from a list to another (ex. CCRL and CEGT list) depending on the score given to a particular engine of the list to establish the rest of values or the average employed. If someone finds these values high or low when the opponent is another engine (type_elo or opponent is engine) than it should try to modify this parameter, an increase of this parameter in a unit reduces strength (not Elo) in a unit. With a value of this parameter of 0 the regulation would be similar to the CCRL list, with a value of -200 would look like the CEGT list.

- diff_computer_engine: use this parameter to establish a relationship between the hispanic list and dedicated machines list. For example the machine dedicated Mephisto Roma32 in the active list has an Elo of 2076 points, however in the hispanic list only would reach 1610, this means a difference of 466 points, with this value the engine will play 466 Elo points weakest when the opponent is a dedicated machine (type_elo or opponent is computer) to adjust its strength to value of the active list. If someone finds these values high or low,  he should try to modify this parameter, an increase of this parameter in a unit reduces strength (not Elo) in a unit, values between 350 and 475 might apply if diff_engine is OK.

- diff_human_computer: by different games between human players with Elo FIDE and machines dedicated is found that human with Elo FIDE have a force similar to a dedicated machine with around 70 points less, values between 70 and 80 might apply when the opponent is a human (type_elo or opponent is human) and if diff_engine and diff_computer_engine are OK.

The initial values of these parameters are:
limitstrength           true
elo                     2000
elo_type                human
style                   3
diff_engine             0
diff_computer_engine    466
diff_human_computer     70


* Levels (only in DanaSah LimitStrength).

- easylevel: this parameter can take 10 different values.

0  No easy level                Elo-Regulation
1  Random move
2  Newcomer                     Elo random 500 - 999
3  Beginner                     Elo random 1000 - 1199
4  Weak club player             Elo random 1200 - 1399
5  Average club player          Elo random 1400 - 1699
6  Strong club player           Elo random 1700 - 1999
7  Expert                       Elo random 2000 - 2199
8  Candidate Master (CM)        Elo random 2200 - 2299
9  FIDE Master (FM)             Elo random 2300 - 2399
10 International Master (IM)    Elo random 2400 - 2499


The initial value of this parameter is:

easylevel 0

If easylevel takes a value other than 0, this parameter will take into account the values of the parameters "type_elo" (opponent) and the different diff to adjust the definitive Elo. Not is necessary to activate "limitstrength" and not be consider the value of the "elo" parameter.


* Opening books.

DanaSah and DanaSah LimitStrength can use any opening book in PolyGlot format. The distribution includes the Rebel/Prodeo opening book in that format. It is advisable that the opening book is in the same folder that the engine, this facilitates the configuration since we only indicate the name and not give the route complete. If you want to use this opening book check that the GUI does not have activated the his own.

In DanaSah LimitStrength, the depth of the opening book is determined by the level of Elo, the number of plys (half moves) is determined by the formula elo/100 less the value of the different "diff". For example playing with 2000 Elo points in human mode engine would play about 7 or 8 movements of opening book ((2000-466-70)/100 plys).

- ownbook: 2 values; true or false to enable or not the own opening book. In the uci protocol activate with the check box selection,  in some GUI like Arena we can not see this parameter since Arena controls it from uci section.

- book: indicates the path where is located the opening book, if it is in the same folder as the engine is enough to give the name of the file, except in Android that is necessary to give the full path (e.g. /storage/sdcard1/book/book.bin)

The initial value of these parameters are:

ownbook    true
book       ../book/book.bin


* Tables Hash.

- hash: values of 8-16 Mb (bullet), 32-64-128 Mb (blitz) and 256-512-1024 Mb (standard) have been tested without problems. Usually much more RAM more time will take to fill tables and the engine will gain some strength, but it is possible that no more than 10 Elo points. In fast times an oversizing can be counterproductive.

The value initial of this parameter is:

hash    256


* Scorpio Bitbases for endgame.

DanaSah and DanaSahLimitStrenght with the help of the Scorpio bitbases can play more intelligently in the endgame.

The bitbases give information about a position in the board when are 6 or less pieces (counting the 2 Kings), indicate if the position is won, draw or loss, but do not indicate the distance to mate and can happen that in even with such information the engine is not capable of giving a mate because of the 50 moves rule, for example could occur to mate with king, bishop and knigth versus king need more than 50 moves, by which this endgame table is not perfect.

To have 6 men we need almost 48 Gbyte hard disk, it is possible to use 5 men with a size of about 205 MB and the 3 and 4 men occupy less than 4 Mbytes. It is necessary have  "dll" or "so"  files are in the folder of the bitbase (recommend Egbbprobe 4.1).

- egbb_path: is the path where are stored the bitbases.

- egbb_men: how many pieces of bitbases are installed or the number of pieces which we want to play.

- egbb_cache_size: is the size of RAM memory used to accelerate the search process when accessing the bitbases files, if we are going to check with 4 men a size of 4 Mb is enough, if we will check 5 men would be advisable to increase the size to 16 Mb and 6 men to 64 Mb.

- egbb_load_type: loads into memory the files needed to access the bitbases, this is as fast, if the value is 0 does not load any files, if the value is 1 loads files up to 4 parts and occupies about 10 Mb of memory, if the value is 3 load the files of 5 pieces and need around about 250 Mb Today computers usually do not have problems with this amount of memory, but it can happen that the initiation of the engine takes several tens of seconds and that this may cause problems when playing against other engines match.

- use_egbb: a value of 1 active bitbases and a value of 0 deactivated. Uci protocol don't have this parameter, you must choises in Endgames Tablebases the Scorpio option.

The start values for these parameters are:

egbb_path        ../egbb/
egbb_men         4
egbb_cache_size  4
egbb_load_type   1
use_egbb         1

Do not use 6 men scorpio bitbases for games, just for analysis, as this could slow down the engine.


* Gaviota tablebases for endgame.

DanaSah and DanaSahLimitStrenght can play in a more intelligent way the endgame with the help of gaviota tablebases.

Unlike bitbases, tablebases not only indicate if the position is lost, win or draw, also indicate the distance to mate if any. The consequence of this is that the tablebases occupy much more space on hard drive, at the moment only is available 5 men for gaviota tablebases (including the 2 Kings) and the occupied space is more than 6 Gbytes. It would be possible to use only 3 and 4 parts with a space of about 26 Mbytes.

- egtb_path: is the path where are stored the tablebases.

- egtb_cache_size: is the size of RAM memory used to accelerate the search process when accessing tabletbases files, for 5 men it is necessary to use about 16 Mb and if we can more (recommended 64 Mb).

- use_egtb: a value of 1 active the tablebases and a value of 0 deactivated. Uci protocol don't have this parameter and you must choose in Endgames Tablebases the Gaviota option.

The values preset for these parameters are:

egtb_path        ../gtb/gtb4/
egtb_cache_size  16
use_egtb         1

It is best to use 5 men of gaviota tablebases if are available and do not use bitbases. Another possibility would be to use 4 men of gaviota tablebases and complete it with 5 men of scorpio bitbases. 


* Noise.

-noise: print the principal variant in each iteration of the depth makes the engine something slower and lose some strength, because of this some engines not printed it in low depths when they play in bullet-blitz mode. We can indicate a number of nodes to which is not printed. This option is only available for the xboard Protocol. In the uci Protocol is limited the information printed until no passes at least 1 second.

In DanaSah LimitStrenght not has much sense this parameter since the engine passes normally the majority of their time as sleep, it is not affects if show more or less information.

noise    0


* Chess960 or Fischer Random Chess.

DanaSah and DanaSah LimitStrength can play chess variant Fischer Random Chess (FRC) or chess960, so we need a gui that supports such variant.

Engine known positions in format xFEN (KQkq) and ShredderFEN (HAha) so you can play in any gui that has support this variant y and on both xboard and uci Protocol. In Windows we can use Fritz, Shredder, Arena, Winboard, ChessGUI, etc. It has not been tested on Linux but should work on Arena and Xboard. Acid Ape Chess can be used on Android.

In the uci Protocol is required to select the appropriate check box to activate the variant, select UCI_chess960. In the xboard protocol is not necessary to select nothing.


Engine features
-------------------
  • Board representation: array of 64 elements, it is based on Firstchess (Pham Hong Nguyen).
  • Iterative depth with aspiration windows.
  • PVS search and quiescent. Thanks to Bruce Moreland and Ed Schroeder for their Web pages.
  • Move ordering (hash, follow pv, captures, promotion, killer moves, heuristic history).
  • Transposition tables. Thanks to Miguel Izquierdo (Popochin engine).
  • Adaptive Null move prunning, R = 2-5.
  • (Internal) Iterative Deepening.
  • Search extensions (check, pawn in seventh, recapture, endgame of pawns).
  • Futility prunning and razoring.
  • Late move reduction (LMR).
  • Edit mode (setboard), Move now, Ponder and Analyze.
  • Eval with lazy eval and cache. Eval of material, piece-square tables, mobility,  pawns structure, open files, king safety, king attack ...
 

Credits
---------

(c) Pedro Castro. Basque country. Spain (February 2017). Software GNU GPL3 license.

Thanks to Jeroen Nomen and Ed Schroeder (Rebel/Prodeo engine) by the use of his opening book in format PolyGlot.

Thanks to Daniel Shawul (Scorpio engine) by the use of his bitbases.

Thanks to Miguel Ballicora (Gaviota engine) for the use of his tablebases.

And in general thanks to all the authors of engines that showed their source codes or shared their ideas, thanks to the organizers of tournaments and program tester.