Visual Pinball

Visual Pinball Driver (gRPC)

The gRPC driver bridges Cade to Visual Pinball X (VPX) and other gRPC-capable clients. External simulators send switch events into Cade and receive coil, light, flipper, and autofire commands back over a bidirectional event stream, so you can run a full Cade configuration against a simulated table without any physical hardware.

How Events Flow

Because inbound events flow through the same path as physical hardware events, scoring and game logic behave identically whether you are running on hardware or against VPX.

Hybrid Control Model

Flippers and autofire rules use a hybrid control model:

This split keeps the simulator responsive while keeping game-state management centralised in Cade.

Configuration

The gRPC driver is configured in a platform block within your Cade configuration file.

platform "grpc" "vpx" {
  port              = 50051
  enable_gateway    = true
  enable_reflection = true
  enable_tls        = false
  enable_cors       = true
}

Properties

PropertyTypeRequiredDefaultDescription
portintNo50051gRPC server listen port (1-65535)
enable_gatewayboolNotrueEnable the gRPC-gateway REST proxy
enable_reflectionboolNotrueEnable gRPC server reflection for tooling
enable_tlsboolNofalseEnable TLS for the gRPC server
cert_filestringNo""Path to the TLS certificate file (required when TLS is enabled)
key_filestringNo""Path to the TLS private key file (required when TLS is enabled)
enable_corsboolNotrueEnable CORS headers on the gateway

Supported Capabilities

The gRPC driver supports the core device capabilities you would find on a physical platform:

Platform Capabilities

CapabilityValue
TransportgRPC
Max switches1024
Max coils256
Max lights512
RGB lightsYes
Firmware flippersNo (hybrid model – client-local physics)
Address formatnumeric

Ball Device Commands

Cade distinguishes two ball-device operations so score and ball-in-play counters stay consistent:

If the client receives a kick_ball for a kicker with no ball held, it logs a warning and ignores the command.

Getting Started

Cade includes example clients and a sample VPX table configuration in the source repository:

To connect a gRPC client:

  1. Configure the gRPC driver in your Cade configuration file with the desired port.
  2. Start Cade. The gRPC server begins listening on the configured port.
  3. Connect your client to the gRPC server and establish a bidirectional event stream.
  4. The client sends switch events to Cade and receives device commands back.