Devious Fish
Music daemons & more
profile for Perette at Stack Overflow, Q&A for professional and enthusiast programmers

Game Configuration

Contents

Game configuration can be overriden in the user's ~/.skeezballrc file. This is a JSON file.

1. Game configuration

1.1. Games

The games dictionary contains only two fixed keys:
adultGames A list of game keys for adult mode
familyGames A list of game keys for family-friendly mode

The rest of games entries will be game keys. Each key is a dictionary of game details. The game keys are just names, and unimportant outside being keys for the adultGames and familyGames lists.

name Name of the game
subtitle Catch phrase for the game
image Game logo or graphic
game A keyword identifying a game. Options are: skeezball, surprise, sinwave, chicken, external, exit. game may be omitted when the game key is one of these values.
executable For external games, the program to run.
directory The working directory for an external game.

There are 2 additional dictionaries: colors and scoring. These can be defined at the same level as games, which are shared by all games. They can also be (re)defined within each game dictionary, to allow each game to have its own distinct colors or settings.

1.2. Colors

colors specifies colors of game elements. Some elements have both a foreground and background color:
Foreground Background Description
gameColor gameBackgrund game elements
gameOverColor gameOverBackground the "Game Over" message
bowlerUpColor bowlerUpColor get-ready-to-bowl and player change messages
gameNameColor gameNameBackground Game names (main menu, pause)
scoreColor scoreBackground Earned points announcements
commentaryColor commentaryBackground Feedback or other messages related to scoring
plot1Color plot1Background Stimulation graph for motor 1
plot2Color plot2Background Stimulation graph for motor 2
statusColor statusBackground Status bar at bottom of screen

Other elements have only one color:

choiceLabelColor Configuration screen labels
choiceColor Current value on inactive choice line
choosingColor Current value on active choice line
scoreLabelColor Label for player scores ("Bowler 1", "Bowler 2")
playerIndicatorColor Active player indicator for 2-player games.
vibeStatusBackground Background for vibe status area
consentColor Color for vibe status message when consent given
noConsentClor Color for vibe status message without consent
meterBackground Color of "unlit" portion of vibe level indicator
meter1Color Vibe activity on first meter
meter2Color Vibe activity on second meter

1.3. Scoring

scoring contains parameters for scoring and score-related behaviors:
pointsPerTicket Used to calculate ticket yield based on scoring.
pointsPerVibeSecond Used to vibration duration based on scoring.
turnLimit In two-player games, imposes game end after this number of rounds, if it hasn't ended organically (so poor players won't "hog" the machine via their ineptness). If unset or set to null, games continue until they end via game rules.
strictRules Applies to Chicken only. When true, both 10,000 holes must be closed to end the game organically, and 10kPreSinks defaults to 0. When false (the default), the 10k holes require only 1 ball to open, and are ignored for purposes of ending the game.
10kPreSinks Applies to Chicken. Sets the initial state of the 10,000 holes as if this number of balls had already been sunk. Zero sets behavior to that of other holes, 2 requires 1 sink to open/close, 3 means both holes are open at start and will remain open. This value is incompatible with strictRules=true, unless there is a turn limit, since the holes will never close and the game cannot end). The value 4 will mark both holes as already closed at start of game.

1.4. Other

other contains any additional game-related parameters needed.
slideshow: path The path to image files.
slideshow: slides A list containing filenames of slide images.
slideshow: slideTime The duration each slide is displayed.

1.5. Miscellaneous

There are a handful of game-wide settings that are defined at the top level:
ballCount Number of balls per game
adultModeExpiration Duration in seconds after consent is fully removed before adult features and games are hidden. Adult mode is now reassessed when the game goes in and out of slide-show mode.
adultModeAtStart true/false: If true, the game launches in adult mode, even when it does not detect consent.
adultModeAlways true/false: If true, the game stays in adult mode, regardless of consent switches.
player1Location left/right: Indicates whether hardware player 1 is wired to the left or right side. Player 2 is assumed to be on the opposite site. The software from then-on knows them as the left and right players, and draws the display accordingly.
buttonDisplayOrder A list defining the order in which to display buttons in the status area. Button names may be left out to suppress their display. Names are: up (yellow), back (red), select (green), next (silver), down (blue).
screenSaveTime The duration of inactivity that will cause the game to begin displaying in invitation-to-play slideshow (in earlier versions, simply blank the screen). Applies at main menu only.

2. Hardware configuration

2.1. Devices and channel assignments

You should not need to mess with these unless your control board has been damaged and you need to reassign an input.

  "boardRevision": 2 -- board revision number, on which all default values are based.
  "dispenser": { -- whole dispenser may be set to `null` to disable
    "dispense": dispenser start/stop control BCM channel
    "ready": dispenser ready BCM channel
  },
  "accessory1": "orange" accessory BCM channel
  "accessory2": "yellow" accessory BCM channel
  "playfield": BCM channel controlling playfield lighting & sensor relay
  "ballRelease": BCM channel controlling relay for ball release solenoid
  "player1": {
    "consent": BCM channel for consent input
    "motor1": AdaFruit MotorKit stepper/motor number for player's first motor
    "motor2":  AdaFruit MotorKit stepper/motor number for player's first motor
  },
  "player2": {
    See `player1`
  }

2.2. Sensors and events

  "sensors": {
    "mode": At present, only `gpio` mode is supported.
    "defaultPull": default pull direction, either `up`, `down`, or `none`
    "defaultDetect": default input detection, either `rising`, `falling` or `both`
    "defaultBounce": Floating point number of seconds to ignore repeated sensor input
    "assignments": {
      This dictionary provides BCM channel assignments based on
      defined events (see below).  Negative numbers indicate the
      corresponding event does not have a pin number in this
      board configuration.
    }
  }

  "events": {
    "event_name": {
      "bounceTime": Time after input to ignore successive events
      "pull": Pull to apply to input, either `up`, `down`, or `none`
      "detect": Whether to `falling`, `rising` or `both` inputs
      "extra": {
        If present, this is added to events by the sensor library for application use.
      }
    }
  }