Skip to content

Variant configuration

Fabian Fichter edited this page Oct 8, 2024 · 61 revisions

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).

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