- Learn
- Build a Game
- Chess
- Appendices
- D Tuning Tables
Appendix D — Tuning Tables
The numbers that make Chess play the way it does. Change them to remix the game: the game’s Logic reads them from here. Try one change at a time, and run the game after each. If something stops working, put the old number back.
D.1 Data Tables
D.1.1 Position
Where every Piece stands: one row per Square, named a1 to h8, in order a1, b1, … h1, a2, … h8 (so the row index is (rank - 1) x 8 + (file - 1)). file: the File, 1 (a) to 8 (h). fileLetter: the same File as a letter, a to h, as the labels along the Board write it. rank: the Rank, 1 to 8. kind: the Kind of the Piece on the Square (King, Queen, Rook, Bishop, Knight, or Pawn), empty when the Square is empty. side: the Side it belongs to (White or Black), empty when the Square is empty. The rows as written here are the starting position.
1a1RookWhite2b1KnightWhite3c1BishopWhiteD.1.2 Kinds
One row per Kind of Piece, one column per Side. White and Black: the frame of the Piece Set art that shows this Kind for that Side (every Piece Set art keeps the same frame order). The columns are named for the Sides, so the Side of a Piece picks its column. promotionWords: what the Hint message adds when its Move promotes a Pawn to this Kind (empty for the King and the Pawn, which a Pawn never becomes). letter: the letter a Move of this Kind starts with in the Move History (none for a Pawn). promotionMark: what a Move that promotes a Pawn to this Kind ends with (empty for the King and the Pawn).
06K17, promote to queenQ=Q410, promote to rookR=R28, promote to bishopB=B39, promote to knightN=N511D.1.3 Sides
One row per Side. forward: the way its Pawns move along the Ranks (1 = up, toward Rank 8; -1 = down). pawnRank: the Rank its Pawns start on. opponent: the other Side. promotionRank: the last Rank for its Pawns, where a Pawn is promoted.
12Black8-17White1D.1.4 Directions
Every way each Kind of Piece moves, one row per direction. kind: the Kind. fileStep and rankStep: one step, in Files and Ranks (a Pawn’s rankStep is turned round for Black by its Side’s forward). steps: how many steps it may take in one Move (7 slides across the Board). firstMoveSteps: the same, for a Piece on its Side’s Pawn Rank (a Pawn’s first Move may be two Squares). canMove: it may step onto an empty Square. canCapture: it may step onto an enemy Piece, taking it. A Piece stops at the first Piece in its way.
King0111YesYesKing1111YesYesKing1011YesYesD.1.5 Targets
The Squares the selected Piece may move to: one row per Square, a1 to h8, in the same order as the Position table, made by Clear Targets (the table has no rows of its own). reachable: yes when the selected Piece may move there. Find Moves fills it, after Clear Targets has made every Square unreachable.
D.1.6 Words
The words the Player reads, one row per message, so they are found and changed in one place. text: the words as shown.
Your moveCheckPromotion: choose a PieceYou win · CheckmateYou lose · CheckmateDraw · StalemateDraw · Insufficient materialDraw · Fifty-move ruleDraw · Threefold repetitionThinking…Opponent disconnectedFinding a hint…A hint could not be found.You lose · Resignationx+#D.1.7 Castling
The four castlings, one row per Side and side of the Board. kingFrom and kingTo: where the King starts and lands (it moves two Squares toward the Rook). rookFrom and rookTo: where the Rook starts and lands (on the Square the King crosses). rookPasses: the Square next to the Rook’s, which the Rook crosses (on the King’s side it is also where the King lands). isAllowed: yes while neither the King nor this Rook has moved and the Rook has not been taken; a new game starts with every castling allowed. notation: how the Move History writes this castling (O-O on the King’s side, O-O-O on the Queen’s).
e1g1h1f1g1YesO-Oe1c1a1d1b1YesO-O-Oe8g8h8f8g8YesO-Oe8c8a8d8b8YesO-O-OD.1.8 Position History
Every position since the last Capture or Pawn Move, recorded at the start of each Turn, so the game can tell when one comes for the third time. Each position takes 64 rows, one per Square in the order of the Position table (a1, b1, … h8): the first position is rows 0 to 63, the next 64 to 127, and so on. Each row is named by its number. kind and side: the Piece on that Square (empty when none). castlingsAllowed: how many castlings were still allowed then (a castling once ended never comes back, so the same number means the same castlings). The table starts empty.
D.1.9 Strengths
How the Computer plays at each Strength, one row per Strength button of the New Game panel (the row name is the button’s word). skillLevel: Stockfish’s Skill Level, from 0 (weakest) to 20 (strongest). thinkingSeconds: how long Stockfish thinks about each Move, in seconds.
00.240.3580.5140.8201.2D.1.10 Chosen Moves
The Moves the Stockfish Bridge found, each written just before the bridge says so. Row Computer: the Computer’s Move (“computerMoveChosen”). Row Hint: the Move suggested to the Player (“hintChosen”); it stays while the Hint is shown, and is empty when there is none. from and to: the Squares the Piece moves from and to (a1 to h8). landingKind: the Kind of the Piece once it has landed: its own Kind, or, when the Move promotes a Pawn, the Kind the Pawn becomes (Queen, Rook, Bishop, or Knight).
D.1.11 Move History
Every Move of the game so far, in the order they were made, one row per Move (the first Move is row 0; each row is named by its number). from and to: the Squares the Piece moved from and to (a1 to h8). landingKind: the Kind of the Piece once it had landed: its own Kind, or, for a Promotion, the Kind the Pawn became. The number of rows is the number of Moves made. Undo takes rows off the end and plays the rest again. The table starts empty. The other columns are the Move’s name as chess players write it (standard algebraic notation), in the order it is read: letter, the Kind’s letter (none for a Pawn), or O-O or O-O-O for castling; fromFile and fromRank, the File and Rank it came from, written only when needed to tell two Pieces apart (and the File of a Pawn that captures); capture, x for a Capture; square, the Square it went to (none for castling); promotion, what a Pawn became (=Q); checkMark, + for Check or # for Checkmate. The Move’s number is not kept: rows 0 and 1 are Move 1 (White’s and Black’s), rows 2 and 3 Move 2, and so on.
D.1.12 Slides
Where the Pieces of the Computer’s Move slide, written just before they slide (Plan The Slide) and read by the Moving Pieces (each placement follows one row) and by the Pieces, which show nothing on a Square a slide starts from. Row Piece: the Piece that moves. Row Rook: the Rook, when the Move is a castling (empty otherwise). from and to: the Squares it slides from and to (a1 to h8).
D.1.13 Hint Strength
How hard Stockfish searches for a Hint, whatever Strength the Computer plays at (the Stockfish Bridge reads it). One row, Hint. skillLevel: Stockfish’s Skill Level, from 0 (weakest) to 20 (strongest). thinkingSeconds: how long Stockfish thinks, in seconds.
200.5D.1.14 Threats
What Threats mode marks on each Square: one row per Square, a1 to h8, in the same order as the Position table. isAttacked: yes when the Piece standing there can be legally captured by an enemy Piece (the King: when it is in Check). isUnprotected: yes when it is attacked, is not a King, and no Capture of it can be answered by a legal recapture. pinnedBy: the Square of the enemy Queen, Rook, or Bishop that pins the Piece standing there to its own King; empty when it is not pinned. Find Threats fills it while Threats mode is on; otherwise every row is no and empty.
D.1.15 Arrows
The arrows Threats mode shows for the selected or inspected Piece, one row per arrow (each row is named by its number). from and to: the Squares the arrow runs from and to (a1 to h8). color: the arrow’s color, with how strongly it shows (#rrggbbaa). Find Arrows fills it after every change; Draw Threat Lines draws it. Empty when no arrow is shown.
D.1.16 Board Finishes
The four looks of the Board the Player can choose (Settings). One row per Board Finish, named by the word the Player reads. board: the Board art. labelOnLight: the color of a Rank number or File letter on a light Square. labelOnDark: the color of one on a dark Square.
Walnut Board#503a2b#dfc69bTournament Board#314b3e#e8ead5Slate Board#344756#dce4e8Marble Board#424840#eae5dbD.1.17 Piece Sets
The three looks of the Pieces the Player can choose (Settings). One row per Piece Set, named by the words the Player reads. pieces: the Piece Set art, twelve frames in the order of the Kinds table. size: how large the art is drawn, 1 being the size of the Carved walnut art, so that every set’s King is 0.84 of a Square tall.
Carved Walnut Pieces1Ivory And Gold Pieces0.9591Sculpted Marble Pieces0.9535D.2 Logic Numbers
The numbers and colors each Logic Component keeps in its Shared Variables and Per Instance Variables, with the Starting Value its card gives. A value set on its Object, under Variables in the Properties, or on a placement in the Scene, wins over the value here.
LAY OUT THE BOARD
squareMeters ............... 3.75
SQUARE MARKS
selectedColor .............. #f4d273
selectedAlpha .............. 0.44
lastMoveColor .............. #e9c44f
lastMoveAlpha .............. 0.32
checkColor ................. #cd493f
checkAlpha ................. 0.66
hintColor .................. #61a9b8
hintAlpha .................. 0.35
attackedColor .............. #d64b46
attackedAlpha .............. 0.4
unprotectedAlpha ........... 0.5
inspectedColor ............. #56a59d
inspectedAlpha ............. 0.27
LOOK FOR GAME END
timesSeenForDraw ........... 3
fiftyMoveCountForDraw ...... 100
PLACE ON BOARD
squareMeters ............... 3.75
boardLeft .................. 0
boardBottom ................ 4.375
SHOW OPTION
chosenColor ................ #a9c79b
plainColor ................. #e2d5b4
MAKE COMPUTER MOVE
spareSeconds ............... 20
SLIDE PIECE
slideSeconds ............... 0.36
squareMeters ............... 3.75
boardLeft .................. 0
boardBottom ................ 4.375
GIVE A HINT
spareSeconds ............... 20
SHOW HINT MESSAGE
showSeconds ................ 4
DRAW THREAT LINES
pinColor ................... #c68a20cc
pinLineWidth ............... 0.03
pinDashLength .............. 0.12
pinDashSpacing ............. 0.22
pinGapAtStart .............. 0.3
pinGapAtKing ............... 0.25
arrowToEnemyColor .......... #b6403ab0
arrowToOtherColor .......... #257f7690
arrowFromAttackerColor ..... #b6403acc
arrowWidth ................. 0.035
arrowGapAtStart ............ 0.22
arrowGapAtEnd .............. 0.27
arrowHeadLength ............ 0.11
arrowHeadSpread ............ 0.6
squareMeters ............... 3.75
boardLeft .................. 0
boardBottom ................ 4.375
pixelsPerMeter ............. 32
SHOW THREATS BUTTON PRESSED
pressedColor ............... #e3eadc
pressedWordColor ........... #244739
plainColor ................. #e2d5b4
plainWordColor ............. #503a2b
SHOW RECORDED MOVE
line ....................... 0
SHOW PAGE BUTTON
direction .................. 1
KEYBOARD FOCUS
squareMeters ............... 3.75
boardLeft .................. 0
boardBottom ................ 4.375
startFile .................. 5
CHOOSE WITH KEYS
firstPieceX ................ -195
pieceY ..................... 66
pieceSpacing ............... 130
