Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by mvanthoor »

Hi :)

Writing a chess engine has also caused me to wanting to pick up playing chess again. I've not played a human over the board for almost 20 years, and I dislike playing chess on a computer screen. Therefore, I've owned a DGT Board for the last 13 years, and I've been using it with Fritz 11 (and only Fritz 11).

Now I want to try some other engines that have strength settings built in.

Settings that use their own system, such as Stockfish and Texel work fine. However, an engine that uses uci_limitstrength and uci_elo, doesn't work. The options simply do not appear in the options dialog. I've tried Rybka 2.3.2a, Arasan, CT800, and some others.

MadChess DOES work, and it turns out it has uci_limitstrength, and uci_elo, but ALSO "limitstrength" and "elo". Those last two are the options appearing in the parameter dialog of Fritz 11. To be sure, I've had two friends test some of the engines in Fritz 14 and 17 respectively, and there, the uci_limitstrength and uci_elo options also don't appear. ALL other options of the engines do appear however. I'm therefore assuming that the Fritz GUI is actively filtering uci_limitstrength and uci_elo from the options and refuses to display them.

(It seems that using the strength settings in Fritz versions such as in "Handicap and fun" loads some internal engine, which isn't even Fritz itself, but also isn't the UCI engine. I've tried it:I've deleted the Fritz engine, loaded an engine of which I KNOW it doesn't support the options in "Handicap and Fun", and they still worked.)

Has anyone experienced this? Can I get the Fritz GUI to display those uci_limitstrength and uci_elo options somehow? (There are conflicting messages that I can just set them in the configuration files, but that's a lame way of doing it.)

The reason I'm hell-bent on using the Fritz GUI is because it is the only one that FULLY supports the DGT Board.

Arena: doesn't understand New Game, of Draw Offer commands. Ignores the clock time. (But it does work to play, actually, and it does show the moves on the clock.)
Shredder: Seems to work fine, if the option "Special Shredder/Arena mode" is set in the driver, except for displaying the game result: if the engine (GUI in this case) resigns, you'll be waiting forever until you glance at the screen, because the clock doesn't display that the game is over. (I could live with that.)
Aquarium: I looked at a demo version some years ago. I REALLY don't like the user interface.
LucasChess supports the board, but I haven't tested the program. I don't like the GUI.

So, the Fritz GUI does seem to be the best option (still) for using the DGT board, but it doesn't support... actually, actively ignores... the critical uci_limitstrength and uci_elo options.

So.. is there another GUI (Chess Explorer doesn't support the DGT Board; Tarrash doesn't, as far as I can see) that I could try? Maybe an open source GUI for which I could possibly add DGT support...?

If there's no other option, maybe the best thing to do would be to go and download some open source engines that support uci_limitstrength and uci_elo, and then go in and either rename the options, or put in an alias, and recompile the engines for my own use in the Fritz GUI.

Maybe this would be a nice project after I finish Rustic; write a VERY simple GUI, that only does a few things, at least initially:

- Import an engine and save the optoins
- Be able to play against the engines
- Read .bin polyglot opening books
- Keep time
- Save a game as a PGN
- Use the DGTEBDLL (or the DGTEBDLL64 variant) to communicate with the DGT-board

Basically, a very simple user interface between the DGT-board and a chess engine, that FULLY supports all the options. I don't know where people like Aart Bik have gotten the information, but he seems to be able to control the DGT-board from Android, without using the DGTEBDLL. (Reverse engineered the protocol maybe; I've not tested the application to see if it is as compatible as the Fritz GUI.)

Do you think there would be some interest in this GUI besides for myself? (I'm, for example, reluctant to upgrade from Fritz 11, because I've seen with friends that since version 12, the Fritz GUI has become quite buggy, some of them having had like 40+ updates in a year. Also, the new versions have SO MUCH online stuff that I don't need or want.)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by Ferdy »

mvanthoor wrote: Sat Jun 06, 2020 1:28 am Hi :)

Writing a chess engine has also caused me to wanting to pick up playing chess again. I've not played a human over the board for almost 20 years, and I dislike playing chess on a computer screen. Therefore, I've owned a DGT Board for the last 13 years, and I've been using it with Fritz 11 (and only Fritz 11).

Now I want to try some other engines that have strength settings built in.

Settings that use their own system, such as Stockfish and Texel work fine. However, an engine that uses uci_limitstrength and uci_elo, doesn't work. The options simply do not appear in the options dialog. I've tried Rybka 2.3.2a, Arasan, CT800, and some others.
Try to look at the rated game button if you have it. In Fritz 13 that can be accessed via Training/Rated game, then adjust the slider to adjust the strength. Typically Fritz will send the commands,

Code: Select all

>> setoption name UCI_LimitStrength value true
>> setoption name UCI_Elo value 1500
to the engine.
Rowen
Posts: 74
Joined: Tue Nov 15, 2016 1:19 pm
Location: Cheshire, England

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by Rowen »

Hi
I remember having at various occasions the Fritz 8 9 10 11 12 and 14 gui's installed on my computer, I used to notice that the 11 version seemed to see engine parameters that the others just didn't, yes often Elo parameters. The only disadvantage to Fritz 11 gui was that sometimes it would not register some of the newer engines such as the latest stockfish versions.

Can't really help you with any new information, I've always found the rodent engines good for playing against particularly the older versions, to limit strength NPS can be adjusted amongst other parameters.
Bill Forster
Posts: 76
Joined: Mon Sep 21, 2015 7:47 am
Location: New Zealand

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by Bill Forster »

I can suggest one workaround that might be fun for you to try, and might even be a practical solution. You could make patched versions of the engine .exe files that you want to run. Inside the patched versions you could change the text of uci_limitstrength and uci_elo to some other text. The idea is that the implementation of these features within the engine probably uses these literal strings, and that any other unique and distinctive text would work just as well. But if you are correct and Fritz is deliberately targeting those strings, then it will be frustrated (and you won't be).

Perhaps it will be clearer with an example. I just ran the following in a "Run as administrator" Windows command prompt;

Code: Select all

C:\Program Files (x86)\Tarrasch\Engines>"Rybka v2.3.2a.mp.w32 - Copy.exe"
uci
id name Rybka 2.3.2a mp 32-bit
id author Vasik Rajlich
option name Hash type spin min 2 max 4096 default 32
option name Max CPUs type spin min 1 max 2048 default 2048
option name Display PV Tips type check default false
option name CPU Usage type spin min 1 max 100 default 100
option name Win Percentage to Hash Usage type check default false
option name Display Current Move type check default true
option name NalimovPath type string default <empty>
option name NalimovCache type spin min 1 max 256 default 1
option name NalimovUsage type combo default Rarely var Frequently var Normally var Rarely var Never
option name Preserve Analysis type check default false
option name Clear Hash type button
option name Ponder type check default true
option name MultiPV type spin default 1 min 1 max 100
option name UCI_LimitStrength type check default false
option name UCI_Elo type spin default 1200 min 1200 max 2400
option name Server Buffer type check default false
option name UCI_AnalyseMode type check default false
option name UCI_Opponent type string default <empty>
option name UCI_EngineAbout type string default www.rybkachess.com
option name Contempt type spin default 0 min -100 max 100
option name Outlook type combo default Neutral var Very Pessimistic var Slightly Pessimistic var Neutral var Slightly Optimistic var Very Optimistic var Ultra Optimistic
option name Rate Of Play type combo default Normal var Ultraslow var Slow var Normal var Fast var Ultrafast
option name Time Usage type combo default Varied var Constant var Varied
option name Emergency Time Buffer type combo default Medium var Small var Medium var Large
uciok
quit

C:\Program Files (x86)\Tarrasch\Engines>ren "Rybka v2.3.2a.mp.w3 - Copy.exe" r.exe

C:\Program Files (x86)\Tarrasch\Engines>patch32 r.exe
PATCH file patch utility V3.0  (c) Paragon Solutions 1998. Type ? for help
Reading file "r.exe" into memory starting at 000000 ...
Buffer range is 00000-3FFFFF (= 4096K)
File occupies   000000-3A4FFF (= 3732K)
=>s 0 3a4fff "UCI_LimitStrength"
36B03C  36BC37  36BC64  36BC93  36BCBC
=>r 0 3a4fff "BillWasHereFlagXX"
36B03C  36BC37  36BC64  36BC93  36BCBC
=>s 0 3a4fff "UCI_Elo"
36B074  36BCEB  36BD08
=>r 0 3a4fff "Marmite"
36B074  36BCEB  36BD08
=>w
Writing 3A5000 (=3821568) bytes, starting at 000000 to file "r.exe"
=>q

C:\Program Files (x86)\Tarrasch\Engines>fc/b "Rybka v2.3.2a.mp.w32.exe" r.exe
Comparing files Rybka v2.3.2a.mp.w32.exe and R.EXE
0036B03C: 55 42
0036B03D: 43 69
 ....
0036BD0D: 6C 74
0036BD0E: 6F 65

C:\Program Files (x86)\Tarrasch\Engines>
What I am doing here is determining that the literal strings in Rybka v2.3.2 are "UCI_LimitStrength" and "UCI_Elo". I am then changing them (in a copy of the .exe of course) to "BillWasHereFlagXX" and "Marmite" respectively. Please excuse these absurd names. I then played a game with r.exe in my own Tarrasch engine, with "BillWasHereFlagXX" set to true (instead of the default false) and "Marmite" set to 1200. I played with the default Tarrasch setting of 25+5 for me (White) and 3+1 for Rybka (Black). With no book the game began 1.d4 Nc6 2.d5 Ne5 3.e4 Nf6 4.f4 Neg4 5.e5 and Black is already hopelessly lost and I won easily. I have just checked that playing a new game with nothing changed except "BillWasHereFlagXX" set to false, Rybka returns to its normal self, playing good chess and killing me easily once tactics begin. It used its time sensibly (in the game I won it played all moves instantly).

I do not use Fritz (indeed I find the ChessBase GUIs horribly inflexible and unintuitive which the main reason I decided to write Tarrasch in the first place : ), so I can't test with it.

Incidentally, the patch32.exe program above is a DOS program I wrote myself in the last century. It needs to run in administrative mode, but it still seems to work well enough (although it's limited to a 4M buffer, so I was lucky, Rybka 2.3.2 only just fit). I am sure if you are motivated you can find another way to do binary .exe editing.

I have put the patched r.exe at http://triplehappy.com/downloads/r.exe and patch32.exe at http://triplehappy.com/downloads/patch32.exe in case any of this interests you.

(You are right Tarrasch certainly cannot interact with physical chess boards, although it is MIT Licenced open source on Github, so you could modify it yourself if you like it)
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by mvanthoor »

@Ferdy: Thanks for the tip, but I rarely play rated games, if ever.

@Rowen: I've tested some engines in both Fritz 11 and Fritz 17. In my case, Fritz 11 doesn't display more or different options than version 17. That's not to say you're wrong; Chessbase is noted for adding, removing, or breaking functions in different patches. My version of Fritz 11 is at the latest patch level from 2009 (the last 2010 patch breaks the program in different ways). I've also acquired Fritz 17, because 11 is beginning to have problems. It doesn't install cleanly (errors, but in the end, it does work), it has graphical glitches (doesn't support scaling on high-dpi monitors, which either breaks the UI or makes it blurry... take your pick), and the communication with the DGT-board and clock is slower than it was under Windows 7 in the past. Sometimes it takes 4-5 seconds for the move to appear on the clock after the program has moved. I think it's time to move on to the latest Fritz GUI. I solved the online unwanted stuff by just blocking Fritz 17 in the Windows firewall, and all the online functions stop connecting and thus either don't display anything or don't even open.

@Bill: I've been testing, and it seems even worse than I thought. Rybka has a lot of "uci_*" options, and the Fritz 11 and 17 GUI don't display any of them, Zilch. They do display all of the other options (or I know which one will will be used where, such as "Clear Hash".) Same for other engines: all the options are there, except the "uci_*" ones. It does seem that Fritz deliberately filters uci_* options and keeps them from the user. (That is SO EXTREMELY LAME. I hate software that actively works against me. But... yeah... the DGT board... which I REALLY want to use. I actually quit playing Go, because the NetGoban startup failed; they were going to build a DGT-like board for Go and then didn't.)

You did to the exe what I'm going to do to some open source engines, but I'll do it directly in the code. I'm going to rename all the uci_* options to ext_* or eng_*, recompile the engine, and then the Fritz GUI will probably display them as such. (MadChess already has an alias for uci_limitstrength and uci_elo, just called limitstrength and elo, and they work.)

I'm not really interested in commercial engines since UCI became commonplace and Fruit came onto the scene. I only need a few engines with different playing styles and strength settings to play against; for writing my own chess engine, I'm going to use many open source and free engines to test against, but I'll probably never play them myself because they're way too strong.

I'll also have a look at Tarrasch. Maybe, at some point, I'll look into getting the DGT board to run with it, if I like the GUI. The one thing I dislike is that the DLL that abstracts the serial communication is only available for Windows. I wonder why DGT never made one for Mac or Linux. There are some LInux projects that can communicate with the DGT board and clock, but they probably do it "bare metal", and apart from PicoChess, it often doesn't work well. (Hell, even in Windows, most GUI's that DO use the official DLL don't work well enough to use them; Shredder and Fritz being the only notable exception.)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by mvanthoor »

@Bill, PS: The modified exe needs elevated privileges to run. This is a deal breaker.

If I have time tomorrow, I'll test with some engine to see if renaming the option / string in the code and then recompiling works. For an engine to play against, I don't have to do too much research; I don't really care if it is as fast as possible, or if it is 32-bit or 64-bit. I care much more how it plays (style), if it actually uses all of its time as it normally would (so probably weakening it by lowering NPS by "wasting time"), and that it doesn't weaken itself by just throwing one or two pieces in the beginning of the game and then going full out. I assume this test will take some time, and I'll probably like some engines better than others :)
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Bill Forster
Posts: 76
Joined: Mon Sep 21, 2015 7:47 am
Location: New Zealand

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by Bill Forster »

mvanthoor wrote: Sat Jun 06, 2020 9:10 pm @Bill, PS: The modified exe needs elevated privileges to run. This is a deal breaker.
This doesn't sound right. How can it possibly require elevated privileges? Are you sure you're not trying to run patch32.exe as an engine? The modified engine is r.exe. :)
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by mvanthoor »

Bill Forster wrote: Sat Jun 06, 2020 9:59 pm
mvanthoor wrote: Sat Jun 06, 2020 9:10 pm @Bill, PS: The modified exe needs elevated privileges to run. This is a deal breaker.
This doesn't sound right. How can it possibly require elevated privileges? Are you sure you're not trying to run patch32.exe as an engine? The modified engine is r.exe. :)
I've tried again. The elevation was because I renamed the executable. The option BillWasHereFlagXX and Marmite are available. This proves that the Fritz GUI excludes (at least) uci_elo and uci_limitstrength. However, I don't like Rybka with these options. Something is off. I've set BillWasHereFlagXX to true, and ELO to 1300... but Rybka calculates to depth 14, moves instantly, and is WAY too strong for ELO 1300. I'm capable of defeating Stockfish 11 at level 5 at least half of the time. That'd put me at CCRL 1850 or thereabouts. (I ran a Stockfish level test according to CCRL standards last year: http://www.talkchess.com/forum3/viewtopic.php?t=71288).

I don't know how accurate CCRL is versus human ratings, but my rating as a teenager in school also fluctuated around 1850 ELO when I still competed in chess.

I don't know why Rybka feels so strong at ELO 1300, apart from the engine being miscalibrated or the options not working correctly (in the Fritz GUI). Tomorrow, if I have time, I'll try to change an open source engine and recompile it.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by Ferdy »

mvanthoor wrote: Sat Jun 06, 2020 8:18 pm @Ferdy: Thanks for the tip, but I rarely play rated games, if ever.
The idea is to see if Fritz 11 has the UCI_LimitStrength feature.
Bill Forster
Posts: 76
Joined: Mon Sep 21, 2015 7:47 am
Location: New Zealand

Re: Fritz GUI ignores uci_limitstrength and uci_elo on purpose?

Post by Bill Forster »

mvanthoor wrote: Sun Jun 07, 2020 12:12 am
Bill Forster wrote: Sat Jun 06, 2020 9:59 pm
mvanthoor wrote: Sat Jun 06, 2020 9:10 pm @Bill, PS: The modified exe needs elevated privileges to run. This is a deal breaker.
This doesn't sound right. How can it possibly require elevated privileges? Are you sure you're not trying to run patch32.exe as an engine? The modified engine is r.exe. :)
I've tried again. The elevation was because I renamed the executable. The option BillWasHereFlagXX and Marmite are available. This proves that the Fritz GUI excludes (at least) uci_elo and uci_limitstrength. However, I don't like Rybka with these options. Something is off....

I don't know why Rybka feels so strong at ELO 1300, apart from the engine being miscalibrated or the options not working correctly (in the Fritz GUI). Tomorrow, if I have time, I'll try to change an open source engine and recompile it.
I remember doing some experiments a while ago (I am away from my office and can't check) and I also found Rybka didn't really implement the Elo limiting convincingly. I think there's something in the Tarrasch FAQ about it. I was surprised and happy to beat it so easily at 1200 :). To be fair, simulating amateur chess convincingly is not a trivial problem I suppose. I seem to recall Shredder is praised for doing a good job in this area?

I remain pleased with my suggested solution. It's not guaranteed to work with every engine, but there's a very good chance. And it's a lot easier than setting up for recompilation etc.