Mate Score

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Mate Score

Post by tomitank »

Hi!

Which one is better? (Why?)
I'm using Fail-Soft, Aspiration Windows (50), PVS, NMP, Hash Table, LMR, Razoring, Futility Pruning, LMP.

Vice 1.0:

Code: Select all

#define MAXDEPTH 64
#define INFINITE 30000
#define ISMATE (INFINITE - MAXDEPTH)
Sungours 1.4:

Code: Select all

#define MAX_PLY         64
#define INF             32767
#define MATE            32000
#define MAX_EVAL        2999
Tamas
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Mate Score

Post by hgm »

The first seems wrong: mate distance can easily be larger than MAXPLY (assuming that the latter is the ultimate limit t the search depth). Engines with TT can see mates beyond the horizon through grafting.
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: Mate Score

Post by tomitank »

For the first one:

King value: 50000

Save tt:

Code: Select all

if (score > ISMATE) {
	score += boardPly;
&#125; else if &#40;score < -ISMATE&#41; &#123;
	score -= boardPly;
&#125;
Score from tt:

Code: Select all

				
if &#40;value > ISMATE&#41; &#123;
	value -= boardPly;
&#125; else if &#40;value < -ISMATE&#41; &#123;
	value += boardPly;
&#125;
Video:
https://youtu.be/clLaVOnvUvA?t=2m17s

But Vice use fail hard.

With fail-soft, is can it still wrong?

Tamas
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Mate Score

Post by Nordlandia »

How does excessive king value influence overall gameplay?

For example King value: 5,000,000,000,000
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: Mate Score

Post by tomitank »

I do not know.

Maybe, if there is no king for some mistake?

This is all misty for me.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Mate Score

Post by hgm »

tomitank wrote: But Vice use fail hard.

With fail-soft, is can it still wrong?
Yes, it is still wrong. The necessary adjustment for mate scores would not take place for mate scores between -ISMATE and ISMATE.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Mate Score

Post by hgm »

Nordlandia wrote:How does excessive king value influence overall gameplay?

For example King value: 5,000,000,000,000
King value should not affect game play. Fairy-Max uses king value = -1, and in search recognizes victims with negative value as royal, terminating the branch with +INF score if the value is -1.
User avatar
Nordlandia
Posts: 2821
Joined: Fri Sep 25, 2015 9:38 pm
Location: Sortland, Norway

Re: Mate Score

Post by Nordlandia »

hgm wrote:
Nordlandia wrote:How does excessive king value influence overall gameplay?

For example King value: 5,000,000,000,000
King value should not affect game play. Fairy-Max uses king value = -1, and in search recognizes victims with negative value as royal, terminating the branch with +INF score if the value is -1.
Some earlier computer chess programs aligned the king an arbitrary large value (1,000,000,000 points) As a result the King remained on the first rank throughout the entire game :D

That number indicate king safetey is paramount, so the King shouldn't be centralized and rule out the possibility to get mated.

In a nutshell - in a regular pawn ending, the king messed around in the corner instead of heading to the center of the board.

Those days are over.
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Mate Score

Post by hgm »

The value of a piece should not determine where it prefers to go. In my first chess program I assumed it would be sufficient to give the king a very high value to keep it out of check. Instead it just started to reply to checks with counter-checks, in an attempt to trade kings. You really have to program that there is no opportunity for retaliation after you lost your king.
JVMerlino
Posts: 1357
Joined: Wed Mar 08, 2006 10:15 pm
Location: San Francisco, California

Re: Mate Score

Post by JVMerlino »

hgm wrote:
Nordlandia wrote:How does excessive king value influence overall gameplay?

For example King value: 5,000,000,000,000
King value should not affect game play. Fairy-Max uses king value = -1, and in search recognizes victims with negative value as royal, terminating the branch with +INF score if the value is -1.
If you allow the King to capture a piece in SEE, then isn't a very high King value necessary?