ChessV 2.0 - open source GUI and engine for chess variants

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

Moderators: hgm, Rebel, chrisw

User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Greg Strong »

hgm wrote:Is the AI also a WB v2 engine, or is it built in like in the old ChessV?
It's like the old ChessV in that regard although I could also provide a separate exe for WB operation. The components aren't as tightly integrated as in old ChessV. I wouldn't expect a lot of interest in this, though. The AI isn't really all that remarkable. The GUI is the really impressive piece. I still want to make a new WB engine to go along with it. That project has been started, but I haven't gotten all that far. GUI work is never-ending, and there are others who are better at writing engines than I am. I'd imagine there is more interest in new GUI features like hexagonal boards, for example.

Oh, I should also give a shout-out to Ilari Pihlajisto and Arto Jonsson. All the code related to controlling the external engines is from Cutechess CLI, which I ported to C#.
hgm wrote:I see you support multiple moves per turn. Can this also be controlled on a per-piece basis, so that you could handle the Chu-Shogi Lion?

If so, can you handle Chu Shogi, or does that fall outside the parameter limits for board size and/or number of piece types? (And can you handle promotion of more than one piece type in the first place?)
Sure. The architecture is very flexible. Rules are all coded as separate objects that are plugged in to games so there are practically no limits to what rules a game can have. There are no arbitrary restrictions like only one promotable piece type because nothing related to promotion, for example, is "baked in". Of course, the trade-off for all this flexibility is reduced performance. There is a hard limit on board size though, which is 16 x 16. The largest games currently implemented are 12 x 12.

I don't think I'd do the lion the same way I do Marseillais Chess though, although it could be done that way. For the double-move variants, the moves for each leg are generated independently. Basically, there's a hook that's triggered whenever it is time to update the current side to move so that games can change the turn order. When the engine has stopped thinking and it is time to make its move, it scoops up all the moves from the top of the PV for the current side and plays them. To do the lion I don't think I will mess with the turn order. I'll generate each of the lion's movement options as a single unit. The big question will be how that ties into the user-interface... The easy way would be to have the user move the lion directly to its final square. The user would then be prompted with a pop-up asking which extra piece to capture (if any.) The code to do this is already there. It's used by the forest ox in Odin's Rune Chess. It would be more intuitive, though, to let the user move the lion in steps but I'm not sure how I'd make that work. How does it work in Winboard?
hgm wrote:If Chu Shogi is too big, Mighty-Lion Chess and Elven Chess should be no problem, size-wise (if a Lion works). These also have no piece promotions.
Oh, I don't think I've seen Mighty-Lion. I saw Elven Chess and tried to get a game going on Game Courier but no one accepted the invitation. It looks like a good game. Anyway, once the lion is implemented these should be no problem.
hgm wrote:(I don't dare to ask about Tenjiku Shogi :wink: )
I do want to support Tenjiku some day, but there's probably about a million things to come first. Congrats on writing a Tenjiku program by the way! That is a bold undertaking! It was actually when a friend showed me about Tenjiku Shogi that I first became interested in chess variants. Before that I wasn't really aware of variants at all, except for Dragon Chess which I had read about in Dragon magazine as a kid.
hgm wrote:Makruk counting rules should not be so difficult to implement when you implement the reversible-ply counter as a count-down. Then you can always declare draw when it reaches 0. Just when you reset it on a capture you would not always reset it to 100, like in Chess, but to a number that depends on the material present. (And then only if that makes it lower than the value it already has.)
Ok, this shouldn't be that bad. I just need to take the time to do it. I'm more worried about the repetition rules in Xiangqi. I remember a thread you started on here a few years ago hammering it all out. I don't remember any of the details, just that the conversation went on seemingly forever because the rules were so complex and so tricky to get right.
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Nordlandia »

Gregory Strong

Is there any present variants that supports the non-royal king piece known as guard?

https://en.wikipedia.org/wiki/Mann_(chess)
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Evert »

Greg Strong wrote:I'm more worried about the repetition rules in Xiangqi. I remember a thread you started on here a few years ago hammering it all out. I don't remember any of the details, just that the conversation went on seemingly forever because the rules were so complex and so tricky to get right.
You can take a look at how I do this in SjaakII (the relevant source file is chase.h), if that is any help. It's based on the same discussion thread, and I may have posted about it here too.
The rule I use is a bit over-generalised ("if there is a SEE-safe capture of a non-defensive piece, it's a chase") but seems to work ok in practice. There are corner cases where it will flag a chase when there isn't an actual chase according to Asian rules, but those are too complicated to implement in a generic engine like SjaakII. I decided I can live with my engine being occasionally pessimistic, as long as it doesn't actually make an illegal chase itself (as a precaution, I think I never claim an "illegal chase").
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Evert »

Really cool, and well done!

I just wish I had something more constructive to contribute; I couldn't run the program through Mono on OS X (not sure why, there may be a way), but I can run the Windows binary through Wine. This isn't perfect, because the resulting rendering is incredibly ugly, and for some reason white and black pieces are indistinguishable (they all look like white pieces). I was able to load a Windows build of SjaakII, which seemed to work.
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Greg Strong »

Nordlandia wrote:Gregory Strong

Is there any present variants that supports the non-royal king piece known as guard?

https://en.wikipedia.org/wiki/Mann_(chess)
Sure, there are a few: Courier Chess, Courier Chess Moderno, ArchCourier Chess, and Great Shatranj.
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Greg Strong »

Evert wrote:Really cool, and well done!
Thanks!
Evert wrote:I just wish I had something more constructive to contribute; I couldn't run the program through Mono on OS X (not sure why, there may be a way), but I can run the Windows binary through Wine. This isn't perfect, because the resulting rendering is incredibly ugly, and for some reason white and black pieces are indistinguishable (they all look like white pieces). I was able to load a Windows build of SjaakII, which seemed to work.
Strange that it works under Wine but not directly with Mono (for a .NET program, I believe Wine is also using Mono under the surface.) The piece coloring not working is also strange. See what version of Mono you have installed - the piece coloring is working for me on Linux (there are a couple of tiny graphics glitches but they are minor - still disappointing, though, it's not like I'm doing anything complicated - just really basic bitmap operations.) Anyway, if you update Mono to the latest and greatest, that will probably help, even if you are operating under Wine.

I'm also surprised that SjaakII was working for you. The older versions used to work perfectly, but I couldn't get the new version to work correctly. It was ignoring 'force' moves and playing the wrong side and such. It was very strange. That's something I really want to get figured out because I want to distribute SjaakII along with ChessV.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by gbtami »

Congrats to new version! I was able to run it on Ubuntu 16.04 after sudo apt-get install mono-runtime libmono-system-windows-forms4.0-cil
Adding windows executable of SjaakII failed with:

Code: Select all

Cannot open assembly '/home/tamas/bin/SjaakII/SjaakII_win64_MS.exe': File does not contain a valid CIL image.
User avatar
Greg Strong
Posts: 388
Joined: Sun Dec 21, 2008 6:57 pm
Location: Washington, DC

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Greg Strong »

gbtami wrote:Congrats to new version! I was able to run it on Ubuntu 16.04 after sudo apt-get install mono-runtime libmono-system-windows-forms4.0-cil
Adding windows executable of SjaakII failed with:

Code: Select all

Cannot open assembly '/home/tamas/bin/SjaakII/SjaakII_win64_MS.exe': File does not contain a valid CIL image.
Glad to hear you got ChessV running on Ubuntu without issue!

If you're running on Ubuntu, I think you want to use a Linux build of SjaakII. In theory, you should be able to use the windows version by targeting the Wine exe and passing in the SjaakII exe as the parameter, but this didn't work for me. For some reason trying to run a raw Wine process under Mono didn't work for me. But SjaakII has linux binaries.
User avatar
gbtami
Posts: 389
Joined: Wed Sep 26, 2012 1:29 pm
Location: Hungary

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by gbtami »

Greg Strong wrote:
gbtami wrote:Congrats to new version! I was able to run it on Ubuntu 16.04 after sudo apt-get install mono-runtime libmono-system-windows-forms4.0-cil
Adding windows executable of SjaakII failed with:

Code: Select all

Cannot open assembly '/home/tamas/bin/SjaakII/SjaakII_win64_MS.exe': File does not contain a valid CIL image.
Glad to hear you got ChessV running on Ubuntu without issue!

If you're running on Ubuntu, I think you want to use a Linux build of SjaakII. In theory, you should be able to use the windows version by targeting the Wine exe and passing in the SjaakII exe as the parameter, but this didn't work for me. For some reason trying to run a raw Wine process under Mono didn't work for me. But SjaakII has linux binaries.
Adding worked with Linux binary, thx!
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: ChessV 2.0 - open source GUI and engine for chess varian

Post by Evert »

Greg Strong wrote: I'm also surprised that SjaakII was working for you. The older versions used to work perfectly, but I couldn't get the new version to work correctly. It was ignoring 'force' moves and playing the wrong side and such. It was very strange. That's something I really want to get figured out because I want to distribute SjaakII along with ChessV.
You and me both; a few people have reported problems with SjaakII, but it seems to work fine for others. I haven't been able to reproduce the problem myself (under Wine), or, in cases where I did run into issues, I could fix them for myself but then it didn't do anything under actual Windows.

You say the older versions worked, but the new one doesn't. If you have the time, could you verify that 1.3.1 works and 1.4.1 does not (the download links for the older versions are still available if you need them)? Thanks!