PDA

View Full Version : Eschecs - Pascal chess program



Roland Chastain
15-06-2015, 07:03 PM
Hello gentlemen!

I would like to present my chess game, named Eschecs (the old french word for chess).

The GUI was made with the fpGUI (http://sourceforge.net/projects/fpgui/files/) toolkit. The graphical chessboard uses BGRABitmap (http://sourceforge.net/projects/lazpaint/files/src/).

To download the latest version please go to Eschecs Github repository (https://github.com/rchastain/eschecs/releases).

SilverWarior
15-06-2015, 07:50 PM
That is very nice.
Did you write the chess AI by yourself or does it use one of existing libraries?

Roland Chastain
15-06-2015, 08:43 PM
That is very nice.

Thank you. I started this project three years ago.


Did you write the chess AI by yourself or does it use one of existing libraries?

The chess AI is derived from a Turbo Pascal program (https://gitlab.com/rchastain/moustique/-/blob/master/original/schach.txt) by Jürgen Schlottke.

SilverWarior
16-06-2015, 07:27 AM
I started this project three years ago.

That is interesting. About four or perhaps five years ago I was actually making modifications to an existing chess game made with Delphi to add network support so me an my friend could play together over the internet.
Now becouse that program used some shareware components like chess board VCL component, and also used external AI engine I have never published it as doung so I would violate IP rights of the original owners.

I did started creating of my own chess board component which instead of being topdown view used pictures of an actuall woden chess board and figures photographed at about 60 degrees angle. But since I'm not a good photographer and at that time I was pretty horible everything looked kinda ugly.

Anyway I abandoned the project later becouse I found a website wihch alowed online chess play. So me and my friend used that for a while but still nothing beats the playing of chess in person. So we still prefer playing in person.

So have you perhaps thought about adding network support to your chess game?

Roland Chastain
16-06-2015, 09:13 AM
So have you perhaps thought about adding network support to your chess game?

There are so many things that can be made! The next subject I intended to study was the UCI protocol.

Roland Chastain
19-06-2015, 09:45 AM
Hello!

The latest version (please see first post) includes a mate solver, a dynamic library based upon the MATER (http://www.eschecs.fr/fichiers/mater.zip) program by Valentin Albillo. So the computer's move can come from three sources: the book, the mate solver, the main engine.

An important correction has also been made in the engine.

Still compiled with the current versions of Lazarus, fpGUI, BGRABitmap. Tested under Windows 8.1. Maybe I should include the libraries in the archive.

SilverWarior
19-06-2015, 02:43 PM
Maybe I should include the libraries in the archive.

If you don't have specific approval from the original authors to distribute those libraries with your code then it would be better if you simply add Readme file and add necessary information as to where can people get those libraries from.
This way you avoid some possible problems regarding the possible Intellectual Property Rights violation.

Roland Chastain
19-06-2015, 04:22 PM
@SilverWarior

Thank you for your advice. Yes, I should add a readme file. It will be done in the next version.

Roland Chastain
03-03-2016, 07:01 AM
Hello! There is a new version of Eschecs. The previous version didn't work properly when compiled with Lazarus 1.6. Please see the download link in the first post. :)

Roland Chastain
16-11-2016, 11:48 PM
Hello! Here is Eschecs 2.4.1. Please see first post of this discussion. All observations welcome.

Roland Chastain
17-11-2016, 07:09 PM
I began to write a short documentation in three languages. The french version (lisezmoi.txt) is the most completed. I have to finish the english and german files (liesmich.txt, readme.txt). A help would be welcome. :)

The game itself is available in the same three languages. If someone who speaks another language would contribute a translation, he would be welcome too. One would just have to create a file (for example) chinese.inc, starting from a copy of english.inc (in the languages folder). :)

Any other contribution or observation welcome.

Ñuño Martínez
18-11-2016, 12:33 PM
Maybe I can contribute with a translation to Spanish. Give me some time.

[Edit] Done. I thought it would be harder.

const
TEXTS: array[TText] of string = (
'Eschecs', // txEschecs
'Crear un acceso directo en el escritorio', // txShortcut
'Ayuda', // txHelp
'Salir', // txQuit
'Acerca de Eschecs', // txAbout
'Movimientos', // txMoves
'Movimiento de la computadora', // txComputerMove
'Partida automática', // txAutoPlay
'Tablero', // txBoard
'Nuevo juego', // txNewGame
'Invertir el tablero', // txFlip
'Opciones', // txOptions
'Tablero de mármol', // txMarble
'Promover pieza', // txPromotion
'Caballo', // txKnight
'Alfil', // txBishop
'Torre', // txRook
'Reina', // txQueen

'Acceso directo creado.', // txShortcut
'Para mover una pieza, haga click en ella y después haga click en el escaque al que quiera moverla.', // txHelp
'Programa de Ajedrez en Pascal por Roland Chastain.', // txAbout
'Movimiento ilegal.', // txIllegalMove

'Blancas mueven.', // txWhiteToMove
'Negras mueven.', // txBlackToMove
'Blancas ganan.', // txWhiteWins
'Negras ganan.', // txBlackWins
'Jaque.', // txCheck
'¡Jaque mate!' // txCheckmate
'¡Ahogado!', // txStalemate
'¡Tablas!' // txDraw
);
Note that I'm using Spanish from Spain (Castillian, actually) so people from South America, Africa and Philippines (as well as Sephardi Jews) would use different expressions (Yes, all them [may] talk Spanish). Also I tried to use the official chess lingo, but I'm not sure everything is correct (there's a lot of time I don't play chess).

[edit 2]
Ok, tested.

First: It works with Wine.
Second: No levels. And since I didn't play chess for ages it wiped the board in few minutes.

Roland Chastain
18-11-2016, 05:50 PM
Maybe I can contribute with a translation to Spanish. Give me some time.

[Edit] Done. I thought it would be harder.

Great! Thank you very much. I go at once to build the Spanish version. :)



[edit 2]
Ok, tested.

First: It works with Wine.

Thank you for testing.


Second: No levels. And since I didn't play chess for ages it wiped the board in few minutes.

OK, I will add it in the next version. The chess engine with its current settings isn't very strong, but he can easily surprise an occasional chess player (as you or me). I have to experiment how the engine behaves if I change the depth of the recursive evaluation.

Thank you again! ;)

Roland Chastain
18-11-2016, 06:09 PM
Done.:)

http://www.pascalgamedevelopment.com/attachment.php?attachmentid=1433&stc=1

Ñuño Martínez
18-11-2016, 06:45 PM
Glad to help. :)

Roland Chastain
20-11-2016, 09:30 PM
@Ñuño

In the next version of the game, one can set the opponent strength. So there will be three new items in the menu. Please could you tell me if my Spanish translation is correct?


'Más débil adversario', // txWeakerOpponent
'Normal adversario', // txNormalOpponent
'Más fuerte adversario', // txStrongerOpponent

Ñuño Martínez
21-11-2016, 09:21 AM
Nope, sorry. Use this instead:

'Adversario de nivel bajo', // txWeakerOpponent
'Adversario de nivel medio', // txNormalOpponent
'Adversario de nivel alto', // txStrongerOpponent
AFAIK the Spanish chess lingo uses "nivel" (level) instead of "fuerza" (strength).

Also, as you see, the order of words is slightly different. Actually "El más débil adversario" may be correct in some contexts. But "El normal adversario" isn't correct in any context though.

Roland Chastain
21-11-2016, 11:28 AM
Thank you very much ! :)

Roland Chastain
25-11-2016, 03:49 PM
Hello! Here is Eschecs 2.4.2. Now one can set the strength of the artificial opponent, by selecting one of three options. There is also a new language (Dutch).

Roland Chastain
06-11-2017, 10:39 AM
Hello! Here is a new version of Eschecs. Now the application uses the UCI protocol to communicate with an external chess engine (Fruit by F. Letouzey).

Comments welcome.

Ñuño Martínez
06-11-2017, 12:04 PM
Tested. It works on Linux+Wine. :)

It killed my queen but I don't know when. ??? May be an option to repeat the last movement or marking the last computer movement...

Anyway, good work. :)

Roland Chastain
07-11-2017, 07:45 AM
Tested. It works on Linux+Wine. :)

Thank you for testing. Glad to know that it works on Wine.



It killed my queen but I don't know when. ??? May be an option to repeat the last movement or marking the last computer movement...

I am making something for you. ;)


Anyway, good work. :)

Thank you.

By the way, there would be three new messages to translate, if you would. :)


'Please wait...', // txWaiting
'UCI protocol accepted.'#10#10'Engine name: %s'#10'Author: %s', // txUciOk
'Cannot connect to the engine.', // txConnectionFailure

Ñuño Martínez
07-11-2017, 10:43 AM
By the way, there would be three new messages to translate, if you would. :)


'Please wait...', // txWaiting
'UCI protocol accepted.'#10#10'Engine name: %s'#10'Author: %s', // txUciOk
'Cannot connect to the engine.', // txConnectionFailure
Here you have:

'Espere, por favor...', // txWaiting
'Protocolo UCI aceptado.'#10#10'Nombre del motor: %s'#10'Autor: %s', // txUciOk
'No pudo conectarse al motor.', // txConnectionFailure

The first one can be also "Espere un momento, por favor..." ("Please wait a minute/moment...").

Roland Chastain
07-11-2017, 05:14 PM
Thank you very much. :)

Roland Chastain
13-11-2017, 08:33 AM
Hello! Here is a new version.

Now the last move of the computer is indicated by an arrow.

Secondly, the name of the opening (in english) is displayed in the title bar.

SilverWarior
13-11-2017, 06:58 PM
Hey why not record entire game history and allow players to replay it entirely. This feature can be quite useful for people to analyze their mistakes. Also you could record your game play and allow others to watch it being played some other time.
Implementing this is actually pretty trivial. All you need is to log is the name of the chess pice, origin and destination field which can all be stored in a single 5 character long string.
So in your first picture the last black movement would be "PD7D5" where P stands for chest piece Peon D7 is place of origin and D5 is the place the pice has been moved to. So in end you simply end up with a simple text file storing all of the moves made in a game.

Roland Chastain
21-11-2017, 06:52 PM
Hey why not record entire game history and allow players to replay it entirely. This feature can be quite useful for people to analyze their mistakes.

Thank you for your suggestion. Here you are:

Eschecs 3.0.4 (http://www.eschecs.fr/fichiers/freepascal/)

You navigate with the keyboard arrows:



Left: go back to previous position
Right: go to next position
Up: go to last position
Down: go back to first position



Also you could record your game play and allow others to watch it being played some other time.

Why not in a future version. Currently the game is automatically and silently saved when you quit the program using the corresponding menu item (or using the Escape key).

Roland Chastain
23-10-2018, 11:22 AM
Hello! There is a new version of Eschecs.

What is new? You drag and drop your pieces (instead of clicking on squares).

Other difference, there is no longer a UCI engine automatically started. You have to select an engine in the "Moves" menu. It will be started and, if the connection succeeds, your will see the name of the engine in the window title.

de_jean_7777
23-10-2018, 01:25 PM
Great you're working on it still. One thing, clicking the version number in the links on your page always leads to the dutch version even if other language is clicked.

Roland Chastain
23-10-2018, 01:43 PM
Great you're working on it still.

Thank you. It's a never ending story. :)


One thing, clicking the version number in the links on your page always leads to the dutch version even if other language is clicked.

Thank you for reporting the problem. It's weird because I have again tested all the links and I could successfully download the different files.

de_jean_7777
24-10-2018, 07:21 AM
It's weird because I have again tested all the links and I could successfully download the different files.

The problem is with the middle part where the version number is in your links, since your links are consisted actually of three links (<a> elements). The middle version part always points to the dutch version.

Roland Chastain
24-10-2018, 09:06 AM
The problem is with the middle part where the version number is in your links, since your links are consisted actually of three links (<a> elements). The middle version part always points to the dutch version.

Oh, I understand now. Thank you. I will fix it.

Roland Chastain
25-10-2018, 06:46 PM
Hello! There is a new version, with squares highlighting.

de_jean_7777
25-10-2018, 07:20 PM
Not that I'm much of a chess player, so this might not be something I need. But would you be able to implement scaling of the board when the window is resized?

Roland Chastain
25-10-2018, 07:54 PM
Not that I'm much of a chess player, so this might not be something I need. But would you be able to implement scaling of the board when the window is resized?

Yes, I am thinking about it. Maybe for 2019 ? :)

Roland Chastain
01-12-2018, 06:04 PM
Hello! A new version of the game is available. Now the game has sound, different chessboard styles, and is compatible with different systems (Windows, Linux, FreeBSD, Raspberry Pi). :)

https://github.com/rchastain/eschecs/releases

Thank you to Fred van Stappen (https://github.com/fredvs), whose contribution has made all that possible. :)

Roland Chastain
22-11-2019, 07:48 PM
Hello friends!

A new version of the game is available.

https://raw.githubusercontent.com/rchastain/eschecs/master/screenshots/eschecs500b.png

https://github.com/rchastain/eschecs/releases

The main difference with the previous version is the possibility to play chess 960 (Fischer random chess).

Another difference is that you can save the current game in a PGN file (by clicking on "Save and quit").

There is a separated application, named options, that allows to launch Eschecs with desired options.

Thank you in advance for your feedback.

Regards.

Roland

casanova
28-11-2019, 05:16 PM
Cant find Eschecs on my windows 10 store, is it normal ?

____________________________________________

Appvalley (https://getappvalley.com/) TutuApp (https://tutuappx.com/) Tweakbox (https://tweakbox.mobi/)

Roland Chastain
29-11-2019, 02:07 AM
Cant find Eschecs on my windows 10 store, is it normal ?

Thank you for your message. I don't know what are the steps to make an application available on Windows Store. I never asked myself that question. But why not? It could be a good idea. ;)

Roland Chastain
23-04-2021, 07:08 PM
Hello everybody!

It's been a while since I passed by here. :)

After a fairly long hiatus, I got back to my chess GUI project.

The main novelty is the usage of the command line, to allow the user to customize the appearance and the behaviour of the application. The options are listed on the project page (https://github.com/rchastain/eschecs).

For example there is an option to select the colors that the program will use to generate the marble texture. Very unnecessary but I am glad of it. :)

1566

In case someone is interested to compile the program, I would be glad to help. There is no particular difficulty, except that you have to download three or four libraries, and to tell the compiler where the libraries are (either you create a Lazarus project, or write a script, or retouch and use the included Makefile). When you download fpGUI, please choose the develop branch.


Regards.

Roland

Ñuño Martínez
27-04-2021, 10:19 AM
Very unnecessary... but gorgeous. ;)

Roland Chastain
27-04-2021, 04:26 PM
Very unnecessary... but gorgeous. ;)

Thank you. :)

The code for marble generation has been written by the author of the BGRABitmap library.