Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.

Enter Your Reply

The Comment You're Replying To
Greg Strong wrote on Sun, Sep 18, 2022 05:53 PM UTC in reply to H. G. Muller from 10:09 AM:

A quick overview for those who are interested ... A traditional Chess program has 3 parts:

Move Generation - Given a position, find all legal moves for the side on the move.

Search - Recursively play out moves and counter-moves to find the best sequence (called the PV or Principal Variation.)

Evaluation - At the leaf nodes on the end of each search path, evaluate the position. This function returns a number - the more positive, the better for player 1, the more negative, the better for player 2.

Chess variants. To program a chess variant, you definitely need to change Move Generation. You probably also need to change the Evaluation function. If nothing else, at least give material values to the new piece types. This is the most pronounced of all the evaluation terms. But other things may need to be altered -- for example, pawn structure is important, but should not apply to Berolina Chess.

The Search is typically extended by something called a Quiescent Search. The Evaluation function cannot reliably detect pins, forks, hanging material, etc., which would all affect the evaluation a lot. So, the Evaluation function can only be used on "quiet" ("quiescent") positions. So after the search function searches all legal moves to the desired depth, it then hands off to Quiescent Search, which continues searching recursively, but searches only captures (and, in some programs, checking moves too, but this isn't common in chess variant engines.) This way, all exchanges in progress are played out and hanging pieces are captured before the position is evaluated.

So, with that background on Quiescent Search ... Remember how I said the Search function doesn't need to change for different variants? Well, that's not entirely true. For some variants, like Shogi (or other variants with drops), or double-move variants, there are no "quiet" positions. So traditional Quiescent Search doesn't work. Other approaches must be taken. ChessV doesn't modify the Search function for different variants at all. That's why it doesn't play Shogi. It does play Marseillais Chess, but I haven't modified the Search, I'm basically just sweeping the issues under the rug... I don't know how Zillions-of-Games works for certain, but I believe it has no Quiescent Search function at all. It modifies the Move Generator to support different games, but there is no variant-specific Search or Evaluation.

ChessV handles the Evaluation by building it from various elements that can be turned on, off, or configured. (Pawn structure, king safety, outposts, colorbinding, open file bonuses, castling rights, etc.) You can find out basically everything ChessV does for every game it plays by looking at the Game Reference: http://www.chessv.org/reference/games/


Edit Form
Conduct Guidelines
This is a Chess variants website, not a general forum.
Please limit your comments to Chess variants or the operation of this site.
Keep this website a safe space for Chess variant hobbyists of all stripes.
Because we want people to feel comfortable here no matter what their political or religious beliefs might be, we ask you to avoid discussing politics, religion, or other controversial subjects here. No matter how passionately you feel about any of these subjects, just take it someplace else.
Quick Markdown Guide

By default, new comments may be entered as Markdown, simple markup syntax designed to be readable and not look like markup. Comments stored as Markdown will be converted to HTML by Parsedown before displaying them. This follows the Github Flavored Markdown Spec with support for Markdown Extra. For a good overview of Markdown in general, check out the Markdown Guide. Here is a quick comparison of some commonly used Markdown with the rendered result:

Top level header: <H1>

Block quote

Second paragraph in block quote

First Paragraph of response. Italics, bold, and bold italics.

Second Paragraph after blank line. Here is some HTML code mixed in with the Markdown, and here is the same <U>HTML code</U> enclosed by backticks.

Secondary Header: <H2>

  • Unordered list item
  • Second unordered list item
  • New unordered list
    • Nested list item

Third Level header <H3>

  1. An ordered list item.
  2. A second ordered list item with the same number.
  3. A third ordered list item.
Here is some preformatted text.
  This line begins with some indentation.
    This begins with even more indentation.
And this line has no indentation.

Alt text for a graphic image

A definition list
A list of terms, each with one or more definitions following it.
An HTML construct using the tags <DL>, <DT> and <DD>.
A term
Its definition after a colon.
A second definition.
A third definition.
Another term following a blank line
The definition of that term.