Arimaa Forum (http://arimaa.com/arimaa/forum/cgi/YaBB.cgi)
Arimaa >> Bot Development >> DAPE - Depreciated Arimaa Piece Evaluator
(Message started by: 99of9 on Nov 9th, 2006, 9:24pm)

Title: DAPE - Depreciated Arimaa Piece Evaluator
Post by 99of9 on Nov 9th, 2006, 9:24pm
Announcing the latest material evaluation function.

Basically each piece is valued according to:
* how many enemy pieces are stronger than it ("above"), and
* how many enemy pieces are equal in strength ("equal").

The score for each piece is simply:
score = A/(S+E*equal+above);

Where A, S, and E are all constants.  E must be in the interval (0,1), A and S should both be positive.

Suggested starting values are given below.

A fairly ad-hoc correction for what happens when you run short of rabbits is then added, but this could be further refined.

Toby


Code:
double DAPE(position *p) {
 int typ, c, e;
 
 double Amplitude   = 18.0;
 double Shift       = 0.25;
 double Equal_mult  = 0.3;

 /* count the number of colour c pieces that are above or equal this value */
 int above[2];
 int equal[2];
 double score[2];

 above[0] = 0;
 above[1] = 0;
 
 equal[0] = 0;
 equal[1] = 0;
 
 score[0] = 0.0;
 score[1] = 0.0;

 for (typ=6; typ>=1; typ--) {
     for (c=0; c<2; c++) {
       above[c] += equal[c];
       equal[c] = bc2(p->bd[c][typ]);
     }
     
     for (c=0; c<2; c++) {
       e = c ^ 1;
       score[c] += equal[c]*Amplitude/(Shift+Equal_mult*equal[e]+above[e]);
     }
 }

 /* now special penalties if the number of rabbits gets too low */
 score[0] -= 40.0*pow(0.6,equal[0]);
 score[1] -= 40.0*pow(0.6,equal[1]);
 
 /*  DRAW ANALYSIS SHOULD BE INCLUDED IN FINAL PROGRAM */      

 return (score[1]-score[0]);

}

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by Fritzlein on Nov 9th, 2006, 10:35pm
So what are some consequences?  Does DAPE like M or HD?  D or RR?  Where does it work better than FAME?  (Not that FAME is hard to beat, but I'm curious about the specifics...)

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by 99of9 on Nov 9th, 2006, 11:03pm
Here's one of Janzert's funky calculators for it:
http://members.westnet.com.au/doctorhudson/arimaa/dape.html
(I hope there's no bugs, I wrote it quickly, and I don't actually know javascript)

I can't remember why I thought it was better!  I invented it a couple of months ago, and tried some specific predictions, but you'll have to make that judgement for yourself.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by 99of9 on Nov 9th, 2006, 11:28pm
Well, I've already found one bug.

If you've already killed an M and given away your HD (which the current constants of DAPE thinks is favourable), DAPE then recommends:

1) Trade elephants (correct)
2) Trade horses (??)
3) Do not trade dogs (??)
4) Trade rabbits (wrong)

The problem is, I can't easily fix #4 just by changing constants...

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by Fritzlein on Nov 10th, 2006, 8:40am

on 11/09/06 at 23:28:49, 99of9 wrote:
If you've already killed an M and given away your HD (which the current constants of DAPE thinks is favourable), DAPE then recommends:

1) Trade elephants (correct)
2) Trade horses (??)
3) Do not trade dogs (??)
4) Trade rabbits (wrong)

I haven't played a unbalanced M for HD (or HC) game in a while.  Perhaps shifting strategies have made them less common.  But even so I'm quite confident that when you have M for HD, you do not want to trade horses.

I just checked out the cool DAPE calculator, and DAPE agrees with me.  In fact, it thinks trading horses there is even more catastrophic for the side with camel than I think it is.  I think you must have made a mistake in reporting that one.

I agree with you that the camel side doesn't want to trade rabbits (and thus disagree with DAPE), but I don't feel strongly about that.  Rabbit trades are still pretty much equal in that situation.  FAME has a teeny tiny bias against trading rabbits, and I think that's both the right direction and the right magnitude.

It's interesting that DAPE clearly prefers a dog to two initial rabbits and a horse to three initial rabbits.  Thus it values pieces more relative to rabbits than FAME, at least in the early going.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by 99of9 on Nov 10th, 2006, 4:28pm

on 11/10/06 at 08:40:22, Fritzlein wrote:
I just checked out the cool DAPE calculator, and DAPE agrees with me.  In fact, it thinks trading horses there is even more catastrophic for the side with camel than I think it is.  I think you must have made a mistake in reporting that one.

Oh, good, you're right.  Sorry about that.


Quote:
It's interesting that DAPE clearly prefers a dog to two initial rabbits and a horse to three initial rabbits.  Thus it values pieces more relative to rabbits than FAME, at least in the early going.

In my judgement DAPE is correct on both of these, but I don't feel so strongly to call that an error by FAME.  DAPE knows that these trades get less valuable when material goes off the board, and soon discourages them.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by Janzert on Nov 13th, 2006, 3:08pm
The FAME calculator (http://arimaa.janzert.com/fame.html) now does both FAME and DAPE and needs a name change, probably AMES calculator. Hopefully it will grow IdahoEV's naive evaluator soon as well.

The one discrepancy that stood out to me while working on it was H for CC, FAME slightly prefers losing the horse while DAPE would rather lose the cats.

Janzert

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by Fritzlein on Nov 13th, 2006, 8:40pm
Thanks, Janzet.  I'm going to have fun with that.  Since everyone found a bunch of flaws in FAME after it came out, I especially want to give DAPE a rude reception.  Let me point out that in ERR vs dccrr, Gold is clearly losing, but DAPE says Gold is clearly winning.

It's funny that FAME thinks a free cat is worth 1.49 and a free horse is worth 3.12 (more than 2 * 1.49) but nevertheless slightly prefers two free cats to a horse.  I might slightly prefer the horse myself, but IdahoEv's research currently seems to be favoring small pieces, so I may be further wrong than FAME.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by 99of9 on Nov 13th, 2006, 11:00pm
Nice job janzert.

In response to Fritz's position, and the general trading down failures, I've updated the formula on my version of the calculator:

http://members.westnet.com.au/doctorhudson/arimaa/dape.html

It now includes a term similar to the low-rabbit penalty, which is basically a low-piece penalty.  I've also adjusted the coefficients a bit to accommodate the change.

Would you mind including this alteration for me Janzert?  Sorry, it's a bit of an iterative process.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by Janzert on Nov 14th, 2006, 2:59am
No problem, I rather expect it to change for a bit yet. Now updated. Also updated the constant to normalize the initial rabbit capture.

Also when I added DAPE in I got rid of the raw score display altogether since comparing them directly doesn't really make any sense.

Janzert

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by 99of9 on Nov 14th, 2006, 4:07am
Thanks Janzert.

The biggest disagreements I've found so far are:
                                                                         
dapefame correct
ERREMR ?
EMHDDCC8REMHHDDC6R ?
EHDDCC8R EMHHDDCC dape
EMHHC8R EHHDDCC8R fame?
EMHHCC7R EHHDDCC8R ?
EHHDDCxR EMDDCCxR ?
EHC4R EMD3R ?
     
     

I'll add more to the list when people mention them.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by mattj256 on May 3rd, 2013, 3:41am
I was looking online at the piece evaluator (http://arimaa.janzert.com/eval.html).  Did you know that for R vs EMHHDDCC most of the material evaluators say that Silver is winning even though Silver has no rabbits left?  Is there a deeper issue here or is it strictly a theoretical concern?  It's not like the situation I described is going to happen in a real game...

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by supersamu on May 4th, 2013, 3:38am
You can´t trust material evaluators when 8 rabbits are of the board.
There is no "deeper issue" there. What also is weird is this:

- when gold has a handicap of 8 rabbits, and silver has only one piece left, a rabbit, FAME thinks gold is ahead by 22.51.

- when gold has a handicap of 8 rabbits, and silver has no pieces left, FAME thinks the teams are even.

So FAME would recommend for silver to sacrifice his last piece in the situation descibed above.
But as I said, these are issues that only come up when one team has no rabbits on the board.
There was a rulechange that made the player with no rabbits left immediately lose the game.
But this rulechange happened after FAME and DAPE were developed.
Conclusion: Material Evaluators use a formula to evaluate the position and when there are 0 rabbits left, the formula doesn´t work in the intended way.

Title: Re: DAPE - Depreciated Arimaa Piece Evaluator
Post by mattj256 on May 4th, 2013, 4:04am
Cool thanks.



Arimaa Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.