Skip to main content
Boofstream automatically tracks scores during tournament sets by monitoring game outcomes from Slippi. When a game ends legitimately (without LRAS), the winner’s score increments automatically.

How It Works

The score tracking system listens to Slippi’s gameEnd$ event and determines the winner based on placement data:
livestream.gameEnd$.subscribe(e => {
    // Only track if set is started and ports are assigned
    if (!state.started || !slippi || slippi.player1IsPort1 === undefined) return;

    const player1Port = slippi.player1IsPort1 ? slippi.port1 : slippi.port2;
    const player1Wins = e.placements[player1Port - 1].position === 0;

    // Check for LRAS - do nothing if detected
    if (e.lrasInitiatorIndex !== -1) {
        return;
    }

    // Increment the winner's score
    if (player1Wins) {
        state.player1.score++;
    } else {
        state.player2.score++;
    }
});
LRAS Detection: Games ended with L+R+A+Start are automatically ignored and won’t affect scores. This prevents accidental score changes from game resets.

Game Results History

Boofstream tracks detailed information about each game in a set:

Stage Played

Records which stage each game was played on

Stocks Remaining

Tracks how many stocks the winner had left

Characters Used

Saves which characters both players used

Game Duration

Records how long each game lasted in seconds

Game Result Data Structure

Each completed game adds a result to the history:
state.slippi.gameResults.push({
    stage: slippi.stage,
    stocksRemaining,
    player1IsWinner: player1Wins,
    player1Character,
    player2Character,
    durationSeconds: Math.round((Date.now() - slippi.gameStartTimeUnix) / 1000),
    index: highestGameResultIdx + 1,
});

Set Completion

Scores automatically update after each game, allowing you to:
  • Track progress through Best of 3/5/7 sets
  • See at a glance who’s ahead in the current set
  • View complete set data including game-by-game breakdowns
  • Access detailed game history for analysis
The scoring system requires port assignments to be set before games start. Make sure to assign which player is on which port in the UI before beginning your set.

User Workflow

  1. Connect to Slippi: Establish connection to your Slippi relay
  2. Assign Ports: Set which player is Port 1 and which is Port 2
  3. Start Set: Mark the set as started in the UI
  4. Play Games: Scores automatically increment as games complete
  5. Monitor Progress: Watch scores update in real-time on stream overlays
Scores persist between games and are saved to disk, so you won’t lose progress if boofstream needs to restart.

Output Files

Score data is written to multiple output formats for OBS integration:
  • out/p1/score.txt - Player 1’s current score
  • out/p2/score.txt - Player 2’s current score
  • out/program_state.json - Complete state including scores
  • out/state.json - Full application state with game history
These files update automatically after each game, making it easy to display live scores in your stream overlay using OBS text sources.

Build docs developers (and LLMs) love