Eschecs FreeBASIC (UCI chess GUI)

User projects written in or related to FreeBASIC.
Post Reply
Muttonhead
Posts: 139
Joined: May 28, 2009 20:07

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Muttonhead »

@ Roland and Paul Doe:

if that is the cause of the bug I can offer a modified Version:
64Bit support and for the mouse buttons, mouse position and mouse wheel a ScreenEvent is now used.
But that has not been extensively tested, either alone or with your chess program.

https://1drv.ms/u/s!AsTPhVzcfzRrhthCHpczPwU3yi3KUw

Mutton
paul doe
Moderator
Posts: 1733
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by paul doe »

Muttonhead wrote:@ Roland and Paul Doe:

if that is the cause of the bug I can offer a modified Version:
That's very generous from your part, thanks. I don't use it, but Roland does, so it would be great.
Muttonhead wrote:64Bit support and for the mouse buttons, mouse position and mouse wheel a ScreenEvent is now used.
But that has not been extensively tested, either alone or with your chess program.
Yeah, it has been tested. I use it a lot in my code; that's how I came to know about the hanging issue, so no worries =D
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

@Muttonhead

Great! Thank you. I will try that version of sGUI and report here the result.
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

It compiles (after I changed "chr$" to "chr" in sgui_misc.bas), and the application seems to work. But I don't know if the problem is really solved. Testers welcome. :)

[link deleted, see next message]
Last edited by Roland Chastain on Aug 28, 2018 20:07, edited 2 times in total.
Luis Babboni
Posts: 375
Joined: Mar 15, 2015 12:41

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Luis Babboni »

Roland Chastain wrote:It compiles (after I changed "chr$" to "chr" in sgui_misc.bas), and the application seems to work. But I don't know if the problem is really solved. Testers welcome. :)

https://drive.google.com/open?id=1cIz1D ... hGVhKbz6TK
I did a couple of tests:
Play 1 game against Fruit without problems.
In other game appeared black lines on board, with size of around one square, but was removed as soon as I move the window.
In other try against List, the game crashed.
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

@Luis Babboni

Thank you for the feedback.
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

Unfortunately the game still freezes ands crashes. As I suspected a bug in animation I deactivated it.

Code: Select all

' graphics.bi

#define NO_ANIMATION
I also removed two engines, in order to reduce the file size.

Please download new files on FB Portal.

https://www.freebasic-portal.de/downloa ... s-210.html

@paul doe, muttonhead, Luis Babboni

Thank you for your contributions. :)
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Eschecs 1.2.2

Post by Roland Chastain »

Hello!

I took the latest version of the project and tried to compile it under Linux. It was not as hard as I imagined. I just had to use the excellent bipipe library, instead of my Windows specific code. It works!

I also tried (without success) to solve the animation issue. So the animation stays deactivated. After all, it isn't so important.

Here is the source code of the project, including a Linux 32 binary. I am not sure that it will work on another computer: maybe you will have to install some library (maybe pcre).

Eschecs.zip

Theoretically the project should be compiled and ran under Windows, but since I touched many things, it is possible that something be broken. I can't check for now because I don't have a Windows computer under the hand.

Regards.

Roland
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Eschecs 1.2.2

Post by Roland Chastain »

In fact it doesn't work very well. Sometimes the application freezes, and I have to kill it in the task manager...
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by badidea »

I am having trouble with fbsound, so I cannot run the code at the moment, but try:

Code: Select all

stringlist.bi:
	Function stringlist._QCompare Cdecl (e1 As Any Ptr, e2 As Any Ptr) As Integer
	Function stringlist._QCompare Cdecl (e1 As Any Ptr, e2 As Any Ptr) As Long

parser.bi:
	function CompileRegExpr() as boolean:
		dim as integer error_offset
		dim as long error_offset

	function ParseBestMove(buffer as const string, aBestMove() as byte) as boolean:
		dim as integer ovector(VECTOR_COUNT - 1) 
		dim as long ovector(VECTOR_COUNT - 1) 

	function ParseUciOk(buffer as const string, byref aName as string,  byref aAuthor as string) as boolean:
		dim as integer ovector(VECTOR_COUNT - 1) 
		dim as long ovector(VECTOR_COUNT - 1) 

validator.bi:
	function IsMatch(byval aPattern as string, byval aSubject as string) as integer
		dim erroffset as integer
		dim ovector as integer
		dim erroffset as long
		dim ovector as long
And use SGUI version 20180826. Version 20141212 seems 32-bit only.

Code: Select all

#define SGUI_20180826

#ifdef SGUI_20180826
	#include once "sgui/20180826/sgui/sgui.bas"
	#include once "sgui/20180826/sgui/menu.bas"
	#include once "sgui/20180826/special/eschecs/clickmapgadget.bas"
#else
	#include once "sgui/20141212/sgui/sgui.bas"
	#include once "sgui/20141212/sgui/menu.bas"
	#include once "sgui/20141212/special/eschecs/clickmapgadget.bas"
#endif
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

badidea wrote:I am having trouble with fbsound, so I cannot run the code at the moment, but try:
Thank you for your help. I will try the modifications that you suggest.

What is the trouble with fbsound? As a quick solution, you could remove the sound code: it's just four or five lines to remove (there is only one sound). But I have a better idea: I will add a "NO_SOUND" option.
badidea wrote:And use SGUI version 20180826. Version 20141212 seems 32-bit only.
Yes, indeed. Today I used the 32-bits compiler.

I improved the logging system and could start to localize the bug. It's after a move from the engine. The move is correctly received, it is validated by the chess library, but nothing happens...
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by badidea »

I get "error: lib fbsound-64 not loaded !"
I have had this with fbsound before. Not sure why. Disabled for now. 64-bit seems fine so far...
Image
I do get a lot of "eschecs.bas DISPLAYARBITRATORMESSAGE (494)". Not sure if this is normal.

The engine is in C? Then check all (u)integers involved in communication with engine.
Or communication is via strings it seems?
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

badidea wrote:64-bit seems fine so far...
Nice screenshot. :)

Yes, same experience here: I used sGUI 2018, compiled to 64-bits and could play several games without trouble.
badidea wrote:I do get a lot of "eschecs.bas DISPLAYARBITRATORMESSAGE (494)". Not sure if this is normal.
Yes, it's just some code that I added everywhere to try to localize the error.

Code: Select all

#ifdef DEBUG
dim shared vConsole as integer
#define DEBUG_LINE_ID __FILE__ & " " & __FUNCTION__ & " (" & __LINE__ & ") "
#define DEBUG_LOG(_X_) print #vConsole, DEBUG_LINE_ID & (_X_)
vConsole = freefile
open cons for output as vConsole
#endif
badidea wrote:The engine is in C? Then check all (u)integers involved in communication with engine.
Or communication is via strings it seems?
Yes, the engines are independant programs. The communication is done through pipes (2).

I made the modifications that you suggested (1) and added a "no sound" option. Same download link.

(1) No more warnings with 64-bits compiler. Great!

(2) You could take a look into eschecs.log to see how it works.
badidea
Posts: 2591
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by badidea »

There is indeed something wrong with the animation. If I change STEP_LENGTH to 1, it is more clear. Sometimes a piece does not reach its target. My initial thought was a timer issue again, but no timer is used for animation. I'll look into this further...
Roland Chastain
Posts: 1002
Joined: Nov 24, 2011 19:49
Location: France
Contact:

Re: Eschecs 1.2.1 (UCI chess GUI)

Post by Roland Chastain »

I made some cleaning and some little improvements in the code. Please use the new version (same link).
Post Reply