Variant configuration - fairy-stockfish/Fairy-Stockfish GitHub Wiki

User-defined variants can be added via an INI-style configuration file and be loaded at runtime without needing to recompile the program. See the variants.ini in the repository for documentation and examples of variant configuration.

Loading variant configuration

You can either provide the configuration file at startup, e.g., stockfish.exe load variants.ini/./stockfish load variants.ini (Windows/Unix), or you can load it at runtime by setting the VariantPath UCI option to the path of your configuration file. For usage in GUIs the former option is recommended, because variants need to be known to the GUI at engine startup.

Validation

In order to validate your variants.ini, run stockfish.exe check variants.ini/./stockfish check variants.ini on the command line, which should point you to potentially problematic parts of your configuration. Alternatively you can load your variant configuration file at https://fairyground.vercel.app/ or https://fairy-stockfish-nnue-wasm.vercel.app/ in order to run the validation directly in your browser.

Graphical user interface

If you want to test your variant in a GUI, you can use https://fairyground.vercel.app/ to test directly in the browser without the need for any downloads. For some variants Winboard might also work, see https://github.com/fairy-stockfish/Fairy-Stockfish/wiki/User-defined-variants-in-WinBoard.

Variant configuration collection

This is a collection of user-defined variant configurations that can be copied into a variants.ini. See the default variants.ini for more examples. Feel free to add sections for variants you configured in order to share them with other users (just click on edit at the top).

Pawn One Square Chess

# Pawn One Square Chess
# Pawns can only move one square forwards at a time. As a result, there is no en passant either. 
# This variant appeared in the AlphaZero paper 'Assessing Game Balance with AlphaZero: Exploring Alternative Rule Sets in Chess' at https://arxiv.org/abs/2009.04374
[pawnonesquare:chess]
doubleStep = false

Crowded Xiangqi

https://yawnoc.github.io/crowded-xiangqi

# Chinese Chess on half the board (5 × 9 intersections)
# Pawns (soldiers) are set to display as archbishops (via pieceToCharTable)
# so that WinBoard/XBoard won't disappear them on the last rank.
# https://github.com/fairy-stockfish/Fairy-Stockfish/issues/180#issuecomment-692910150
[crowdedxiangqi:xiangqi]
pieceToCharTable = .N.R.ABP.K.C...........n.r.abp.k.c..........
maxRank = 5
startFen = rnbakabnr/pcp1p1pcp/9/PCP1P1PCP/RNBAKABNR w - - 0 1
mobilityRegionBlackKing = d3 e3 f3 d4 e4 f4 d5 e5 f5
mobilityRegionBlackFers = d3 e3 f3 d4 e4 f4 d5 e5 f5
mobilityRegionBlackElephant = *1 *2 *3 *4 *5
soldierPromotionRank = 4

Dragonfly chess

https://en.wikipedia.org/wiki/Dragonfly_(chess_variant)

# Two rules have been removed from the original definition (Removing captured pawns and special pawn promotion)
# Credits to Procyon for the definition
[dragonfly:chess]
maxFile = 7
maxRank = 7
pocketSize = 7
castlingKingsideFile = f
castlingQueensideFile = b
pieceDrops = true
capturesToHand = true
promotionRank = 7
promotionPieceTypes = nbr
doubleStep = false
dropNoDoubled = p
dropNoDoubledCount = 0
startFen = rbbknnr/ppppppp/7/7/7/PPPPPPP/RBBKNNR[] w - - 0 1

Kamikaze Rooks

# The objective of the game is to lose both rooks
# Credits to Procyon for the definition
[kamikazerooks:chess]
extinctionValue = win
extinctionPieceTypes = r

Racing Chess

# Win by campmate. No checks allowed
# Credits to Procyon for the definition
[racingchess:chess]
flagPiece = k
whiteFlag = *8
blackFlag = *1
flagMove = true
checking = false

Double Army

# Same as chess, but both armies are doubled. The second King is a Commoner.
[doublearmy:chess]
pieceToCharTable = PNBRQ.....C...........Kpnbrq.....c...........k
commoner = c
startFen = rnbqkbnr/pppppppp/rnbqcbnr/pppppppp/PPPPPPPP/RNBQCBNR/PPPPPPPP/RNBQKBNR w KQkq - 0 1

Capture Chess

# Same as chess, but captures are mandatory.
[capture:chess]
mustCapture = true

Goro Goro Plus

https://www.pychess.org/variants/gorogoroplus

[gorogoroplus:gorogoro]
startFen = sgkgs/5/1ppp1/1PPP1/5/SGKGS[LNln] w 0 1
lance = l
shogiKnight = n
promotedPieceType = l:g n:g

Mounted

# Credits to Procyon for the definition
[mounted]
maxRank = 7
maxFile = 7
pieceDrops = true
capturesToHand = true
stalemateValue = loss
nFoldValue = loss
extinctionValue = loss
extinctionPseudoRoyal = true
extinctionPieceTypes = k
flagPiece = k
whiteFlag = *7
blackFlag = *1
centaur = k
bishop = b
rook = r
cannon = c
customPiece1 = a:mBcpB 
customPiece2 = s:FsfW
startFen = 1cbkra1/2s1s2/7/7/7/2S1S2/1CBKRA1 w - - 0 1

Checkmateless Chess

# Checks and checkmates can't be played. You have to get your enemy into a position where they are forced to make an illegal move (moving your king into check, checking, and checkmating your enemy are included as illegal moves) to win the variant.
[checkmateless:chess]
checking = false
stalemateValue = loss

Massacre Chess

https://brainking.com/en/GameRules?tp=128

# Credit to Mtaktikos for the definition
[massacre:giveaway]
commoner = -
queen = -
rook = -
bishop = -
knight = -
pawn = -
customPiece1 = q:cQ
customPiece2 = b:cB
customPiece3 = n:cN
customPiece4 = r:cR
startFen = rBbnbqNn/bQrnQRRr/rrqbNqQb/bBNqbNBN/bNRrrrBQ/QRQqRnNB/qBRnnqNQ/BBQnqnRR w - - 0 1
stalemateValue = loss
extinctionValue = loss
extinctionPieceTypes = * 

Sixth Rank Chess

# The objective of the game is to get any of the pawns to the sixth rank (third for black).
[sixthrank:chess]
flagPiece = p
whiteFlag = *6
blackFlag = *3

Crossing

# Similar to KOTH, but the objective is to get the King to the 5th rank (4th if black)
[crossing:kingofthehill]
whiteFlag = *5
blackFlag = *4

Two Kings 2

# Slightly different implementation of Two Kings chess, formerly playable in Pychess discord server.
[twokings2:chess]
commoner = k
extinctionValue = loss
extinctionPseudoRoyal = true
extinctionPieceTypes = k
extinctionPieceCount = 1
startFen = rnbkkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBKKBNR w - - 0 1

Capture All

https://greenchess.net/rules.php?v=capture-all

# Capture-all Chess
[captureall:extinction]
extinctionPieceTypes = *

6x6 Breakthrough

# 6x6 breakthrough
[breakthrough6:breakthrough]
maxFile = 6
maxRank = 6
startFen = pppppp/pppppp/6/6/PPPPPP/PPPPPP w 0 1
whiteFlag = *6
blackFlag = *1

7x7 Breakthrough

# 7x7 breakthrough
[breakthrough7:breakthrough]
maxFile = 7
maxRank = 7
startFen = ppppppp/ppppppp/7/7/7/PPPPPPP/PPPPPPP w 0 1
whiteFlag = *7
blackFlag = *1

Backrank

# The objective of the game is to reach the last rank with any of your pieces
# Credits to Procyon for the definition
[backrank:chess]
king = -
commoner = k
castlingKingPiece = k
extinctionValue = loss
extinctionPieceTypes = k
extinctionPseudoRoyal = true
flagPiece = k
promotionPieceTypes = -
promotedPieceType = q:k r:k b:k n:k p:k
mandatoryPiecePromotion = true
whiteFlag = *8
blackFlag = *1

Chess vs Hoppel Poppel

# Asymmetrical game combining Chess and Hoppel Poppel
# Credits to Procyon for the definition
[chessvshp:chess]
soldier = s
king = k
bishop = b
knight = n
rook = r
promotionPieceTypes = -
knibis = i
biskni = j
promotionPieceTypes = nbrqij
startFen = rijqkjir/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

Misere Chess

# Chess, but you win if you get yourself checkmated
[Misere:chess]
checkmateValue = win

Stardust

# Credits to Couch Tomato for the definition
[stardust]
maxRank = 10
maxFile = 9
fers = t
immobile = p
gold = c
commoner = v
customPiece1 = x:mRcW
customPiece2 = d:FvW
customPiece3 = r:mQ2
customPiece4 = y:mRcD
customPiece5 = b:mFcA
startFen = 3tvt3/1p5p1/3XRX3/1d5d1/9/1p1t1t1p1/4d4/9/9/4C4[XXXXXYYttttttbbbd] w - - 0 1
pieceDrops = true
whiteDropRegion = *1 *2 *3 d4 e4 f4 d5 e5 f5 d6 e6 f6 *7 d8 e8 f8 d9 e9 f9 d10 e10 f10
blackDropRegion = a4 b4 c4 g4 h4 i4 a5 b5 c5 g5 h5 i5 a6 b6 c6 g6 h6 i6 a8 b8 c8 g8 h8 i8 a9 b9 c9 g9 h9 i9 a10 b10 c10 g10 h10 i10
castling = false
extinctionValue = loss
extinctionPieceTypes = rp
extinctionPseudoRoyal = true
flagPiece = r
whiteFlag = e2
nFoldRule = 3
nFoldValue = draw
stalemateValue = loss

Mini HexChess

https://www.chessvariants.com/hexagonal.dir/minihex.html
(shows versatility of variant definitions)
(unfortunately incompatible with XBoard, most likely incompatible with WinBoard)
(thank you to Kang nasgor#7023 on Discord for the Betza notation for the Rook, Knight, Bishop, and King)

# isomorphic to https://www.chessvariants.com/hexagonal.dir/minihex.html
[minihexchess]
maxRank = 7
maxFile = 7
customPiece1 = r:RfrblB
customPiece2 = n:lfrbbrflNrflbfrblCrflbfrblZ
customPiece3 = b:flbrBrflbfrblNN
king = k:WFrflbfrblN
customPiece4 = p:mfrFcfrNcrfN
startFen = 4prb/4pkn/4ppp/7/PPP4/NKP4/BRP4 w
mobilityRegionWhiteCustomPiece1 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionWhiteCustomPiece2 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionWhiteCustomPiece3 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionWhiteCustomPiece4 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionWhiteKing = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionBlackCustomPiece1 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionBlackCustomPiece2 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionBlackCustomPiece3 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionBlackCustomPiece4 = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
mobilityRegionBlackKing = a1 b1 c1 d1 a2 b2 c2 d2 e2 a3 b3 c3 d3 e3 f3 *4 b5 c5 d5 e5 f5 g5 c6 d6 e6 f6 g6 d7 e7 f7 g7
promotionRegionWhite = d7 e7 f7 g7 g6 g5 g4
promotionRegionBlack = a4 a3 a2 a1 b1 c1 d1
promotionPawnTypes = p
promotionPieceTypes = nbr
doubleStep = false
castling = false
diagonalLines =

Shaolinking

Variant from autocorr (all credits to him) defined here autocorr's github available on pychess-alternates: pychess-alternates

[shaolinking]
king = -
rook = r
bishop = b
knight = n
queen = q
customPiece1 = p:fmWfceFifmnD
customPiece2 = k:Q
customPiece3 = g:pQ
startFen = rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
castling = true
castlingKingPiece = k
promotionPieceTypes = -
promotedPieceType = k:g
promotionRegionWhite = *1 *2 *3 *4 *5 *6 *7 *8
promotionRegionBlack = *8 *7 *6 *5 *4 *3 *2 *1
mandatoryPiecePromotion = true
pieceDemotion = true
extinctionValue = loss
extinctionPieceTypes = kg
extinctionPseudoRoyal = true
flagPiece = p
flagRegionWhite = *8
flagRegionBlack = *1
nMoveRule = 50
nFoldRule = 3
nFoldValue = draw
stalemateValue = loss
chess960 = true

Super-torpedo chess

# Pawns can move two or three squares forwards anywhere on the board. 
[supertorpedo:chess]
doubleStepRegionWhite = *1 *2 *3 *4 *5 *6 *7 *8
doubleStepRegionBlack = *1 *2 *3 *4 *5 *6 *7 *8
tripleStepRegionWhite = *1 *2 *3 *4 *5 *6 *7 *8
tripleStepRegionBlack = *1 *2 *3 *4 *5 *6 *7 *8

Bishop Sidestep Chess

# In addition to the usual diagonal bishop movement, bishops can also move forwards, sideways, and backwards one square as well. 
# However, they can only capture like a bishop. 
[bishopsidestep:chess]
bishop = -
customPiece1 = b:mWBcB

Openings double step chess

Only some of the pawns - those corresponding to a particular themed opening in vanilla chess - can move forwards two steps. All the other pawns can only move forwards one step. The positions in the variants that result from best play tend to look like that particular themed opening from vanilla chess. So far we have:

  1. King's Pawn (e2, e7)
  2. Sicilian Defense (e2, c7)
  3. Reversed Sicilian (c2, e7)
  4. Symmetrical English (c2, c7)
  5. Queen's Pawn (d2, d7)
  6. Queen's Gambit (c2, d2, d7)
  7. London System (d2, c7, d7)
  8. Semi-Tarrasch (c2, d2, c7, d7)
  9. Caro-Kann (d2, e2, d7)
  10. Pirc Defense (d2, e2, e7)
  11. King's Indian (c2, d2, e7)
  12. Franco-Benoni (d2, e2, c7)
  13. Dutch Defense (c2, d2, f7)

King's Pawn Double Step Chess

# King's Pawn Double Step Chess
# The only pawns which are allowed to move forwards two steps are the king's pawns: 
# white's e pawn and black's e pawn. 
[kingspawndoublestep:chess]
doubleStepRegionWhite = e2
doubleStepRegionBlack = e7

Sicilian Defense Double Step Chess

# Sicilian Defense Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Sicilian Defense: 
# white's e pawn and black's c pawn. 
[siciliandefensedoublestep:chess]
doubleStepRegionWhite = e2
doubleStepRegionBlack = c7

Reversed Sicilian Double Step Chess

# Reversed Sicilian Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Reversed Sicilian: 
# white's c pawn and black's e pawn. 
[reversedsiciliandoublestep:chess]
doubleStepRegionWhite = c2
doubleStepRegionBlack = e7

Symmetrical English Double Step Chess

# Symmetrical English Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Symmetrical English: 
# white's c pawn and black's c pawn. 
[symmetricalenglishdoublestep:chess]
doubleStepRegionWhite = c2
doubleStepRegionBlack = c7

Queen's Pawn Double Step Chess

# Queen's Pawn Double Step Chess
# The only pawns which are allowed to move forwards two steps are the queen's pawns: 
# white's d pawn and black's d pawn. 
[queenspawndoublestep:chess]
doubleStepRegionWhite = d2
doubleStepRegionBlack = d7

Queen's Gambit Double Step Chess

# Queen's Gambit Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Queen's Gambit: 
# white's c and d pawns and black's d pawn. 
[queensgambitdoublestep:chess]
doubleStepRegionWhite = c2 d2
doubleStepRegionBlack = d7

London System Double Step Chess

# London System Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the London System: 
# white's d pawn and black's c and d pawns. 
[londonsystemdoublestep:chess]
doubleStepRegionWhite = d2
doubleStepRegionBlack = c7 d7

Semi-Tarrasch Double Step Chess

# Semi-Tarrasch Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Semi-Tarrasch Defense: 
# white's c and d pawn and black's c and d pawns. 
[semitarraschdoublestep:chess]
doubleStepRegionWhite = c2 d2
doubleStepRegionBlack = c7 d7

Caro-Kann Double Step Chess

# Caro-Kann Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Caro-Kann Defense: 
# white's d and e pawns and black's d pawn. 
[carokanndoublestep:chess]
doubleStepRegionWhite = d2 e2
doubleStepRegionBlack = d7

Pirc Defense Double Step Chess

# Pirc Defense Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Pirc Defense: 
# white's d and e pawns and black's e pawn. 
[pircdefensedoublestep:chess]
doubleStepRegionWhite = d2 e2
doubleStepRegionBlack = e7

King's Indian Double Step Chess

# King's Indian Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the King's Indian Defense: 
# white's c and d pawns and black's e pawn. 
[kingsindiandoublestep:chess]
doubleStepRegionWhite = c2 d2
doubleStepRegionBlack = e7

Franco-Benoni Double Step Chess

# Franco-Benoni Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Franco-Benoni Defense: 
# white's d and e pawns and black's c pawn. 
[francobenonidoublestep:chess]
doubleStepRegionWhite = d2 e2
doubleStepRegionBlack = c7

Dutch Defense Double Step Chess

# Dutch Defense Double Step Chess
# The only pawns which are allowed to move forwards two steps are the pawns used in the Dutch Defense: 
# white's c and d pawns and black's f pawn. 
[dutchdefensedoublestep:chess]
doubleStepRegionWhite = c2 d2
doubleStepRegionBlack = f7