Skip to content

Variant configuration

Belzedar94 edited this page Apr 19, 2022 · 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://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 FairyFishGUI, which can also load variants.ini files.

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/ianfab/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

https://vchess.club/#/variants/Doublearmy

# 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

# Custom variant playable in Pychess' discord server
# 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