Page 1 of 2

Clericus/Hopeless ported to Lazarus

Posted: Sun Aug 02, 2020 12:43 am
by Roland Chastain
Hello!

I ported to from Delphi to Lazarus the Clericus/Hopeless project by Pawel Koziol. Here is the GitLab repository, where you can download the source code and a Linux binary of the engine.

https://gitlab.com/rchastain/hopeless-lazarus

The program has two build modes. It can be built as a GUI, or as an XBoard/WinBoard engine. Clericus is the name for the GUI, Hopeless the name or the engine.

The engine is not very strong, so it can be an interesting opponent for average players (like me). :)

Regards.

Roland

Re: Clericus/Hopeless ported to Lazarus

Posted: Sun Aug 02, 2020 12:59 am
by Roland Chastain
adnoh wrote: Sun Aug 02, 2020 12:26 am
Roland Chastain wrote: Sat Aug 01, 2020 8:44 pm
Roland Chastain wrote: Mon Jan 27, 2020 11:47 pm I created a git repository with the source code of Clericus/Hopeless by Pawel Koziol. I made some modifications for compatibility with the current version of the Delphi compiler, tried to refresh the graphical interface, added a french translation and made some other little modifications. The repository is here:

https://gitlab.com/rchastain/hopeless
Hello! I ported Clericus/Hopeless from Delphi to Lazarus. So Hopeless is now available for Linux. You can find the source code of the Lazarus project and a Linux 64 binary here:

https://gitlab.com/rchastain/hopeless-l ... -/releases

I can't provide a Windows binary because I no longer have a Windows system. If there is a Lazarus and Windows user who would want to build the engine for Windows, he would be welcome. (Please choose the "XBoard_Release" build mode.)

Regards.

Roland
I did make an attempt to create a Windows build using Lazarus 2.0.10 and the GUI build seems to work but the xboard build crashes as soon as I try to start a game in Arena.

https://ibb.co/5W8cv6v

I have made no attempt to debug that. If you want to pursue this I do not mind spending some time on this.
Thank for your answer, and for your interest in that project.

Here is a thing that you could try. The project has a "XBoard_Debug" build mode. It will produce an executable named hopeless-debug.exe. If you have time, it would be interesting to make a test with it. There should be two *.log files. And of course, it would be good to see the Arena debug file. Maybe we will see where the bug is. If it isn't enough, I will try to borrow a Windows computer to do some other investigations.

I forgot to say that I tested the Linux executable with XBoard, with the option "protocol version 1".

Best regards.

Roland

Re: Clericus/Hopeless ported to Lazarus

Posted: Sun Aug 02, 2020 2:22 am
by adnoh
Here is a Windows build and I packaged it like your Linux one.

https://1drv.ms/u/s!Aqe2-2i2H5hetEWTv45 ... V?e=K4wNmb

Thanks for the tip on the debug build. As soon as I ran that and I looked at the wbunit.log file I could see the problem. I had set the time control in Arena to Blitz with base of 0 minutes and 5 seconds and bonus of 1 seconds and that was the source of the error. When I changed it to something more traditional like 2 minutes + 6 seconds it played fine. Perhaps something to fix in the code?

Code: Select all

SENDING feature done=0
BEGIN Execute
RECEIVING xboard
SENDING feature sigint=0 sigterm=0 myname="Hopeless 0.49.0.3" done=1
RECEIVING new
RECEIVING random
RECEIVING level 0 0:5 1

Re: Clericus/Hopeless ported to Lazarus

Posted: Sun Aug 02, 2020 6:07 am
by Roland Chastain
Good! Glad that you already found the cause of the problem. Yes, I will look how it could be fixed.

Thank you for Windows package. I add it to the project page. :wink:

Re: Clericus/Hopeless ported to Lazarus

Posted: Sun Aug 02, 2020 10:37 am
by Roland Chastain
adnoh wrote: Sun Aug 02, 2020 2:22 amPerhaps something to fix in the code?
Done. :)

Code: Select all

SENDING feature done=0
SENDING feature sigint=0 sigterm=0 myname="Hopeless 0.49.0.3" done=1
RECEIVING level 0 0:5 1
RECEIVING level 40 0:30 0
RECEIVING quit

Code: Select all

2-8-20 10:22:13 Incremental time control
2-8-20 10:22:13 Base=0:5 minutes
2-8-20 10:22:13 Inc=1 seconds
2-8-20 10:22:13 Base=5 seconds
2-8-20 10:22:34 Conventional time control
2-8-20 10:22:34 Moves=40
2-8-20 10:22:34 Time=0:30 minutes
2-8-20 10:22:34 Time=30 seconds
It was a good occasion for me to read the protocol documentation. So thank you very much for giving to me the occasion to improve the program and to learn something. :wink:

The GitLab repository has been updated.

P. S. FYI, I renamed wbunit.pas to dialog.pas and wbunit.log to dialog.log.

Re: Clericus/Hopeless ported to Lazarus

Posted: Sun Aug 02, 2020 5:32 pm
by adnoh
Please let me know if you want me to do another build with the changes for time control. Should I also post a Clericus build while I am at it?

I also have Lazarus installed on a MacOS laptop here so I will also try to make a Mac build but I will need to install a chess GUI to test it before I post it for you.

Thanks for porting this over to Lazarus.

Re: Clericus/Hopeless ported to Lazarus

Posted: Mon Aug 03, 2020 7:37 am
by Roland Chastain
adnoh wrote: Sun Aug 02, 2020 5:32 pm Please let me know if you want me to do another build with the changes for time control. Should I also post a Clericus build while I am at it?

I also have Lazarus installed on a MacOS laptop here so I will also try to make a Mac build but I will need to install a chess GUI to test it before I post it for you.

Thanks for porting this over to Lazarus.
Yes, indeed, we could make a new release. And we could include a binary of Clericus in each package. I have just changed the version number and created a "Release" build mode for the GUI.

Yes, it would be good to have a Mac build.

Thank you for your interest in that project. :wink:

Re: Clericus/Hopeless ported to Lazarus

Posted: Mon Aug 03, 2020 10:42 am
by Dr.Wael Deeb
Roland Chastain wrote: Mon Aug 03, 2020 7:37 am
adnoh wrote: Sun Aug 02, 2020 5:32 pm Please let me know if you want me to do another build with the changes for time control. Should I also post a Clericus build while I am at it?

I also have Lazarus installed on a MacOS laptop here so I will also try to make a Mac build but I will need to install a chess GUI to test it before I post it for you.

Thanks for porting this over to Lazarus.
Yes, indeed, we could make a new release. And we could include a binary of Clericus in each package. I have just changed the version number and created a "Release" build mode for the GUI.

Yes, it would be good to have a Mac build.

Thank you for your interest in that project. :wink:
Thanks for your great contribution ....

What is the estimated strength of Lazarus ?

Cheers

Re: Clericus/Hopeless ported to Lazarus

Posted: Mon Aug 03, 2020 5:32 pm
by adnoh
Here is the Windows 0.49.0.4 build with the latest changes and it has the Hopeless (xboard) and Clericus (gui) executable inside. I'll work on the Mac build soon.

I tested it in Arena with time control of 5"+1" and it works now.

https://1drv.ms/u/s!Aqe2-2i2H5hetEra1f4 ... y?e=GXnNZ7

Just a small note. Seems you may have unintentionally renamed the build mode of xboard_release to gui_release because it was missing so I just created it to do the build.

Re: Clericus/Hopeless ported to Lazarus

Posted: Tue Aug 04, 2020 5:05 am
by adnoh
To get a sense of its strength, I had Hopeless 0.49.0.4 play 10 games each against AdaChess 3.6 and MadChess 2.2 at 2'+6"" and it had 4 wins and 4 ties against AdaChess but it lost all of the other games on time forfeit. Too bad too as it can hold its own against MadChess in a few games until it forfeits.

For clarity, the WinBoard engine is called Hopeless, Lazarus is the development environment it was ported to from Delphi by Roland.

https://www.lazarus-ide.org/index.php