Hi guys
I've just started new tutorial series on youtube - this time we gonna be implementing Xiangqi (Chinese chess) engine
in javascript from scratch, Web and UCCI (UCI dialect for CHinese chess) interfaces would be available like in WukongJS.
We've just started so feel free to join this exciting journey!
Development progress:
https://github.com/maksimKorzh/wukong-xiangqi
Xiangqi chess engine in javascript - YouTube tutorial series
Moderators: hgm, Rebel, chrisw
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Xiangqi chess engine in javascript - YouTube tutorial series
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Xiangqi chess engine in javascript - YouTube tutorial series
I love this... the only thing I can say is: could you make a tutorial about how to get 38 hours into a single day?
Even if I'd work on chess all the time next to my day job I couldn't hope to match your output... not even mentioning that I don't want to neglect either my girlfriend, or my piano practice (and I also want to read some books in the meantime too).
I've dabbled in Go for some time (reached about 5 kyu) and looked into Shogi, but the ultimate reason I put them aside is because there are no Electronic / DGT-boards available to play those games.
Even if I'd work on chess all the time next to my day job I couldn't hope to match your output... not even mentioning that I don't want to neglect either my girlfriend, or my piano practice (and I also want to read some books in the meantime too).
I've dabbled in Go for some time (reached about 5 kyu) and looked into Shogi, but the ultimate reason I put them aside is because there are no Electronic / DGT-boards available to play those games.
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Xiangqi chess engine in javascript - YouTube tutorial series
BTW, note that HaQiKi D is also available as Linux binary: http://hgm.nubati.net/haqikid . And MaxQi is in the Debian and Ubuntu fairymax packages. I think that both engines are also available in the XBoard Xiangqi App for OS X.
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Xiangqi chess engine in javascript - YouTube tutorial series
Having 38 hours a day is very simple - all you need is to consider freedom and following your own nature while taking paid jobsmvanthoor wrote: ↑Sun Jan 24, 2021 7:45 pm I love this... the only thing I can say is: could you make a tutorial about how to get 38 hours into a single day?
Even if I'd work on chess all the time next to my day job I couldn't hope to match your output... not even mentioning that I don't want to neglect either my girlfriend, or my piano practice (and I also want to read some books in the meantime too).
I've dabbled in Go for some time (reached about 5 kyu) and looked into Shogi, but the ultimate reason I put them aside is because there are no Electronic / DGT-boards available to play those games.
and trying to avoid any sort of business bullshit at any cost. Then you'll be able to make money only around 15% of the time with
the same efficiency as if it was full time. Well, at least that's what I do) Meanwhile I have a wife and living in a private house in the village,
so no city, no apartments - lots of physical on housekeeping. And apart chess programming I'm also doing chinese martial arts for health
(sort of alternative to piano play, btw I ones was playing a bit as well)
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Xiangqi chess engine in javascript - YouTube tutorial series
Already heavily testing them for a couple of days)hgm wrote: ↑Sun Jan 24, 2021 8:39 pm BTW, note that HaQiKi D is also available as Linux binary: http://hgm.nubati.net/haqikid . And MaxQi is in the Debian and Ubuntu fairymax packages. I think that both engines are also available in the XBoard Xiangqi App for OS X.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Xiangqi chess engine in javascript - YouTube tutorial series
Oh, I got the impression you were omly using the Windows versions, under wine.
Anyway, the Interactive Diagram also is a JavaScript engine that can play Xiangqi. It is quite weak, but that could make it fun to play against, for a beginner. (Which was its design goal.)
Anyway, the Interactive Diagram also is a JavaScript engine that can play Xiangqi. It is quite weak, but that could make it fun to play against, for a beginner. (Which was its design goal.)
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Xiangqi chess engine in javascript - YouTube tutorial series
Cool! Thanks for sharing - I'll try it!hgm wrote: ↑Sun Jan 24, 2021 10:50 pm Oh, I got the impression you were omly using the Windows versions, under wine.
Anyway, the Interactive Diagram also is a JavaScript engine that can play Xiangqi. It is quite weak, but that could make it fun to play against, for a beginner. (Which was its design goal.)
Also one of the goals for my xiangqi engine (apart from being highly didactic) is to serve as the playing partner for absolute beginners.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Xiangqi chess engine in javascript - YouTube tutorial series
Another interesting web project that supports Xiangqi is Jocly. It is mainly a (3d) GUI, but, like the Interactive Diagram, it also contains a generic AI that can play any game you specify the rules for at a modest level. It is also written in JavaScript. The AI there uses an MCTS search, but the programmer has to specify piece values, and can add game-specific evaluation terms. The Interactive Diagram (which uses alpha-beta search) is configured by just the rules, and estimates the piece values by itself.
-
- Posts: 771
- Joined: Sat Sep 08, 2018 5:37 pm
- Location: Ukraine
- Full name: Maksim Korzh
Re: Xiangqi chess engine in javascript - YouTube tutorial series
I've found amazing resource as well:hgm wrote: ↑Mon Jan 25, 2021 9:59 am Another interesting web project that supports Xiangqi is Jocly. It is mainly a (3d) GUI, but, like the Interactive Diagram, it also contains a generic AI that can play any game you specify the rules for at a modest level. It is also written in JavaScript. The AI there uses an MCTS search, but the programmer has to specify piece values, and can add game-specific evaluation terms. The Interactive Diagram (which uses alpha-beta search) is configured by just the rules, and estimates the piece values by itself.
- awesome GUI
- strong enine (well at least 12+ depth online)
- analyze game mode
- play with a fiend mode
http://www.xichess.com/
Also guy has an awesome YouTube channel (where I found him) - he's analyzing GM's games - fantastic resource
on what is "good" and what is "bad".
I've also started playing online myself to better understand the game flow - the interaction between pieces is fantastic.
Without looking to PST from other engines I already have a couple of ideas for PST values for my future values.
I'm now writing movegen. Unfortunately the list of FENs someone sent me has strange format (bigger board) but now
I can compose my own positions similar to Kiwipete in terms of "trickiness" - then run perft test of existing engine and
then compare results to my own.
HGM, I don't know whether it works or not bit I hope you would be proud of me in terms of coming up with absolutely my own movegen code.
I mean I was looking for different sources but for general observations and not implementation details so I just take rules and trying to
implement them as I can - that's the first time in my life when I do something completely on my own just like you do! e.g. today I am writing
isSquareAttacked(square, side) function and designing offset arrays to detect attacks by knight was amazing experience.
Well anyway perft tests would show how correct it is.
Didactic chess engines:
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
https://www.chessprogramming.org/Maksim_Korzh
Chess programming YouTube channel:
https://www.youtube.com/channel/UCB9-pr ... KKqDgXhsMQ
-
- Posts: 27790
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Xiangqi chess engine in javascript - YouTube tutorial series
Well, whether it works or not would not be an unimportant detail for determining that.maksimKorzh wrote: ↑Mon Jan 25, 2021 2:13 pmHGM, I don't know whether it works or not bit I hope you would be proud of me...
The reason I am now rethinking move generation is that there also exists a game Janggi (Korean Chess), which is very much like Xiangqi (played with the same equipment), but even more awful w.r.t. the location-dependent move rules: Rooks and Cannons there can also move along the diagonal lines that are drawn in the Palace on a traditional board. And that means there effectively are finite-range sliders in that game, as a Rook on d0 could move diagonally to e1 and f2, but not any further, as that is where the diagonal line stops. If each piece could specify a different set of moves (range and direction) for every square it is on, that would make it easier to implement such weirdness.