mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Merge Joona Kiiski evaluation tweaks
Merge tewaks to many evaluation parameters by Joona Kiiski. After test they seem good! Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
f637ddc1e8
commit
3ed603cd64
4 changed files with 40 additions and 41 deletions
|
@ -58,15 +58,17 @@ namespace {
|
||||||
// weights read from UCI parameters. The purpose is to be able to change
|
// weights read from UCI parameters. The purpose is to be able to change
|
||||||
// the evaluation weights while keeping the default values of the UCI
|
// the evaluation weights while keeping the default values of the UCI
|
||||||
// parameters at 100, which looks prettier.
|
// parameters at 100, which looks prettier.
|
||||||
const int WeightMobilityMidgameInternal = 0x100;
|
//
|
||||||
const int WeightMobilityEndgameInternal = 0x100;
|
// Values modified by Joona Kiiski
|
||||||
const int WeightPawnStructureMidgameInternal = 0x100;
|
const int WeightMobilityMidgameInternal = 0x0FA;
|
||||||
const int WeightPawnStructureEndgameInternal = 0x100;
|
const int WeightMobilityEndgameInternal = 0x10A;
|
||||||
const int WeightPassedPawnsMidgameInternal = 0x100;
|
const int WeightPawnStructureMidgameInternal = 0x0EC;
|
||||||
const int WeightPassedPawnsEndgameInternal = 0x100;
|
const int WeightPawnStructureEndgameInternal = 0x0CD;
|
||||||
const int WeightKingSafetyInternal = 0x110;
|
const int WeightPassedPawnsMidgameInternal = 0x108;
|
||||||
const int WeightKingOppSafetyInternal = 0x110;
|
const int WeightPassedPawnsEndgameInternal = 0x109;
|
||||||
const int WeightSpaceInternal = 0x30;
|
const int WeightKingSafetyInternal = 0x0F7;
|
||||||
|
const int WeightKingOppSafetyInternal = 0x101;
|
||||||
|
const int WeightSpaceInternal = 0x02F;
|
||||||
|
|
||||||
// Visually better to define tables constants
|
// Visually better to define tables constants
|
||||||
typedef Value V;
|
typedef Value V;
|
||||||
|
@ -167,18 +169,19 @@ namespace {
|
||||||
V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) // 8
|
V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) // 8
|
||||||
};
|
};
|
||||||
|
|
||||||
// Bonus for unstoppable passed pawns:
|
// Bonus for unstoppable passed pawns
|
||||||
const Value UnstoppablePawnValue = Value(0x500);
|
const Value UnstoppablePawnValue = Value(0x500);
|
||||||
|
|
||||||
// Rooks and queens on the 7th rank:
|
// Rooks and queens on the 7th rank
|
||||||
const Value MidgameRookOn7thBonus = Value(50);
|
const Value MidgameRookOn7thBonus = Value(47);
|
||||||
const Value EndgameRookOn7thBonus = Value(100);
|
const Value EndgameRookOn7thBonus = Value(98);
|
||||||
const Value MidgameQueenOn7thBonus = Value(25);
|
const Value MidgameQueenOn7thBonus = Value(27);
|
||||||
const Value EndgameQueenOn7thBonus = Value(50);
|
const Value EndgameQueenOn7thBonus = Value(54);
|
||||||
|
|
||||||
// Rooks on open files:
|
|
||||||
const Value RookOpenFileBonus = Value(40);
|
// Rooks on open files
|
||||||
const Value RookHalfOpenFileBonus = Value(20);
|
const Value RookOpenFileBonus = Value(43);
|
||||||
|
const Value RookHalfOpenFileBonus = Value(19);
|
||||||
|
|
||||||
// Penalty for rooks trapped inside a friendly king which has lost the
|
// Penalty for rooks trapped inside a friendly king which has lost the
|
||||||
// right to castle:
|
// right to castle:
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const Value BishopPairMidgameBonus = Value(100);
|
const Value BishopPairMidgameBonus = Value(109);
|
||||||
const Value BishopPairEndgameBonus = Value(100);
|
const Value BishopPairEndgameBonus = Value(97);
|
||||||
|
|
||||||
Key KNNKMaterialKey, KKNNMaterialKey;
|
Key KNNKMaterialKey, KKNNMaterialKey;
|
||||||
|
|
||||||
|
|
|
@ -650,15 +650,9 @@ inline Value Position::non_pawn_material(Color c) const {
|
||||||
|
|
||||||
inline Phase Position::game_phase() const {
|
inline Phase Position::game_phase() const {
|
||||||
|
|
||||||
// The purpose of the Value(325) terms below is to make sure the difference
|
// Values modified by Joona Kiiski
|
||||||
// between MidgameLimit and EndgameLimit is a power of 2, which should make
|
static const Value MidgameLimit = Value(15713);
|
||||||
// the division at the end of the function a bit faster.
|
static const Value EndgameLimit = Value(4428);
|
||||||
static const Value MidgameLimit = 2 * QueenValueMidgame
|
|
||||||
+ 2 * RookValueMidgame
|
|
||||||
+ 6 * BishopValueMidgame
|
|
||||||
+ Value(325);
|
|
||||||
|
|
||||||
static const Value EndgameLimit = 4 * RookValueMidgame - Value(325);
|
|
||||||
|
|
||||||
Value npm = non_pawn_material(WHITE) + non_pawn_material(BLACK);
|
Value npm = non_pawn_material(WHITE) + non_pawn_material(BLACK);
|
||||||
|
|
||||||
|
|
26
src/value.h
26
src/value.h
|
@ -58,17 +58,19 @@ enum Value {
|
||||||
/// Important: If the material values are changed, one must also
|
/// Important: If the material values are changed, one must also
|
||||||
/// adjust the piece square tables, and the method game_phase() in the
|
/// adjust the piece square tables, and the method game_phase() in the
|
||||||
/// Position class!
|
/// Position class!
|
||||||
|
///
|
||||||
|
/// Values modified by Joona Kiiski
|
||||||
|
|
||||||
const Value PawnValueMidgame = Value(0xCC);
|
const Value PawnValueMidgame = Value(0x0CC);
|
||||||
const Value PawnValueEndgame = Value(0x100);
|
const Value PawnValueEndgame = Value(0x101);
|
||||||
const Value KnightValueMidgame = Value(0x340);
|
const Value KnightValueMidgame = Value(0x332);
|
||||||
const Value KnightValueEndgame = Value(0x340);
|
const Value KnightValueEndgame = Value(0x34E);
|
||||||
const Value BishopValueMidgame = Value(0x340);
|
const Value BishopValueMidgame = Value(0x345);
|
||||||
const Value BishopValueEndgame = Value(0x340);
|
const Value BishopValueEndgame = Value(0x356);
|
||||||
const Value RookValueMidgame = Value(0x505);
|
const Value RookValueMidgame = Value(0x4F8);
|
||||||
const Value RookValueEndgame = Value(0x505);
|
const Value RookValueEndgame = Value(0x500);
|
||||||
const Value QueenValueMidgame = Value(0xA00);
|
const Value QueenValueMidgame = Value(0x9D5);
|
||||||
const Value QueenValueEndgame = Value(0xA00);
|
const Value QueenValueEndgame = Value(0x9FB);
|
||||||
|
|
||||||
const Value PieceValueMidgame[17] = {
|
const Value PieceValueMidgame[17] = {
|
||||||
Value(0),
|
Value(0),
|
||||||
|
@ -92,8 +94,8 @@ const Value PieceValueEndgame[17] = {
|
||||||
|
|
||||||
/// Bonus for having the side to move
|
/// Bonus for having the side to move
|
||||||
|
|
||||||
const Value TempoValueMidgame = Value(50);
|
const Value TempoValueMidgame = Value(48);
|
||||||
const Value TempoValueEndgame = Value(20);
|
const Value TempoValueEndgame = Value(21);
|
||||||
|
|
||||||
|
|
||||||
////
|
////
|
||||||
|
|
Loading…
Add table
Reference in a new issue