Luciole (UCI engine written in Lua)

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

Moderators: hgm, Rebel, chrisw

User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Luciole 0.0.7 and LÖVE chessboard

Post by Roland Chastain »

A new version of Luciole is available.

I fixed several bugs in move generation, and made some optimizations. (Otherwise, the engine has not changed, and its playing level is still very low.)

Luciole has a new repository. (I lost access to my GitLab account, so I am moving all my projects to Codeberg.)

There is also a simple chessboard made with LÖVE.

Image

(The pieces set above comes from the boardgame tiles by Lanea Zimmerman.)

To run the chessboard, clone the git repository, open a terminal in project directory and type:

Code: Select all

love .
See README for command-line options.

Move the pieces with the mouse. Press 'm' to make the computer move.

Luciole and the chessboard are based on the same module chess.lua, so that the chessboard can be used as a tool to test the engine.
Qui trop embrasse mal étreint.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Luciole 0.0.8

Post by Roland Chastain »

Luciole 0.0.8 is available.
  • Fixed a last (?) error in move generation. Now perft command gives good results for all positions. 8-)
  • Added an opening book.
Qui trop embrasse mal étreint.
User avatar
Tibono
Posts: 87
Joined: Sat Aug 01, 2015 6:16 pm
Location: France
Full name: Eric Bonneau

Re: Luciole (UCI engine written in Lua)

Post by Tibono »

Hi Roland,
in this short self-play game, Luciole 0.0.8 wants to play KxR (maybe a wrong castling?)
[pgn][Event "Computer chess game"]
[Site "Arena"]
[Date "2024.05.09"]
[Round "?"]
[White "Luciole 0.0.8"]
[Black "Luciole 0.0.8"]
[Result "0-1"]
[BlackElo "2000"]
[ECO "B06"]
[Opening "Modern"]
[Time "16:27:40"]
[Variation "1.e4 g6 2.Nc3 Bg7 3.f4 d6"]
[WhiteElo "2000"]
[TimeControl "40/600:40/600:40/600"]
[Termination "rules infraction"]
[PlyCount "16"]
[WhiteType "program"]
[BlackType "program"]

1. f4 g6 2. d3 Bg7 3. Nc3 Bd4 4. Nb5 Bg7 5. Nf3 d6 6. g3 e6 7. e4 Nd7 8.
Be2 b6 {Arena Adjudication. Illegal move!} 0-1
[/pgn]

Code: Select all

2024-05-09 16:28:07,940*1*Start calc, move no: 16
2024-05-09 16:28:07,940-->1:position startpos moves f2f4 g7g6 d2d3 f8g7 b1c3 g7d4 c3b5 d4g7 g1f3 d7d6 g2g3 e7e6 e2e4 b8d7 f1e2 b7b6
2024-05-09 16:28:07,940-->1:go wtime 598530 btime 598420 winc 0 binc 0 movestogo 32
2024-05-09 16:28:08,358<--1:bestmove e1h1
2024-05-09 16:28:08,358*moveerror*start piece<0 and target piece<0, can't capture own piece !...!
2024-05-09 16:28:08,358*1*---------> Arena:Illegal move!: "bestmove e1h1" ()
Anyway, thanks for sharing
Amicalement,
Eric
mar
Posts: 2579
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Luciole (UCI engine written in Lua)

Post by mar »

this looks like a regular orthodox chess game?

KxR is the preferred way in FRC (UCI) - this or explicitly denote castling as O-O or O-O-O (xboard), because Kg1 can be ambiguous in some positions
that being said, Arena is very buggy when it comes to FRC castling to the point that I'd say it doesn't support Chess960 at all
like this FEN: 1r1k3K/pppppppp/8/5nn1/8/8/PPPPPPPP/8 b q - 0 1
any engine would castle long to checkmate but Arena considers it an "illegal move"

anyway - nice, any plans for a Windows version Ronald?
the pixelart piece set looks gorgeous, but I wouldn't mind bigger squares to let the pieces breathe a bit
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Luciole (UCI engine written in Lua)

Post by Roland Chastain »

Tibono wrote: Thu May 09, 2024 4:45 pm in this short self-play game, Luciole 0.0.8 wants to play KxR (maybe a wrong castling?)
Hi Éric. Thank you for reporting. I can reproduce the bug. Indeed in that case the program should use the traditional notation for castling. I will take a look.
mar wrote: Thu May 09, 2024 5:17 pm anyway - nice, any plans for a Windows version Ronald?
Hi Martin. The LÖVE chessboard already works under Windows, as far as I know.
mar wrote: Thu May 09, 2024 5:17 pm the pixelart piece set looks gorgeous, but I wouldn't mind bigger squares to let the pieces breathe a bit
I used the squares provided with the pieces. I don't know how it will look if I try to stretch them. I will try. (By the way there are other pieces sets included. See command-line options.) But yes, now that you say it, the squares of that pieces set are a bit narrow.
Qui trop embrasse mal étreint.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Luciole 0.0.8.1

Post by Roland Chastain »

Luciole 0.0.8.1 is available.

Uses correct notation for castling when playing traditional chess.

Code: Select all

$ lua luciole.lua
position startpos moves f2f4 g7g6 d2d3 f8g7 b1c3 g7d4 c3b5 d4g7 g1f3 d7d6 g2g3 e7e6 e2e4 b8d7 f1e2 b7b6
go wtime 598530 btime 598420 winc 0 binc 0 movestogo 32
bestmove e1g1
[WARN Thu May 9 19:29:03 2024] ./chess.lua:860: e1h1 -> e1g1
Qui trop embrasse mal étreint.
ankiwi
Posts: 2
Joined: Thu May 16, 2024 1:38 am
Full name: Sean Lindorff

Re: Luciole 0.0.7 and LÖVE chessboard

Post by ankiwi »

Roland Chastain wrote: Sun May 05, 2024 10:10 am A new version of Luciole is available.

I fixed several bugs in move generation, and made some optimizations. (Otherwise, the engine has not changed, and its playing level is still very low.)

...
What great timing! I was testing my game engine and wanted to make a chess game. I could not for the life of me find a LUA 5.3 compatible UCI engine until I stumbled across this. I saw you had written a board with LOVE for testing and wanted to share with you mine, as well as thank you for your hard work on this over the years. Made an account and everything :)

Image

If you'd like to check it out or yell at me for implementing it horribly wrong, https://github.com/lindorffs/voidgen-chess.

Again, thank you for writing this, it saved me a lot of headache getting this working.
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Luciole 0.0.7 and LÖVE chessboard

Post by Roland Chastain »

ankiwi wrote: Thu May 16, 2024 7:33 pm I saw you had written a board with LOVE for testing and wanted to share with you mine, as well as thank you for your hard work on this over the years.
Looks nice! Unfortunately I couldn't test it, because I am on Linux and the project (or the Makefile?) is only for Windows. When I have time, I will see if I can compile it for Linux.

If ever you are interested in a stronger engine, someone has rewritten Fruit 2.1 in Lua. I retouched it to make it work as an UCI engine. (The original Lua script was an AI vs AI demo game.) I didn't test it much, but it seems to work.

Thank you for your feedback. Glad that you like my program. :)
Qui trop embrasse mal étreint.
ankiwi
Posts: 2
Joined: Thu May 16, 2024 1:38 am
Full name: Sean Lindorff

Re: Luciole 0.0.7 and LÖVE chessboard

Post by ankiwi »

Roland Chastain wrote: Thu May 16, 2024 10:07 pm Looks nice! Unfortunately I couldn't test it, because I am on Linux and the project (or the Makefile?) is only for Windows. When I have time, I will see if I can compile it for Linux.

...

Thank you for your feedback. Glad that you like my program. :)
If you're still interested in testing it out, I've confirmed it compiles and works on Linux. Also updated the read-me with a command for linux, all you need is a few extra libraries.
Roland Chastain wrote: Thu May 16, 2024 10:07 pm If ever you are interested in a stronger engine, someone has rewritten Fruit 2.1 in Lua. I retouched it to make it work as an UCI engine. (The original Lua script was an AI vs AI demo game.) I didn't test it much, but it seems to work.
Appreciated! :)
User avatar
Roland Chastain
Posts: 657
Joined: Sat Jun 08, 2013 10:07 am
Location: France
Full name: Roland Chastain

Re: Luciole 0.0.7 and LÖVE chessboard

Post by Roland Chastain »

ankiwi wrote: Tue Jun 04, 2024 11:01 pmIf you're still interested in testing it out, I've confirmed it compiles and works on Linux. Also updated the read-me with a command for linux, all you need is a few extra libraries.
Good news! Yes, of course, I am still interested.

I tried again to build VoidGEN under Linux, without success. Here are some of the errors I get:

Code: Select all

g++ -o voidgen engine.cpp -I includes
In file included from includes/engine.hpp:11,
                 from engine.cpp:7:
includes/SDL3/SDL_mixer.h:68:8: error: 'SDL_DECLSPEC' does not name a type; did you mean 'DECLSPEC'?
   68 | extern SDL_DECLSPEC int SDLCALL Mix_Version(void);

Code: Select all

engine.cpp:379:52: error: too few arguments to function 'SDL_Renderer* SDL_CreateRenderer(SDL_Window*, const char*, Uint32)'
  379 |                 this->renderer = SDL_CreateRenderer(this->window, NULL);
      |                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from includes/SDL3/SDL.h:70,
                 from includes/engine.hpp:7:
includes/SDL3/SDL_render.h:230:40: note: declared here
  230 | extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 flags);
Maybe I didn't use the good files, or maybe there is something wrong in my command line, I don't know.

I see that you have made important modifications recently. When the project is in a stable state, please improve a bit the documentation and (if you don't mind) provide a Makefile or a bash script for building the engine under Linux. (I didn't see the command for Linux that you say you have added to README. Maybe you forgot to push it?)

Very interesting project. I can't wait to test it. :wink:
Qui trop embrasse mal étreint.