MarkZH / Genetic_Chess

An amateur attempt at breeding a chess-playing AI.
MIT License
10 stars 2 forks source link

Genetic profiling of Fairy Chess Pieces #71

Closed raphaeleliekakou closed 3 years ago

raphaeleliekakou commented 4 years ago

Hi, thanks for this interesting work. Can you make the Following challenge: do the same work for some fairy pieces used in chess variants.

i'm thinking about musketeer chess a chess variant i'm playing for the last couple of years that find refreshing and entertaining as it uses a variety of different additional pieces.

The inventor has used a mathematical approach based on chess engines to help determine the relative value of pieces, but this feels like unfinished business. Probably your appraoch is the most pragmatic one to determine the relative value of pieces. There are many of them and sometimes they are very close in terms of relative value.

You'll find interesting links here: https://github.com/fsmosca/musketeer-chess Also a link of Musketeer Stockfish engine https://github.com/ianfab/Musketeer-Stockfish

best regards

PS: inventor website is www.musketeerchess.net feel free to mail him directly

MarkZH commented 4 years ago

This could be an interesting problem. I'm going to have to do some thinking to see how much work this will take and how many of my program's assumptions these new pieces are rules will break.

Some questions regarding the rules:

  1. Is there an authoritative source for the rules? The fsmosca repository has a lot more rules listed than the musketeerchess.net website.

  2. Is is permissible for a player to move a piece in front of a gated piece and choose not to put the gated piece on the board? Granted, this would almost surely be a bad move since it prevents a piece from ever entering the game. Is this a player's choice or is the entrance of the gated piece automatic?

  3. If a gated piece is placed behind a rook and that rook is involved in a castling move, does the gated piece enter the board?

  4. Can a pawn be promoted to a gated piece?

  5. Has an FEN format been decided? The fsmosca and ianfab repositories use different, incompatible formats.

raphaeleliekakou commented 4 years ago

Hi Mark Zied's email is musketeerches (a) gmail.com so he's the best to answer your questions. I know know very well the rules and the game and i can answer all your questions.

1.

Is there an authoritative source for the rules? The fsmosca repository has a lot more rules listed than the musketeerchess.net website: Ferdinand Mosca works with Zied, so the rules that were put at the GitHub site are the rules of the Musketeer Chess Variant. Some tricky positions needed to be precised when programming, thus the idea of completing the rules. i'm personally trying to make a wikipedia page for musketeer chess. I discuss it with Zied for approval concerning the rules. What i know is that Zied now thinks that Musketeer Chess and the particular way the new pieces are Added is a "family of games". Seirawan Chess which inspired the Musketeer chess work, is a parent variant with a different rule concerning "gating" the new pieces. But what i know that is Musketeer Chess way of gating makes much more sense in terms of game equilibrium (black has almost equal chances compared to white as he can adapt, in seirawan chess engines proved that white has a big advantage). Also Zied is going to update the rules, not in a way that changes the fundamental rules, but he is going to allow for much more fairy pieces used (by mutual agreement) which makes the possibilities wider and only limit is the imagination of the players 2.

Is is permissible for a player to move a piece in front of a gated piece and choose not to put the gated piece on the board? Granted this would almost surely be a bad move since it prevents a piece from ever entering the game. Is this a player's choice or is the entrance of the gated piece automatic? If a player moves a piece in front of a gated piece, he must gate the piece (unless he loses the right to gate it later). This is among the specific rules that différentiâtes Muskeeter and Seirawan, making Musketeer a more strategic game. It's also a very tactical game and you can find yourself losing a piece after a few moves just because of a bad gating choice ! 3.

If a gated piece is placed behind a rook and that rook is involved in a castling move, does the gated piece enter the board? Yes. But you Don't have the right to place a piece behind king and rook at the same time to prevent agting both pieces when castling. 4.

Can a pawn be promoted to a gated piece? Yes, a pawn can Promote to any of the new pieces even if the pieces weren't yet gated. They are part of the game and they are among the options for promotion. 5.

If you chose to gate a piece behind a King you must be careful. If the

king is in check and must move he forfeits the right to gate. Only exception to this is if the king moves to capture the checking piece. 6.

A pinned piece cannot move like in regular chess. Even if in theory you can block the check when gating, but the principle of Moving a pinned piece is forbidden. Musketeer Chess is Chess. 7.

If you have for example a piece waiting to be gated in f8 square. If the f8 piece is captured before Moving and gating, it's like a double capture = you capture the f8 piece and you also capture the piece that is waiting to be gated !

Le dim. 29 mars 2020 à 12:22, Mark Harrison notifications@github.com a écrit :

This could be an interesting problem. I'm going to have to do some thinking to see how much work this will take and how many of my program's assumptions these new pieces are rules will break.

Some questions regarding the rules:

1.

Is there an authoritative source for the rules? The fsmosca repository has a lot more rules listed than the musketeerchess.net website. 2.

Is is permissible for a player to move a piece in front of a gated piece and choose not to put the gated piece on the board? Granted this would almost surely be a bad move since it prevents a piece from ever entering the game. Is this a player's choice or is the entrance of the gated piece automatic? 3.

If a gated piece is placed behind a rook and that rook is involved in a castling move, does the gated piece enter the board? 4.

Can a pawn be promoted to a gated piece?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarkZH/Genetic_Chess/issues/71#issuecomment-605614628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO6TGWNGUEQFRSTGWNXKGTTRJ4ONXANCNFSM4LVNNHEQ .

raphaeleliekakou commented 4 years ago

Hi Mark I asked Dr Zied Haddad who invented musketeer chess to get in touch with you. can you give me your email? thank you Raphael

MarkZH commented 4 years ago

If possible, I think it would be easier for any conversations to take place here in this issue thread. It would be easier to keep all the conversations and all information in one place, especially if other people join later. Go ahead and invite him to post here.

musketeerchess commented 4 years ago

Hi Mark and Raphael, thanks for the information concerning Genetic Chess, a Nice NN concept.

My needs are to challenge your engine that will play from scratch a new game, based on chess but with a major difference, two unique pieces are added to the game. The choice is made among a Basket of 10 different pieces, so there are 45 possible combinations.

These pieces are introduced in the game once one of the pieces in teh first rank move first. The placement of the new pieces is defined before the game begins, but to ease testing it's possible o "gate" a new piece once one of the first rank piece move for the first time. It's also possible to gate one piece when castling but only in the square made vacant by the King or the Rook (so it's not possible to gate both pieces at the same time when castling).

When promoting, the only difference with classic chess is that you can gate also to any of the pieces that begun the game.

There are some exceptions where the new pieces cannot gate: for example if a king moves because it is in check it's not possible to gate, unless the king captures the checking piece. Also if a piece is captured before first moving it's not possible to gate there.

Here are the diagrams of the new pieces: (arrow = a jump like Knight, circle = slide like Bishop)

Leopard wsb_550x550_leopard

Cannon wsb_550x550_cannon

Unicorn wsb_550x550_unicorn

Fortress wsb_550x550_fortress

Archbishop = Bishop + Knight archbishop-1-e1490031092535

Chancellor = Rook + knight chancellor-1-e1490030842467

Amazon = Queen + Knight wsb_550x550_dragon

Hawk wsb_550x550_hawk

Elephant wsb_550x550_elephant

Spider

wsb_550x550_spider

MarkZH commented 4 years ago

Hi Dr. Haddad.

I've created a branch in this github repository to implement the rules of Musketeer Chess. I think I've done it correctly since it passes all the perft tests in the fsmosca repository.

I'm planning on starting some gene pool runs soon, but these take days of continuous running to produce results. I'm still modifying my program, so it will be quite some time before I have anything to report.

musketeerchess commented 4 years ago

Dear Mark It's fantastic. Challenging engines with new tasks like using unusual pieces is probably one of the best ways to improve the Engine.

I'm glad you made it.

Le mer. 22 avr. 2020 à 06:07, Mark Harrison notifications@github.com a écrit :

Hi Dr. Haddad.

I've created a branch in this github repository to implement the rules of Musketeer Chess. I think I've done it correctly since it passes all the perft tests in the fsmosca repository https://github.com/fsmosca/musketeer-chess.

I'm planning on starting some gene pool runs soon, but these take days of continuous running to produce results. I'm still modifying my program, so it will be quite some time before I have anything to report.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarkZH/Genetic_Chess/issues/71#issuecomment-617536765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIE4HPXGU37YU6YSZCCVJ3RNZUPHANCNFSM4LVNNHEQ .

MarkZH commented 4 years ago

Some results from a gene pool:

Start: April 25 End: May 1 Game time: 0.1-10 seconds per side for whole game, no increment

Game count: 245,928 AI specimen count: 224,701

For each game, the fairy pieces were chosen randomly and placed at random locations behind the base rank (making sure that they were not placed behind a king and rook at the same time). The randomness was used for two reasons. First, I haven't come up with a way to integrate the choosing of fairy pieces into my game engine. Second, I wanted to make sure that all fairy pieces got equal representation so that early mutations didn't lead to some pieces being rarely chosen.

Piece values (average of last 100 surviving Genetic AIs): A = 672 B = 352 C = 981 D = 1395 E = 417 F = 609 H = 298 L = 784 M = 702 N = 218 P = 78 Q = 900 R = 406 S = 1048 U = 525

As you'll see in the plots below, these are not exact values. With so many pieces, it takes a long time for large swings in values to dampen down. The evolution of the Dragon's value is perhaps the wildest. It's probably safe to put error bars of +/-100 on each value.

Here are the plots of the evolved values of each of the pieces. The different colors represent separate gene pools. In order to preserve diversity, The AIs are divided into separate pools that only compete and reproduce with other AIs in their same pool. Once in a while (about every 23,000 offspring) all of the AIs are randomly placed in different gene pools so that good genes can spread to other pools. This pool mixing is why you'll occasionally see sudden discontinuous jumps in piece values. The black lines on each plot is a moving average of length 100. The circles at the far right of the plots mark the AIs that are still alive.

There are other genes that determine AI behavior, but I'm only presenting the genes for piece values below. The piece values have been normalized so that the queen is always worth 900. The value for the king acts differently from other pieces since it can never be removed from the board, so it's value is not directly comparable with other pieces and has been omitted. Similarly, there are other genes that evaluate pawn structure, so the value of a pawn is often close to zero if not negative. This is why the queen is used to normalize piece values instead of assigning the pawn a value of 100.

Click to enlarge plots.

pool txt gene Piece Strength Gene - A pool txt gene Piece Strength Gene - B pool txt gene Piece Strength Gene - C pool txt gene Piece Strength Gene - D pool txt gene Piece Strength Gene - E pool txt gene Piece Strength Gene - F pool txt gene Piece Strength Gene - H pool txt gene Piece Strength Gene - L pool txt gene Piece Strength Gene - M pool txt gene Piece Strength Gene - N pool txt gene Piece Strength Gene - P pool txt gene Piece Strength Gene - Q pool txt gene Piece Strength Gene - R pool txt gene Piece Strength Gene - S pool txt gene Piece Strength Gene - U

This final plot shows all the piece values together using the moving average lines from the plots above. Given the number of pieces, it's quite crowded and hard (if not impossible) to read. The number next to the piece symbols in the legend are the values at the end of the plots. This may make it easier to identify which plot is which.

pool txt special piece strength

Perhaps this may also be interesting, here's a count of how many times each piece was chosen when a pawn was promoted.

A 2212 B 1828 C 5620 D 11005 E 1910 F 6173 H 2239 L 1479 M 8045 N 1687 Q 62460 R 7091 S 6493 U 1648

musketeerchess commented 4 years ago

Hi Mark It's very interesting !

There is a big disparity concerning the number of times each piece was tested. I saw that the pieces controlling more squares where chosen more often (Dragon Chancellor Spider) !

May be there is need to run separate tests for combinations of pieces.

A = Archbishop ?

L = Leopard ?

The Leopard is a "limited" verison of Archbishop so reasonably it cannot be stronger. This is the most interesting case to study !! why such results (may be Archbishop was tested with much stronger pieces like Dragon, explaining that it's impact in winning was less important);

I love all the "complications" such tests create. This is eally fun and stimulating.

Is it possible to see the number of games played by each combination of pieces (there are 45 different combinations).

I would love to write an article with you concerning the final results.

PS: How can i run your tests on my computer.

Best regards

Zied

Le sam. 2 mai 2020 à 11:44, Mark Harrison notifications@github.com a écrit :

Some results from a gene pool:

Start: April 25 End: May 1 Game time: 0.1-10 seconds per side for whole game, no increment

Game count: 245,928 AI specimen count: 224,701

For each game, the fairy pieces were chosen randomly and placed at random locations behind the base rank (making sure that they were not placed behind a king and rook at the same time). The randomness was used for two reasons. First, I haven't come up with a way to integrate the choosing of fairy pieces into my game engine. Second, I wanted to make sure that all fairy pieces got equal representation so that early mutations didn't lead to some pieces being rarely chosen.

Piece values (average of last 100 surviving Genetic AIs): A = 672 B = 352 C = 981 D = 1395 E = 417 F = 609 H = 298 L = 784 M = 702 N = 218 P = 78 Q = 900 R = 406 S = 1048 U = 525

As you'll see in the plots below, these are not exact values. With so many pieces, it takes a long time for large swings in values to dampen down. The evolution of the Dragon's value is perhaps the wildest. It's probably safe to put error bars of +/-100 on each value.

Here are the plots of the evolved values of each of the pieces. The different colors represent separate gene pools. In order to preserve diversity, The AIs are divided into separate pools that only compete and reproduce with other AIs in their same pool. Once in a while (about every 23,000 offspring) all of the AIs are randomly placed in different gene pools so that good genes can spread to other pools. This pool mixing is why you'll occasionally see sudden discontinuous jumps in piece values. The black lines on each plot is a moving average of length 100. The circles at the far right of the plots mark the AIs that are still alive.

There are other genes that determine AI behavior, but I'm only presenting the genes for piece values below. The piece values have been normalized so that the queen is always worth 900. The value for the king acts differently from other pieces since it can never be removed from the board, so it's value is not directly comparable with other pieces and has been omitted. Similarly, there are other genes that evaluate pawn structure, so the value of a pawn is often close to zero if not negative. This is why the queen is used to normalize piece values instead of assigning the pawn a value of 100.

Click to enlarge plots.

[image: pool txt gene Piece Strength Gene - A] https://user-images.githubusercontent.com/10629050/80859630-2fa99200-8c17-11ea-8eea-cf2e2fedcadc.png [image: pool txt gene Piece Strength Gene - B] https://user-images.githubusercontent.com/10629050/80859634-3506dc80-8c17-11ea-8545-240d9963402e.png [image: pool txt gene Piece Strength Gene - C] https://user-images.githubusercontent.com/10629050/80859638-3c2dea80-8c17-11ea-8772-1f9fdda654c7.png [image: pool txt gene Piece Strength Gene - D] https://user-images.githubusercontent.com/10629050/80859639-3cc68100-8c17-11ea-84e5-4f3fb709ba73.png [image: pool txt gene Piece Strength Gene - E] https://user-images.githubusercontent.com/10629050/80859643-464fe900-8c17-11ea-8e4d-2f0286f10bfa.png [image: pool txt gene Piece Strength Gene - F] https://user-images.githubusercontent.com/10629050/80859644-464fe900-8c17-11ea-91d5-371cdcc069a6.png [image: pool txt gene Piece Strength Gene - H] https://user-images.githubusercontent.com/10629050/80859646-46e87f80-8c17-11ea-9879-28749e4f12bb.png [image: pool txt gene Piece Strength Gene - L] https://user-images.githubusercontent.com/10629050/80859649-47811600-8c17-11ea-9469-9ae7c69f8513.png [image: pool txt gene Piece Strength Gene - M] https://user-images.githubusercontent.com/10629050/80859650-47811600-8c17-11ea-80ee-dab62d4ade69.png [image: pool txt gene Piece Strength Gene - N] https://user-images.githubusercontent.com/10629050/80859652-4819ac80-8c17-11ea-86ae-8f76bb54e7bc.png [image: pool txt gene Piece Strength Gene - P] https://user-images.githubusercontent.com/10629050/80859653-4819ac80-8c17-11ea-8a04-c49c0a4b201a.png [image: pool txt gene Piece Strength Gene - Q] https://user-images.githubusercontent.com/10629050/80859655-48b24300-8c17-11ea-8181-813bd5c7ddad.png [image: pool txt gene Piece Strength Gene - R] https://user-images.githubusercontent.com/10629050/80859656-48b24300-8c17-11ea-8439-e126b661a5d1.png [image: pool txt gene Piece Strength Gene - S] https://user-images.githubusercontent.com/10629050/80859657-494ad980-8c17-11ea-9e15-5a14ef90578c.png [image: pool txt gene Piece Strength Gene - U] https://user-images.githubusercontent.com/10629050/80859658-494ad980-8c17-11ea-864a-307e9b23791b.png

This final plot shows all the piece values together using the moving average lines from the plots above. Given the number of pieces, it's quite crowded and hard (if not impossible) to read. The number next to the piece symbols in the legend are the values at the end of the plots. This may make it easier to identify which plot is which.

[image: pool txt special piece strength] https://user-images.githubusercontent.com/10629050/80859642-45b75280-8c17-11ea-8ee5-849964942486.png

Perhaps this may also be interesting, here's a count of how many times each piece was chosen when a pawn was promoted.

A 2212 B 1828 C 5620 D 11005 E 1910 F 6173 H 2239 L 1479 M 8045 N 1687 Q 62460 R 7091 S 6493 U 1648

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarkZH/Genetic_Chess/issues/71#issuecomment-622927261, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIE4HJZBYR7BKX4JQLSXXLRPPTPDANCNFSM4LVNNHEQ .

MarkZH commented 4 years ago

I had thought about doing a run for each pair of fairy pieces, but that would take several months. Then again, given that there are 45 pairs, piece valuations get tested much more rarely. So, even with testing all piece at once, it's still going to take months.

The least used pair of fairy pieces was the Dragon and Hawk at 5273 games. The most used pair was the Archbishop and Dragon at 5643 games. Given that it took about 30-40 thousand games to get the normal chess pieces to their standard values, I can understand the inaccuracies for the less used pieces.

All pairs: DH 5273 EM 5290 AM 5308 ES 5316 FS 5332 CE 5370 DE 5373 MU 5384 LS 5397 CF 5421 CS 5423 CL 5426 DM 5441 HS 5450 CH 5452 HL 5453 DS 5455 EU 5457 EL 5458 LM 5459 CU 5460 AL 5461 DU 5472 HM 5473 AF 5476 DL 5478 MS 5484 EF 5495 LU 5496 CD 5506 HU 5506 SU 5510 AC 5520 AE 5522 FH 5524 CM 5528 FU 5533 AU 5535 EH 5545 DF 5549 FL 5550 AS 5558 FM 5564 AH 5602 AD 5643

If you want to run this program on your computer, there are instructions for compiling the program and running a gene pool in the README file on the front page of my repository.

One last thing, I might have been unclear in the last set of number in my last post. Those were counts of which piece a pawn was promoted to during all games (note that the queen was chosen most often, which is expected). It was not a count of which pieces were chosen for a game.

musketeerchess commented 4 years ago

Hi Mark

Got it now concerning Queen Promotion.

I'll try to launch a test on my machine if i can.

What i see is that globally, all combinations are chosen qually, which is excellent.

To avoid any confusion, can you again precise the PGN Notation. Thanks for this outstanding work.

Le sam. 2 mai 2020 à 14:24, Mark Harrison notifications@github.com a écrit :

I had thought about doing a run for each pair of fairy pieces, but that would take several months. Then again, given that there are 45 pairs, piece valuations get tested much more rarely. So, even with testing all piece at once, it's still going to take months.

The least used pair of fairy pieces was the Dragon and Hawk at 5273 games. The most used pair was the Archbishop and Dragon at 5643 games. Given that it took about 30-40 thousand games to get the normal chess pieces to their standard values, I can understand the inaccuracies for the less used pieces.

All pairs: DH 5273 EM 5290 AM 5308 ES 5316 FS 5332 CE 5370 DE 5373 MU 5384 LS 5397 CF 5421 CS 5423 CL 5426 DM 5441 HS 5450 CH 5452 HL 5453 DS 5455 EU 5457 EL 5458 LM 5459 CU 5460 AL 5461 DU 5472 HM 5473 AF 5476 DL 5478 MS 5484 EF 5495 LU 5496 CD 5506 HU 5506 SU 5510 AC 5520 AE 5522 FH 5524 CM 5528 FU 5533 AU 5535 EH 5545 DF 5549 FL 5550 AS 5558 FM 5564 AH 5602 AD 5643

If you want to run this program on your computer, there are instructions for compiling the program and running a gene pool in the README file on the front page of my repository https://github.com/MarkZH/Genetic_Chess/.

One last thing, I might have been unclear in the last set of number in my last post. Those were counts of which piece a pawn was promoted to during all games (note that the queen was chosen most often, which is expected). It was not a count of which pieces were chosen for a game.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MarkZH/Genetic_Chess/issues/71#issuecomment-622945750, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIIE4HJESIIMMLQK2KMU543RPQGJBANCNFSM4LVNNHEQ .

MarkZH commented 4 years ago

The PGN names for the pieces are the same as listed in https://github.com/fsmosca/musketeer-chess

L = Leopard C = Cannon U = Unicorn D = Dragon M = Chancellor A = Archbishop E = Elephant H = Hawk F = Fortress S = Spider

raphaeleliekakou commented 4 years ago

hello back after a long illness (covid). results are interesting. have you continued your tests and what are the new results? Raffa the survivor.

MarkZH commented 4 years ago

I'm happy you have recovered.

I've had to put a pause on running my program in order to move residences. I am not sure when I'll be able to start again.

raphaeleliekakou commented 4 years ago

hello Mark

i wish you to live better in your new residence.

what i know from Dr haddad is that he is working on an evolution of his game. So testing it using your method will probably be important for him.

Le ven. 5 juin 2020 à 23:46, Mark Harrison notifications@github.com a écrit :

I'm happy you have recovered.

I've had to put a pause on running my program in order to move residences. I am not sure when I'll be able to start again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarkZH/Genetic_Chess/issues/71#issuecomment-639839676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO6TGWLXZYHZCCOAXLXGGW3RVFRUPANCNFSM4LVNNHEQ .

MarkZH commented 3 years ago

Hello again. Sorry about the long silence. I got a new job and moved to a new city, so now I'm finally settled enough to get back to this project.

I've performed a series of gene pool runs in which only two fairy pieces are used. In the table below, the two-letter columns (CD, EH, etc.) indicate which two fairy pieces are used for that gene pool run. The last two-letter column--DS (check)--is a last run which reused two pieces from different runs to make sure that similar results would be obtained. The piece values obtained are listed in the Mean column. The MusketeerChess.net values are sourced from here.

Name Symbol CD EH FS LU MA DS (check) Mean Musketeer Chess .net Difference (Genetic – Website)
Archbishop A         7.31   7.31 7.7 -0.39
Bishop B 3.2 3.26 4.58 4.35 2.58 3.57 3.59 3.15 0.44
Cannon C 7.55           7.55 7.5 0.05
Dragon D 15.07         15.76 15.42 14 1.42
Elephant E   8.5         8.50 6.3 2.20
Fortress F     8.22       8.22 7.6 0.62
Hawk H   7.52         7.52 5.5 2.02
King K -4.83 5.43 1.83 4.07 0.69 10.02 2.87    
Leopard L       8.65     8.65 6.7 1.95
Chancellor M         8.34   8.34 8 0.34
Knight N 2.53 2.87 3.52 3.55 2.95 3.32 3.12 3.15 -0.03
Pawn P 1.34 0.51 0.35 0.11 0.9 -0.23 0.50 1 -0.50
Queen Q 8.52 11.27 9.73 10.19 10.02 9.57 9.88 9.75 0.13
Rook R 4.15 4.88 5.14 5.67 5.37 5.69 5.15 5 0.15
Spider S     11.26     8.99 10.13 8.15 1.98
Unicorn U       7.26     7.26 5.6 1.66
                     
Game Count   239400 273312 228072 320192 311688 248304      

A note about the King's value: since the king never comes off the board, the value of one player's king is always cancelled out by the other player's king. There are other genetic aspects that take the king's piece value into account, but the overall evolutionary pressure on the king value is weak, so it tends to end up with wildly different values from run to run.

I stopped each gene pool run when it looked like the piece values had reached a somewhat stable equilibrium where non-small swings in value were temporary. I've copied plots of the piece values over time below:

Cannon and Dragon

pool txt special piece strength

Elephant and Hawk

pool txt special piece strength

Fortress and Spider

pool txt special piece strength

Leopard and Unicorn

pool txt special piece strength

Chancellor and Archbishop

pool txt special piece strength

Dragon and Spider (check)

pool txt special piece strength

Performed with commit: 54538d20c98844c3eb2c91ecd7c537e88a2ba16f

MarkZH commented 3 years ago

@raphaeleliekakou @musketeerchess

musketeerchess commented 3 years ago

Hello again. Sorry about the long silence. I got a new job and moved to a new city, so now I'm finally settled enough to get back to this project.

I've performed a series of gene pool runs in which only two fairy pieces are used. In the table below, the two-letter columns (CD, EH, etc.) indicate which two fairy pieces are used for that gene pool run. The last two-letter column--DS (check)--is a last run which reused two pieces from different runs to make sure that similar results would be obtained. The piece values obtained are listed in the Mean column. The MusketeerChess.net values are sourced from here.

Name Symbol CD EH FS LU MA DS (check) Mean Musketeer Chess .net Difference (Genetic – Website) Archbishop A         7.31   7.31 7.7 -0.39 Bishop B 3.2 3.26 4.58 4.35 2.58 3.57 3.59 3.15 0.44 Cannon C 7.55           7.55 7.5 0.05 Dragon D 15.07         15.76 15.42 14 1.42 Elephant E   8.5         8.50 6.3 2.20 Fortress F     8.22       8.22 7.6 0.62 Hawk H   7.52         7.52 5.5 2.02 King K -4.83 5.43 1.83 4.07 0.69 10.02 2.87     Leopard L       8.65     8.65 6.7 1.95 Chancellor M         8.34   8.34 8 0.34 Knight N 2.53 2.87 3.52 3.55 2.95 3.32 3.12 3.15 -0.03 Pawn P 1.34 0.51 0.35 0.11 0.9 -0.23 0.50 1 -0.50 Queen Q 8.52 11.27 9.73 10.19 10.02 9.57 9.88 9.75 0.13 Rook R 4.15 4.88 5.14 5.67 5.37 5.69 5.15 5 0.15 Spider S     11.26     8.99 10.13 8.15 1.98 Unicorn U       7.26     7.26 5.6 1.66                       Game Count   239400 273312 228072 320192 311688 248304       A note about the King's value: since the king never comes off the board, the value of one player's king is always cancelled out by the other player's king. There are other genetic aspects that take the king's piece value into account, but the overall evolutionary pressure on the king value is weak, so it tends to end up with wildly different values from run to run.

I stopped each gene pool run when it looked like the piece values had reached a somewhat stable equilibrium where non-small swings in value were temporary. I've copied plots of the piece values over time below:

Cannon and Dragon

pool txt special piece strength

Elephant and Hawk

pool txt special piece strength

Fortress and Spider

pool txt special piece strength

Leopard and Unicorn

pool txt special piece strength

Chancellor and Archbishop

pool txt special piece strength

Dragon and Spider (check)

pool txt special piece strength

Performed with commit: 54538d2

Hi Just noticed your post on my forum.

I must say that your results are very interesting, and quite unexpected for some of them.

Here is a copy of my answer i posted in my forum;

Hi Mark This is an extremely interesting test. Even if the results are sometimes "unexpected" but they are still useful.

The most striking fact for me was the "value" of the "King". This value was clearly lower when the combination of the pieces is made strictly from long range pieces (Archbishop and Chancellor combo) and for the MA combo the King value was even lower then in the combo involving the Dragon (Queen + Knight). Your system shows clearly the following: the importance of the combination choice !

In my opinion, this is a very important clue confirming some strong assumptions i got when developing and play-testing Musketeer Chess for a long period of time.

I'm very interested about the following: Is it possible for you to continue your tests and try complimentary runs with the remaining combination of pieces that were not tested?

Probably when averaging the final result after testing all the combinations will be closer to the results we published in our website.

musketeerchess commented 3 years ago

Hi Dr. Haddad.

I've created a branch in this github repository to implement the rules of Musketeer Chess. I think I've done it correctly since it passes all the perft tests in the fsmosca repository.

I'm planning on starting some gene pool runs soon, but these take days of continuous running to produce results. I'm still modifying my program, so it will be quite some time before I have anything to report.

Hi Mark I'd like to participate in this experiment. I'm unable to find a copy of the engine with the Musketeer Chess Engine. Please share with me. After seeing your results i'm really very excited to try the Genetic Algorithms myself.