Would someone be interested in programming....

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
hgm
Posts: 24740
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Would someone be interested in programming....

Post by hgm » Thu Oct 04, 2007 12:30 pm

On the piece evaluation itself:

Knights vs Commoners

As the Commoners were losing quite decisively from the Bishops (by about the same margin as Pawn odds), both with 320cP with 280cP set for the Commoner value, I now tried Commoners vs Knights (both 280cP). The Knights still win this, but only by ~56%.

I also tried playing in a different starting position for the side with Commoners+Bishops, putting the Bishops on b1 and g1, and the Commoners on c1 and f1. (To make sure the Commoners don't appear bad just because they were started in a position from which they could not reach the centrum easily enough.) In the number of games I have so far, this was not significantly different. I also tried a match between two FIDE armies, swapping the opening position of B and N in one of those. With even less games this was practically even (38-36). Knights do not seem to mind starting on the b and g file very much, their lateral manouevrability lets them still reach the center quickly enough even from there (which might be more difficult for the Commoners). Starting them in the corners might be a different story, but I see no reason to try that.

As 56% is about half the Pawn odds advantage, each Commoner seems about 20cP weaker than a Knight, i.e., the opening value in uMax is 260cP. It is still rather surprising to me that the Commoner is weaker than the Knight, as in contrast to the latter, it has mating potential. I will certainly repeat this test sometime with a slower time control, to make sure the apparent superiority of N over M is not due to the fact that uMax simply doesn't know how to handle Commoners well in the end-game, in bullet/blitz games. I can imagine that Commoners, being slow pieces, need deeper search to make sure they don't inadvertently let an opponent's passer escape.

Bishops vs Knights

To see if the relative strength of B vs M and N vs M make sense, I had to know more presicely how much the N-B difference actually is. uMax uses 280cP vs 320cP as a kludge to protect B-pair, which works, but the true value of this difference was never tested. So I had set up a match where one side had 4 Bishops, and the other 4 Knights. When the score reached 6.5-0.5 in favor of the Bishops, I decided to abort that in stead of letting it run all night, as the difference seemed too big. So I started a match where one side had NNNN in stead of NNBB against a normal FIDE army. This ended 196.5-169.5 = 53.6%. This is only 1/4 of Pawn odds, suggesting that there is only a 20cP difference between the opening value of BB and NN, in favor of BB.

This small difference was hard to reconcile with the way the NNNN were whacked by BBBB. So I am now running the latter as a long match after all, to see if the previous 7 games were merely a statistical fluke. If not, there could be something funny with the Bishop pair, though. The B-pair is the best-established example of non-linear piece interaction. So it would not be too weird if the value of a larger number of Bishops is also not simply proportional to their number. After all, with two Bishops on white and two on black, you really have 4 Bishop pairs, not 2. In addition even if BB is better than NN, the advantage might shrink by giving each side two additional Knights: the Bishops will be very vulnerable to swapoff for a Knight, wrecking its B-pair when this occurs even once. With 4N vs 4B it should be possible to manouevre such that the first two Bishops you have to give for Knights are on opposite colors, so that you are always left with an ordinary BB vs NN advantage.

To investigate the value of the B-pair, I will play BBNN vs BBNN, were one side will play from an opening position where B and N swap location on one wing, but not on the other. That side will thus play with two Bishops on the same color. I yet have to start this.

again, Camels vs Knights

The Camels were beaten quite decisively by the Knights, better than Pawn odds. To make sure we are in the linear range of the piece-value vs score relation, I tried to test the N-C value in a more even setting, by giving the Knight-side Pawn odds to compensate for its superior piece makeup. This match (where I led the engines to believe C=200cP) is still running, and after ~150 games the Knights still seem to have the upper hand (hoof? :lol: ), but now only by about 6%. This seems to confirm that the N-C difference is more than half a Pawn, and would place the Camel near 220cP.

next

The next thing I will try is probably Nightriders. I can do that almost without any programming, making the exo-piece a slider in stead of a leaper. It is of course enticing to replace the Knights by Nightriders (H), but H is supposed to be a quite strong piece. So it might be better to start by replacing BB for HH. If the Bishops get whacked, I can try replacing the Rooks in stead. Or perhaps R on one wing, and N on the other, if the H value lies around 400cP.

I am not sure how to test Ferz and Wazir, as they are expected to be even weaker than the Camel. Perhaps the most favorable position would be F or W on c1/f1, and B on b1/g1, and give the opponent Pawn odds.

I am actually more curious to the value of a Cannon, which seems a quite intersting piece. But such hopping pieces would require some more programming, so I am not sure when I will get to do that.

User avatar
hgm
Posts: 24740
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Would someone be interested in programming....

Post by hgm » Thu Oct 04, 2007 5:44 pm

BBBB vs NNNN now 101-55 = 65%

That is the same as Pawn Odds, which in uMax is 80cP. So it is not nearly as dramatic as the 7 earlier games suggested. But there still seems a non-linear dependence on the number of Bishops, as BBNN vs NNNN was only a lead of 53.6%, or 20cP. NNNN vs NNNN is of course 0, by definition.

neoliminal

Re: Would someone be interested in programming....

Post by neoliminal » Thu Oct 04, 2007 6:45 pm

Loss of one bishop dramatically changes the odds because they depend on each other so much. Try putting all the bishops on one colour and run the test.

User avatar
Ovyron
Posts: 4392
Joined: Tue Jul 03, 2007 2:30 am

Re: Would someone be interested in programming....

Post by Ovyron » Thu Oct 04, 2007 9:56 pm

hgm wrote:An alternative for the Nightrider that I once saw was to make it an ordinary Knight symbol, but wearing a "Zorro" mask.
Like this?

Image
Your beliefs create your reality, so be careful what you wish for.

User avatar
hgm
Posts: 24740
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Would someone be interested in programming....

Post by hgm » Fri Oct 05, 2007 8:51 am

Yes! I think that idea is so funny that it deserves to be present in or fairy set, even if we also implement the 'speedy' variant.

Nightriders (H) are quite strong, btw. I interrupted matches of HH vs BB (at 14-1) and HH vs R+N (at 8.5-1.5), to finally play a long HH vs RR. (Note this involves an extra handicap for the HH side, as it cannot castle. I set the internal H value to the same as Rook (480 cP), but after 200 games the Nightriders were leading 63%, which is exactly the Pawn-odds score. So that would make the Nightrider half a Pawn stronger than the Rook.

Thus I am trying again now, with H=520, to see if HH does even better if the engine knows that it should preferaby avoid swapping it for Rook.

In a match between two FIDE armies with the Q-side B & N swapping location (i.e. both B on the same color, a Bishop 'anti-pair') for one of the players, that player is busy losing the match by 56%. About Half Pawn odds. So the B-pair seems to be worth 50cP compared to unpaired Bishops. That is about Kauffman's value for B-pair, which suggests the evaluation method does work. This assumes, though, that B anti-pair is simply twice the value of an isolated Bishop. So to be sure, I should test BBNN (anti-pair) against NNNN as well.

User avatar
hgm
Posts: 24740
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Would someone be interested in programming....

Post by hgm » Sat Oct 06, 2007 10:06 am

Nightriders vs Rooks

To conclude the Nightrider evaluation, I gave the side that had Nightriders in stead of Rooks a Pawn handicap (-f2/f7). Always better to test with an internal standard, then having to compare two match results that each have a statistical error. Despite the Pawn odds, the Nightriders still won the match with 53.7% +/- 2.8% (230 games). That is still 280 +/- 210 cP better than even, or 140 +/- 100 cP per Nightrider.

All this despite the castling handicap, which is probably not worth too much, at this level of play. I might measure that later.

The Nightrider seems thus 640 +/- 100 cP better than a Rook, say 2/3 of a Pawn.

next

Upcoming are Zebras ((3,2) leapers). b1 and g1 are as bad as corner squares for this piece, so I might have to do something about the initial position.

I might implement pieces with different capture and non-capture moves next. There don't seem too many popular fairy pieces that feature this, tough. Some time ago I invented the 'omni-derectional Pawn', or 'Omni', myself. It moves as a Wazir (one step orthogonal) but captures as a Ferz (one step diagonal). I did this to have smething similar to a Pawn, but 8-fold symmetrical, so I could use it in my EGTB generator. Funny thing was that O+O had mating potential, while both W+W and F+F did not. (There are a few (quite long) forced mates with F+W, though, despite the fact that the KWFK is generally drawn.) A also tried the 'Berolina version' of the Omni; two of those could also provide a general win against a bare King. Both are pretty weak pieces, though, perhaps not even a Pawn (they are definitely more mobile, but a Pawn can promote...). It would be more interesting to test a piece that moves as a Queen, but captures as Knight. I am not sure if that has been proposed before. If not, I would propose the name 'Pegasus'.[/b]

User avatar
hgm
Posts: 24740
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Would someone be interested in programming....

Post by hgm » Sun Oct 07, 2007 12:12 pm

Knights vs Zebras

The Zebras ((3,2) leapers) are truly weak pieces. Replacing one side's NN by ZZ, and giving the opponent Pawn odds, the Knights won by 66% despite these odds. I tried to start the Zebras then on c1/f1, moving the Bishops to b1/g1, figuring that b1/g1 were exceptionally bad starting positions for Zebras, as they only have 2 moves there, which are easily blocked by center Pawns. But this made it even worse: 70% (in 133 games) for the Knights.

These scores are all above Pawns odds, while the Pawns odds were in fact reversed. So a Zebra is at least a full Pawn weaker than a Knight, something like 180cP. They really have no place on an 8x8 board: almost everywhere the board edge hinders them so much that they have only a few moves, and as a result they are very easily trapped and lost for no compensation at all in end games. Only in the 4 central squares they have their full compliment of 8 moves, but all these moves then go to 'corner' squares (where they only have 2 moves). It might be a useful piece on a bigger board, but on 8x8 it is a disaster.

Queen vs Marshall

I now also implemented the possibility for the exo-piece not to be a pure slider or a pure leaper, but look per direction if it should move as a slider or a leaper. This allows me to test pieces that are compounds of the Knight (a leaper) and B, R or Q (sliders). I started with the Marshall (L, a R+N compound), as I figured that it should have a value about equal to a Queen (a R+B compound), as B and N are about equally valuable.

So I played one side with a Q -> Marshall substitution. The Queen won by 56.1% (296 games). That is exactly half Pawn odds. So the Marshall seems to be 50cP less valuable than a Queen. The Archbishop (A, a B+N compound) is expected to be weaker, as B is much weaker than R (although the color-boundedness does not play a role here). So I am not sure what to substitute it for. Perhaps QR vs AA.

more Bishop vs Knight

I have been running a 500-game match between ones side with B substituted by N, and the other with the Q-side B and N swapping location. This compares two equally-colored Bishops against 2 Knights. The Bishops still won, by 53.7%, one quarter of Pawn odds. This means that (at least for uMax) even an unpaired Bishop is still worth 125cP more than a Knight, weven with all Pawns still on the board. I guess I will have to do all possible combinations of 4 light pieces against 4 other light pieces to really make sense of this B vs N and B-pair stuff.

I will be out of town for a few days, so I will start long runs (1000+ games) of material unbalances that need very precise determination, such as BNNN vs NNNN, to determine the value of a lone Bishop.

GothicChessInventor

Re: Would someone be interested in programming....

Post by GothicChessInventor » Tue Oct 09, 2007 6:58 am

I did some work in this area. You can see this page:

http://www.gothicchess.com/piece_values.html

...which derives values for pieces on rectangular boards of any dimension using the "safe check" probabilities similar to Taylor's work in 1876. For example, the Rook's Safe Check function is:

P(rook) = [(r + f - 6)/(rf - 1)] + 2(r + f)/[(rf)(rf - 1)] where r = the number of ranks and f = the number of files. Since P(rook) = 1/6 for 8x8 chess, you can scale the values for your board dimensions accordingly.

The PDF goes into more detail on 80 square boards and the history of some variants, but the math is quite useful:

http://www.gothicchess.com/80.pdf

I see some of the posters here have already participated in one such discussion in the Rybka forum with myself and Larry kaufman. This is for the benefit of those who have not yet seen this.

User avatar
Ovyron
Posts: 4392
Joined: Tue Jul 03, 2007 2:30 am

Re: Would someone be interested in programming....

Post by Ovyron » Wed Oct 10, 2007 1:42 am

GothicChessInventor wrote:I see some of the posters here have already participated in one such discussion in the Rybka forum with myself and Larry kaufman.
Talking about Larry Kaufman, I should note what I remember reading about what he said on the Bishop Pair bonus.

There's no bonus at all.

The reason the pair of Bishops is stronger is because of lack of redundancy. This redundancy is what happens when you have doubled pawns, the one on the front doesn't let the pawn behind to move, and what happens with pieces that move in the same fashion is that to reach a square obstructed by the other piece, you have to take another route (and you lose tempi).

This never happens to bishops since they never get on the same route. Imagine how stronger could the Knights be if two of them could be on the same square at the same time, they could move around more freely since they don't get in the way of each other.

Now, just take away the ability that they would have of both attacking from the same square (Because 2 bishops cannot attack the same square) and you have what happens to the Bishop pair.

This means that since there's no bonus for the Bishop pair, that there's a penalty for redundancy on the other pieces. One of the Bishops is always redundant with the queen, so the penalty should disappear when the queen is captured.

There's also redundancy for the Rooks, since there are three pieces that have this movement, and that get in the way of each other, once the queen and a rook are captured, the value of the rook left should be higher than what it was when the other queen and rook were around.

For the queen, she would need penalties for redundancy with the rooks and with one of the bishops, so once both rooks, and a bishop are captured, the strength of the queen should be higher (for no redundancy) as long as she works with the bishop as if they were the bishop pair.

Now we're left with knights, there should be a penalty when you have two knights that should disappear once one of them is captured, since you get rid of redundancy. By this theory, knight and bishop should be stronger than pair of knights (because of lack of redundancy, of course, they still get in the way of each other, that's why the effect on the Bishop pair is so evident, because they never obstruct each other).

Larry concluded that for simplicity, you should just give a bonus to the Bishop pair and forget about the penalties to the other pieces, but I've never have seen this theme discussed.
Your beliefs create your reality, so be careful what you wish for.

User avatar
hgm
Posts: 24740
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Would someone be interested in programming....

Post by hgm » Wed Oct 10, 2007 9:56 pm

OK, I modified Winboard to allow display of more different piece types, and it seems to work!

Now all I need is a good font.

Post Reply