Skip to content

stepmikhaylov/example-rocketride-survivor

Repository files navigation

Survivor — AI Reality Show Simulator

A React app that simulates a Survivor-style reality TV show using AI-powered contestants. Twelve AI players scheme, form alliances, vote each other out, and compete to become the Sole Survivor — all autonomously driven by an LLM via the RocketRide SDK.

What It Does

  • Generates 12 unique contestants with distinct personalities, strategies, and backstories
  • Runs autonomous game rounds, each with 4 discussion sub-phases (Camp Life → Reading the Room → Strategy Talk → Pre-Tribal)
  • Players scheme publicly and privately — each contestant makes public statements, sends private messages to allies, and forms coalitions
  • Jeff Probst AI host interrogates players at Tribal Council and provides post-elimination drama
  • Alliance detection — the engine analyzes private message patterns to detect and display coalitions
  • Voting and elimination — players vote concurrently each round; ties are broken randomly

Prerequisites

  • Node.js 18+
  • A running RocketRide server
  • An OpenAI API key (used by the RocketRide pipeline)

Setup

Install dependencies:

npm install

Configuration

The app reads configuration from environment variables. Create a .env.local file in the survivor/ directory:

ROCKETRIDE_URI=http://localhost:5565
ROCKETRIDE_APIKEY=your-rocketride-api-key
ROCKETRIDE_OPENAI_KEY=your-openai-api-key
Variable Default Description
ROCKETRIDE_URI http://localhost:5565 RocketRide server URL
ROCKETRIDE_APIKEY (empty) RocketRide authentication key
ROCKETRIDE_OPENAI_KEY (empty) OpenAI API key passed to the LLM pipeline

The pipeline uses openai-4o-mini by default. To change the model, edit src/config.ts.

Running

Start the dev server:

npm run dev

Open http://localhost:3000, then click Start to begin a game.

Build for production:

npm run build

Preview the production build:

npm run preview

How It Works

Architecture

App.tsx
 └── GameEngine.ts        # Core game loop, all AI calls
      ├── RocketRideClient # Shared LLM pipeline (one pipeline, 12 player threads)
      ├── generatePersonas # Jeff creates 12 contestants via LLM
      ├── playerDiscussionTurn  # Each player speaks publicly + schemes privately
      ├── jeffTribalCouncil     # Jeff interrogates players before the vote
      ├── votingPhase           # All players vote concurrently
      ├── processElimination    # Tallies votes, eliminates player
      └── detectAlliances       # Infers coalitions from private message graph

Game Loop

Each round proceeds through these phases:

  1. Discussion (4 sub-rounds) — players make public statements and send private messages
  2. Tribal Council — Jeff Probst AI grills specific players based on what he observed
  3. Voting — all players vote concurrently; the player with the most votes is eliminated
  4. Elimination — Jeff announces the result and provides commentary

The game continues until one player remains.

RocketRide Pipeline

All 12 players share a single RocketRide pipeline with 13 threads (12 players + Jeff). Each player maintains their own conversation history (capped at 16 entries) for continuity across rounds. The pipeline uses openai-4o-mini by default.

Tuning

Key constants in src/config.ts:

Constant Default Effect
DISCUSSION_ROUNDS 4 Number of discussion sub-rounds per game round
DELAY_BETWEEN_PHASES_MS 3000 Pause between phases (ms)
MAX_HISTORY_ENTRIES 16 Per-player conversation history window

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors