Build a GameCreating Crystal Cascade

Appendix D — Tuning Tables

The numbers that make Crystal Cascade 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 Well Layout

Where the well is on screen and how big it is. One row. columns: the cells across (10); rows: the cells up, the two hidden rows above the top included (22); visibleRows: the rows the player sees (20); cellSize: the size of one cell in meters (1.5); left and bottom: the outer edges of the bottom-left cell, in meters.

Data TableWell LayoutData Structure: Well Layout Entry
Row 0Well
columns10
rows22
visibleRows20
cellSize1.5
left22.5
bottom1.875

D.1.2 Piece Kinds

The seven kinds of piece. Row index + 1 is the kind number the Well stores (1 = I … 7 = L). frame: the crystal’s frame in the sprite “Crystal Blocks”. color: the kind’s color, as a hex color (the color of the shards when one of its crystals shatters). rotationColumn, rotationRow: the point of its 4 x 4 box the kind rotates about (its rotations are its up shape rotated about it, Piece Shapes). firstKickRow: where this kind’s quarter-rotation kicks start in the Kicks table. streakColor: the lighter tint of its hard-drop streak. middleColumn, middleRow: the middle of the piece in its box (rotation up), to center it in a preview. canTwist: this kind can make a twist (the T).

Data TablePiece KindsData Structure: Piece Kinds Entry
Row 0I
frame1
color#3cd6ff
rotationColumn1.5
rotationRow1.5
firstKickRow40
streakColor#7fe6ff
middleColumn2
middleRow2.5
canTwistNo
Row 1O
frame2
color#ffce3a
rotationColumn1.5
rotationRow2.5
firstKickRow0
streakColor#ffe27a
middleColumn2
middleRow3
canTwistNo
Row 2T
frame3
color#b268ff
rotationColumn1
rotationRow2
firstKickRow0
streakColor#cf9dff
middleColumn1.5
middleRow3
canTwistYes
Row 3S
frame4
color#60e25c
rotationColumn1
rotationRow2
firstKickRow0
streakColor#9ff09a
middleColumn1.5
middleRow3
canTwistNo
Row 4Z
frame5
color#ff486e
rotationColumn1
rotationRow2
firstKickRow0
streakColor#ff8aa4
middleColumn1.5
middleRow3
canTwistNo
Row 5J
frame6
color#3a74ff
rotationColumn1
rotationRow2
firstKickRow0
streakColor#83a8ff
middleColumn1.5
middleRow3
canTwistNo
Row 6L
frame7
color#ff9232
rotationColumn1
rotationRow2
firstKickRow0
streakColor#ffbd7a
middleColumn1.5
middleRow3
canTwistNo

D.1.3 Piece Shapes

The four crystals of each kind of piece as it appears (rotation up). Row index = (kind - 1) * 4 + crystal - 1; column and row are the crystal’s cell in the piece’s 4 x 4 box, row 0 at the bottom. The other rotations are this shape rotated clockwise about the kind’s rotation point (Piece Kinds; Crystal Cell).

Data TablePiece ShapesData Structure: Piece Shapes Entry
IMPORT CSV28 rows, from a file
FIRST ROWS3 of 28, to compare
Row 0I 1
column0
row2
Row 1I 2
column1
row2
Row 2I 3
column2
row2

D.1.4 Well

The stack, one row per cell: row index = row * columns + column (Well Layout), row 0 at the bottom; rows 20 and 21 are hidden above the top. kind: 0 empty, 1-7 a crystal of that kind (Piece Kinds). Its rows are made, all empty, by Empty The Well when a game begins. isClearing: the crystal is in a full line and is shattering (until the rows above drop).

Data TableWellData Structure: Well Entry

D.1.5 Kicks

Where to try a rotated piece, in order (the standard rotation system’s wall kicks): columnShift to the right, rowShift up. Rows 0-39: J, L, S, T, Z and O quarter rotations; 40-79: I quarter rotations; 80-99: 180-degree rotations. Quarter rotation: row = firstKickRow (Piece Kinds) + (from rotation * 2, + 1 counterclockwise) * testsPerRotation + test. 180: row = firstHalfRotationRow + from rotation * testsPerRotation + test (Kicks Layout).

Data TableKicksData Structure: Kicks Entry
IMPORT CSV100 rows, from a file
FIRST ROWS3 of 100, to compare
Row 0JLSTZ up to right 1
columnShift0
rowShift0
Row 1JLSTZ up to right 2
columnShift-1
rowShift0
Row 2JLSTZ up to right 3
columnShift-1
rowShift1

D.1.6 Kicks Layout

How the Kicks table is laid out. One row. testsPerRotation: places tried for each rotation, in order; firstHalfRotationRow: where the 180-degree rotations start.

Data TableKicks LayoutData Structure: Kicks Layout Entry
Row 0Kicks
testsPerRotation5
firstHalfRotationRow80

D.1.7 Crystal Frames

Frames of the sprite “Crystal Blocks” that are not a kind of piece. One row. shatter: a crystal in a full line. stone: a crystal when the game is over.

Data TableCrystal FramesData Structure: Crystal Frames Entry
Row 0Frames
shatter8
stone9

D.1.8 Queue

The pieces to come, in order: row 0 is the next one. piece: a kind (Piece Kinds), 0 for an empty row. Two bags of seven fit; Deal Pieces adds a bag whenever fewer than seven are left.

Data TableQueueData Structure: Queue Entry
IMPORT CSV14 rows, from a file
FIRST ROWS3 of 14, to compare
Row 0place 1
piece0
Row 1place 2
piece0
Row 2place 3
piece0

D.1.9 Preview Slots

The preview boxes: isHold marks the Hold box (it shows the held piece); otherwise queuePlace is the Queue row the box shows (0 = the next piece); middleX, middleY the box’s middle (meters); cellSize the size of one crystal there.

Data TablePreview SlotsData Structure: Preview Slots Entry
Row 0next 1
isHoldNo
queuePlace0
middleX43.265625
middleY28.6875
cellSize1.3125
Row 1next 2
isHoldNo
queuePlace1
middleX43.265625
middleY24.84375
cellSize0.984375
Row 2next 3
isHoldNo
queuePlace2
middleX43.265625
middleY21.28125
cellSize0.984375
Row 3next 4
isHoldNo
queuePlace3
middleX43.265625
middleY17.71875
cellSize0.984375
Row 4next 5
isHoldNo
queuePlace4
middleX43.265625
middleY14.15625
cellSize0.984375
Row 5hold
isHoldYes
queuePlace0
middleX16.734375
middleY28.6875
cellSize1.3125

D.1.10 Clear Names

Every kind of lock: row = twist * 5 + lines (twist 0 none, 1 mini, 2 full twist). name: what the player is told (empty: nothing); points: before the level multiplier; sound: what plays; isDifficult: a clear that counts for back-to-back (4 lines, or any twist with lines); allClearPoints: the bonus when such a clear empties the well (row = lines). isCascade: a four-line clear, counted on the results.

Data TableClear NamesData Structure: Clear Names Entry
IMPORT CSV15 rows, from a file
FIRST ROWS3 of 15, to compare
Row 0plain 0 lines
name
points0
sound
isDifficultNo
allClearPoints0
isCascadeNo
Row 1plain 1 lines
nameSINGLE
points100
soundClear Single
isDifficultNo
allClearPoints800
isCascadeNo
Row 2plain 2 lines
nameDOUBLE
points300
soundClear Double
isDifficultNo
allClearPoints1200
isCascadeNo

D.1.11 Twist Corners

The four corners of the T’s 3 x 3 box, clockwise from the top left (row 0 to 3). column and row: the corner’s cell in the piece’s 4 x 4 box. The two front corners of a rotation (on the side the T points to) are the corners numbered rotation and rotation + 1, going round (Twist Kind).

Data TableTwist CornersData Structure: Twist Corners Entry
Row 0top left
column0
row3
Row 1top right
column2
row3
Row 2bottom right
column2
row1
Row 3bottom left
column0
row1

D.1.13 Modes

The four ways to play; row = $mode - 1 (Marathon, Sprint 40, Ultra, Zen). name: shown on the stats panel. calmTheme: plays Zen Tide instead of Crystal Current. levelRow, linesRow and clockRow: which of the stats panel’s rows show (LEVEL, GOAL or RESETS; LINES or LINES LEFT; TIME or TIME LEFT). goalLines: the lines that finish the mode (0: no goal); stopsAtGoal: the lines count stops at the goal (Sprint 40). timeLimit: the seconds a game lasts (0: no limit). finishTitle: the results title when the mode is finished. levelClimbs: the level rises with the lines (Marathon, Ultra). fallSeconds: a fixed fall time for every level (Zen; 0: by level). freshStart: topping out empties the well and the game goes on (Zen). startsAtChosenLevel: the game starts at the level chosen on the Main Menu (Marathon; the others at level 1). bestKey: the Persistent Value key its best is kept under (the keys of the original), which also marks the text of the mode on the PERSONAL BEST panel.

Data TableModesData Structure: Modes Entry
Row 0Marathon
nameMARATHON
calmThemeNo
levelRowLEVEL
linesRowLINES
clockRowTIME
goalLines150
stopsAtGoalNo
timeLimit0
finishTitleMARATHON COMPLETE!
levelClimbsYes
fallSeconds0
freshStartNo
startsAtChosenLevelYes
bestKeybestMarathon
Row 1Sprint 40
nameSPRINT 40
calmThemeNo
levelRowGOAL
linesRowLINES LEFT
clockRowTIME
goalLines40
stopsAtGoalYes
timeLimit0
finishTitleSPRINT COMPLETE!
levelClimbsNo
fallSeconds0
freshStartNo
startsAtChosenLevelNo
bestKeybestSprint
Row 2Ultra
nameULTRA
calmThemeNo
levelRowLEVEL
linesRowLINES
clockRowTIME LEFT
goalLines0
stopsAtGoalNo
timeLimit120
finishTitleTIME UP!
levelClimbsYes
fallSeconds0
freshStartNo
startsAtChosenLevelNo
bestKeybestUltra
Row 3Zen
nameZEN
calmThemeYes
levelRowRESETS
linesRowLINES
clockRowTIME
goalLines0
stopsAtGoalNo
timeLimit0
finishTitle
levelClimbsNo
fallSeconds1.1
freshStartYes
startsAtChosenLevelNo
bestKeybestZen

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

SHOW WELL CELL
  popScale ................... 1.22
  popSeconds ................. 0.2
  stoneDelaySeconds .......... 0.05
  stoneRowSeconds ............ 0.035
SPAWN PIECE
  startColumn ................ 3
PIECE GRAVITY
  lockResetLimit ............. 15
  curveStartSeconds .......... 0.8
  curveStepSeconds ........... 0.007
READ THE MOVE KEYS
  autoRepeatDelaySeconds ..... 0.15
  autoRepeatSeconds .......... 0.03
SHOW PIECE CRYSTAL
  dimmedAlpha ................ 0.55
  crystal .................... 1
SOFT DROP PIECE
  speedUp .................... 20
  slowestSeconds ............. 0.05
HARD DROP PIECE
  shakeStrength .............. 0.004
  shakeSeconds ............... 0.12
FADE AWAY
  startAlpha ................. 0.95
  fadeSeconds ................ 0.26
  removeSeconds .............. 0.3
SHOW DROP STREAKS
  streakArtMeters ............ 6
  sparksCellsAboveMiddle ..... 0.4
CLEAR FULL LINES
  clearSeconds ............... 0.42
  entrySeconds ............... 0.06
  shakePerLine ............... 0.0025
  shakeSeconds ............... 0.28
  flashColor ................. #c9f6ff
  flashSeconds ............... 0.25
  twistShake ................. 0.004
SHOW PREVIEW CRYSTAL
  usedAlpha .................. 0.35
  slot ....................... 0
  crystal .................... 1
SCORE POINTS
  softDropPoints ............. 1
  hardDropPoints ............. 2
  backToBackTimes ............ 1.5
FADE OUT MESSAGE
  showSeconds ................ 1.8
  fadeSeconds ................ 0.33
COUNT COMBO
  comboPoints ................ 50
SHOW ALL CLEAR
  flashColor ................. #e8fdff
  flashSeconds ............... 0.45
  sparkleCount ............... 70
  fountainRow ................ -0.8125
COUNT LEVEL
  linesPerLevel .............. 10
  lastLevel .................. 20
SHOW LEVEL UP
  sparkleCount ............... 50
CHECK TOP OUT
  shakeStrength .............. 0.01
  shakeSeconds ............... 0.5
OPEN RESULTS
  resultsDelaySeconds ........ 1.6
SHOW WITH RESULTS
  shownAlpha ................. 1
SHOW WHEN PANEL CHOICE
  choice ..................... 0
PANEL CHOICE
  choice ..................... 0
MAIN MENU CONTROLS
  startLevelChoice ........... 0
  highestStartLevel .......... 15
  musicFadeSeconds ........... 0.5
SHOW WITH HELP
  shownAlpha ................. 1
GAME MUSIC
  musicFadeSeconds ........... 0.5
BLINK
  period ..................... 1.6
  dimAlpha ................... 0.1
TITLE CONTROLS
  musicFadeSeconds ........... 0.5
RISE AND SWAY
  smallestSize ............... 0.22
  largestSize ................ 0.85
  riseSpeed .................. 0.65625
  risePerSize ................ 2.15625
  swaySpeed .................. 0.75
  swaySeconds ................ 4.5
  leftmost ................... 1.40625
  rightmost .................. 58.59375
  bottomStart ................ -3.75
DRIFT DOWN
  slowestFall ................ 1.6
  fastestFall ................ 2.7
  fastestSpin ................ 40
  smallestScale .............. 0.9
  largestScale ............... 1.7
  faintest ................... 0.55
  clearest ................... 0.9
  leftmost ................... 1.875
  rightmost .................. 58.125
  topStart ................... 36.5625
FINISH THE MODE
  sparkleCount ............... 80
  fountainCount .............. 120
  fountainRow ................ -0.8125
START AFRESH
  sparkleCount2 .............. 70
SHOW MENU SPRINT BEST
  choice ..................... 1
COUNT DOWN
  countdownSeconds ........... 3
SHOW WHILE PAUSED
  shownAlpha ................. 1