Evaluator
Evaluator for Dice Chess positions combining material balance and king safety.
Prices pieces from MaterialValues — the centipawn scale this shares with PieceSafety's en-prise telemetry — and applies a significant penalty if the side's king is exposed to immediate capture. This helps greedy strategies avoid "material-greedy" blunders that lead to instant loss.
Attributes
- Source
- Evaluator.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Evaluator.type
Members list
Value members
Concrete methods
Evaluates the overall position for the given color, including material and king safety heuristics.
Evaluates the overall position for the given color, including material and king safety heuristics.
Value parameters
- color
-
the perspective from which to evaluate
- state
-
the current dicechess.engine.domain.GameState
Attributes
- Returns
-
signed centipawn score: positive means
coloris ahead, negative means behind - Source
- Evaluator.scala
Evaluates the position with aggressive (king hunt) heuristics for the given color.
Evaluates the position with aggressive (king hunt) heuristics for the given color.
Combines standard evaluation (material + king safety) with:
- Pawn Storm Heuristics: bonus for advanced friendly pawns.
- King Proximity Heuristics: bonus for friendly pieces close to the enemy King.
- King Ring Pressure Heuristics: bonus for friendly pieces attacking squares surrounding the enemy King.
Value parameters
- color
-
player color whose perspective to evaluate
- state
Attributes
- Returns
-
centipawn score favoring active attacks on the enemy King
- Source
- Evaluator.scala
Evaluates king safety for the given color.
Evaluates king safety for the given color.
Returns a negative penalty if the color's king is attacked by an opponent's piece, or 0 if safe.
Value parameters
- color
-
the side whose safety is evaluated
- state
-
the current dicechess.engine.domain.GameState
Attributes
- Returns
-
penalty value (negative or 0)
- Source
- Evaluator.scala
Evaluates the material balance for the given color.
Evaluates the material balance for the given color.
A positive return value indicates that color has more material than the opponent; a negative value indicates a material deficit.
Value parameters
- color
-
the perspective from which to evaluate (typically
state.activeColor) - state
-
the current dicechess.engine.domain.GameState
Attributes
- Returns
-
signed centipawn score: positive means
coloris ahead, negative means behind - Source
- Evaluator.scala
Concrete fields
Penalty applied when a player's king is attacked by an enemy piece, leaving it exposed to immediate capture. Set to 2000 centipawns (worth more than a Queen) to heavily discourage material gains that expose the king.
Penalty applied when a player's king is attacked by an enemy piece, leaving it exposed to immediate capture. Set to 2000 centipawns (worth more than a Queen) to heavily discourage material gains that expose the king.
Attributes
- Source
- Evaluator.scala
Centipawns per friendly attacker of a square in the enemy king's ring, used by evaluateAggressive.
Centipawns per friendly attacker of a square in the enemy king's ring, used by evaluateAggressive.
Named rather than inlined because #513 changed what it multiplies: the count used to come from an early-exiting probe that stopped at the first attacking piece type, so in practice it scaled a number that rarely exceeded one or two. It now scales the true attacker count, which raises the term's weight relative to the pawn-storm and proximity heuristics it was balanced against.
Kept at 25 on evidence, not inertia. A sweep of 6/8/10/12/15/20/25 against the pre-#513 behaviour (2000 games each) put every corrected weight at or above level, 50.6–51.9%, with a mild monotone preference for smaller values; a direct A/B of w10 and w12 against w25 (3000 games) then measured only +0.9pp, inside the ±1.8pp the sample can resolve. Re-scaling on that would be tuning to noise, so the correction ships alone. This is still the knob to turn if the balance is revisited — with a run large enough to separate the candidates.
Attributes
- Source
- Evaluator.scala