mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Refresh comments in evaluate.cpp
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
6125966da0
commit
74033b004e
1 changed files with 30 additions and 28 deletions
|
@ -61,8 +61,9 @@ namespace {
|
||||||
S(248, 271), S(233, 201), S(252, 259), S(46, 0), S(247, 0), S(259, 0)
|
S(248, 271), S(233, 201), S(252, 259), S(46, 0), S(247, 0), S(259, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Pieces mobility bonus in middle game and endgame, indexed by piece type
|
// MobilityBonus[PieceType][attacked] contains mobility bonuses for middle and
|
||||||
// and number of attacked squares not occupied by friendly pieces.
|
// end game, indexed by piece type and number of attacked squares not occupied
|
||||||
|
// by friendly pieces.
|
||||||
const Score MobilityBonus[][32] = {
|
const Score MobilityBonus[][32] = {
|
||||||
{}, {},
|
{}, {},
|
||||||
{ S(-38,-33), S(-25,-23), S(-12,-13), S( 0, -3), S(12, 7), S(25, 17), // Knights
|
{ S(-38,-33), S(-25,-23), S(-12,-13), S( 0, -3), S(12, 7), S(25, 17), // Knights
|
||||||
|
@ -81,8 +82,8 @@ namespace {
|
||||||
S( 20, 35), S( 20, 35) }
|
S( 20, 35), S( 20, 35) }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Outpost bonuses for knights and bishops, indexed by square (from white's
|
// OutpostBonus[PieceType][Square] contains outpost bonuses of knights and
|
||||||
// point of view).
|
// bishops, indexed by piece type and square (from white's point of view).
|
||||||
const Value OutpostBonus[][64] = {
|
const Value OutpostBonus[][64] = {
|
||||||
{
|
{
|
||||||
// A B C D E F G H
|
// A B C D E F G H
|
||||||
|
@ -105,9 +106,9 @@ namespace {
|
||||||
V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }
|
V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }
|
||||||
};
|
};
|
||||||
|
|
||||||
// ThreatBonus[attacking][attacked] contains bonus according to which
|
// ThreatBonus[attacking][attacked] contains threat bonuses according to
|
||||||
// piece type attacks which one.
|
// which piece type attacks which one.
|
||||||
const Score ThreatBonus[8][8] = {
|
const Score ThreatBonus[][8] = {
|
||||||
{}, {},
|
{}, {},
|
||||||
{ S(0, 0), S( 7, 39), S( 0, 0), S(24, 49), S(41,100), S(41,100) }, // KNIGHT
|
{ S(0, 0), S( 7, 39), S( 0, 0), S(24, 49), S(41,100), S(41,100) }, // KNIGHT
|
||||||
{ S(0, 0), S( 7, 39), S(24, 49), S( 0, 0), S(41,100), S(41,100) }, // BISHOP
|
{ S(0, 0), S( 7, 39), S(24, 49), S( 0, 0), S(41,100), S(41,100) }, // BISHOP
|
||||||
|
@ -115,9 +116,9 @@ namespace {
|
||||||
{ S(0, 0), S(15, 39), S(15, 39), S(15, 39), S(15, 39), S( 0, 0) } // QUEEN
|
{ S(0, 0), S(15, 39), S(15, 39), S(15, 39), S(15, 39), S( 0, 0) } // QUEEN
|
||||||
};
|
};
|
||||||
|
|
||||||
// ThreatedByPawnPenalty[] contains a penalty according to which piece
|
// ThreatedByPawnPenalty[PieceType] contains a penalty according to which
|
||||||
// type is attacked by an enemy pawn.
|
// piece type is attacked by an enemy pawn.
|
||||||
const Score ThreatedByPawnPenalty[8] = {
|
const Score ThreatedByPawnPenalty[] = {
|
||||||
S(0, 0), S(0, 0), S(56, 70), S(56, 70), S(76, 99), S(86, 118)
|
S(0, 0), S(0, 0), S(56, 70), S(56, 70), S(76, 99), S(86, 118)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ namespace {
|
||||||
// right to castle.
|
// right to castle.
|
||||||
const Value TrappedRookPenalty = Value(180);
|
const Value TrappedRookPenalty = Value(180);
|
||||||
|
|
||||||
// The SpaceMask[color] contains the area of the board which is considered
|
// The SpaceMask[Color] contains the area of the board which is considered
|
||||||
// by the space evaluation. In the middle game, each side is given a bonus
|
// by the space evaluation. In the middle game, each side is given a bonus
|
||||||
// based on how many squares inside this area are safe and available for
|
// based on how many squares inside this area are safe and available for
|
||||||
// friendly minor pieces.
|
// friendly minor pieces.
|
||||||
|
@ -148,13 +149,13 @@ namespace {
|
||||||
(1ULL << SQ_C5) | (1ULL << SQ_D5) | (1ULL << SQ_E5) | (1ULL << SQ_F5)
|
(1ULL << SQ_C5) | (1ULL << SQ_D5) | (1ULL << SQ_E5) | (1ULL << SQ_F5)
|
||||||
};
|
};
|
||||||
|
|
||||||
/// King danger constants and variables. The king danger scores are taken
|
// King danger constants and variables. The king danger scores are taken
|
||||||
/// from the KingDangerTable[]. Various little "meta-bonuses" measuring
|
// from the KingDangerTable[]. Various little "meta-bonuses" measuring
|
||||||
/// the strength of the enemy attack are added up into an integer, which
|
// the strength of the enemy attack are added up into an integer, which
|
||||||
/// is used as an index to KingDangerTable[].
|
// is used as an index to KingDangerTable[].
|
||||||
|
//
|
||||||
// KingAttackWeights[] contains king attack weights by piece type
|
// KingAttackWeights[PieceType] contains king attack weights by piece type
|
||||||
const int KingAttackWeights[8] = { 0, 0, 2, 2, 3, 5 };
|
const int KingAttackWeights[] = { 0, 0, 2, 2, 3, 5 };
|
||||||
|
|
||||||
// Bonuses for enemy's safe checks
|
// Bonuses for enemy's safe checks
|
||||||
const int QueenContactCheckBonus = 3;
|
const int QueenContactCheckBonus = 3;
|
||||||
|
@ -163,9 +164,9 @@ namespace {
|
||||||
const int BishopCheckBonus = 1;
|
const int BishopCheckBonus = 1;
|
||||||
const int KnightCheckBonus = 1;
|
const int KnightCheckBonus = 1;
|
||||||
|
|
||||||
// InitKingDanger[] contains bonuses based on the position of the defending
|
// InitKingDanger[Square] contains penalties based on the position of the
|
||||||
// king.
|
// defending king, indexed by king's square (from white's point of view).
|
||||||
const int InitKingDanger[64] = {
|
const int InitKingDanger[] = {
|
||||||
2, 0, 2, 5, 5, 2, 0, 2,
|
2, 0, 2, 5, 5, 2, 0, 2,
|
||||||
2, 2, 4, 8, 8, 4, 2, 2,
|
2, 2, 4, 8, 8, 4, 2, 2,
|
||||||
7, 10, 12, 12, 12, 12, 10, 7,
|
7, 10, 12, 12, 12, 12, 10, 7,
|
||||||
|
@ -176,7 +177,8 @@ namespace {
|
||||||
15, 15, 15, 15, 15, 15, 15, 15
|
15, 15, 15, 15, 15, 15, 15, 15
|
||||||
};
|
};
|
||||||
|
|
||||||
// KingDangerTable[color][] contains the actual king danger weighted scores
|
// KingDangerTable[Color][attackUnits] contains the actual king danger
|
||||||
|
// weighted scores, indexed by color and by a calculated integer number.
|
||||||
Score KingDangerTable[2][128];
|
Score KingDangerTable[2][128];
|
||||||
|
|
||||||
// Pawn and material hash tables, indexed by the current thread id.
|
// Pawn and material hash tables, indexed by the current thread id.
|
||||||
|
|
Loading…
Add table
Reference in a new issue