Skip to content

carlboy2002/CrisisSim-RedLine

Repository files navigation

CrisisSim: RedLine

A high-stakes diplomatic crisis mediation simulation game where players assume the role of Qathar's Foreign Minister navigating the Strait of Haruz tanker seizure crisis. Make critical decisions that shape the fate of regional stability.

๐ŸŽฎ Simulation Overview

CrisisSim: RedLine is a narrative-driven diplomatic simulation where every choice matters. As Qathar's Foreign Minister, you must balance competing interests between Ivaran (revolutionary theocracy), Iskar (Western-backed democracy), and international stakeholders to prevent escalation into full-scale military conflict.

The Crisis

The Strait of Haruz tanker seizure has plunged the region into crisis. Ivaran sponsors the Levara Brigades, while Iskar conducts covert operations to delay Project Saffron. With nuclear thresholds being crossed and civilian casualties mounting, your diplomatic interventions will determine whether peace holds or conflict spirals.

๐Ÿš€ Features

Core Gameplay

  • 3-Turn Negotiation System: Make strategic diplomatic moves across three critical turns
  • Dynamic AI Responses: GPT-powered NPC reactions that adapt to your choices
  • 6 Diplomatic Tools: From secret back-channels to public ultimatums
  • 5 Pressure Intensities: From exploratory contact to high-risk ultimatum
  • Multiple Stakeholders: Ivaran, Iskar, Atlantic Pact, UN Security Council, Haruz Energy Consortium

Game Mechanics

  • Real-time Meter System: Track escalation, process trust, nuclear risk, and bilateral relations
  • Player Profile Tracking: Your mediation style evolves based on decision patterns
  • Crisis Injection Events: Random events that escalate or provide opportunities
  • Security Council Vote: Final decision with four voting options
  • Multiple Endings: From fragile pause to partial breakthrough

Immersive Experience

  • Procedural Ambient Audio: Web Audio API-generated tension soundtrack
  • Interactive Sound Effects: Click feedback, alerts, and success tones
  • Animated SVG Conflict Map: Visual representation of regional dynamics
  • Voice Command Input: Speak your diplomatic actions
  • Collapsible Dashboard Panels: Customize your view

UI/UX

  • Operations Room Aesthetic: Dark theme with tactical color coding
  • Real-time Status Bar: Live clock, meter indicators, volume control
  • Responsive Design: Adapts to various screen sizes
  • Monospace Typography: Military/tactical interface feel

๐Ÿ›  Tech Stack

Technology Purpose
React 18 UI framework
TypeScript Type safety
Vite Build tool
Tailwind CSS Styling
Zustand State management
Web Audio API Procedural audio generation
Web Speech API Voice commands
OpenAI GPT-4 AI-powered NPC responses

๐Ÿ“ Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ ActionBuilder.tsx      # Diplomatic action selection UI
โ”‚   โ”œโ”€โ”€ CallerAvatar.tsx        # Animated phone call avatars
โ”‚   โ”œโ”€โ”€ ConflictMap.tsx         # SVG conflict visualization
โ”‚   โ”œโ”€โ”€ ConflictMapModal.tsx    # Full-screen map overlay
โ”‚   โ”œโ”€โ”€ ConflictMapButton.tsx   # Map toggle button
โ”‚   โ”œโ”€โ”€ MeterBar.tsx           # Meter visualization
โ”‚   โ”œโ”€โ”€ OpsComponents.tsx       # Reusable ops-themed components
โ”‚   โ”œโ”€โ”€ OrianPanel.tsx         # AI advisor counsel
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ StartScreen.tsx        # Landing page
โ”‚   โ”œโ”€โ”€ CountryProfileScreen.tsx # Qathar profile selection
โ”‚   โ”œโ”€โ”€ ScenarioBrief.tsx      # Crisis briefing
โ”‚   โ”œโ”€โ”€ PhoneCallScene.tsx     # Pre-negotiation calls
โ”‚   โ”œโ”€โ”€ CrisisInjectionAlert.tsx # Crisis event popups
โ”‚   โ”œโ”€โ”€ MainNegotiationScreen.tsx # Core gameplay
โ”‚   โ”œโ”€โ”€ SCVoteScreen.tsx       # Security Council vote
โ”‚   โ””โ”€โ”€ FinalDebrief.tsx       # Mission outcome
โ”œโ”€โ”€ store/
โ”‚   โ””โ”€โ”€ gameStore.ts           # Zustand game state
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ audioEngine.ts         # Procedural audio
โ”‚   โ”œโ”€โ”€ minimaxClient.ts       # OpenAI API client
โ”‚   โ””โ”€โ”€ utils.ts               # Utility functions
โ”œโ”€โ”€ types/
โ”‚   โ””โ”€โ”€ index.ts               # TypeScript definitions
โ””โ”€โ”€ App.tsx                   # Root component

๐ŸŽฏ How to Play

Game Flow

  1. Start Screen โ†’ Launch the simulation
  2. Profile Selection โ†’ Configure Qathar's national profile
  3. Scenario Brief โ†’ Receive crisis intelligence
  4. Phone Calls โ†’ Initial contact with Ivaran & Iskar
  5. Turn 1-3 โ†’ Execute diplomatic actions
  6. Security Council Vote โ†’ Final strategic decision
  7. Debrief โ†’ Review your mediation performance

Diplomatic Actions

Build actions using three parameters:

Parameter Options
Tool BACK-CHANNEL, ECONOMIC LEVERAGE, MULTILATERAL FRAMEWORK, HUMANITARIAN CORRIDOR, PUBLIC STATEMENT, SECURITY COUNCIL
Intensity EXPLORATORY CONTACT, SOFT PRESSURE, DIRECT PRESSURE, HARD PRESSURE, ULTIMATUM
Target IVARAN, ISKAR, ATLANTIC PACT, SECURITY COUNCIL, HARUZ ENERGY CONSORTIUM, ATOMIC OVERSIGHT MISSION

Meter System

Meter Range Description
ESCALATION 0-100 Military conflict risk
PROCESS TRUST 0-100 Confidence in negotiation
CIVILIAN PRESSURE 0-100 Humanitarian crisis level
NUCLEAR RISK 0-100 Project Saffron threat
IVARAN-QATHAR 0-100 Bilateral relationship
QATHAR-ATLANTIC 0-100 Alliance strength

Player Profiles

  • PRESSURE-FIRST: High-risk ultimatum user
  • BACK-CHANNEL SPECIALIST: Private diplomacy expert
  • MULTILATERALIST: International framework builder
  • ECONOMIC PRAGMATIST: Trade leverage tactician
  • INCREMENTALIST: Slow, steady progress maker

โš™๏ธ Configuration

Environment Variables

Create a .env.local file:

VITE_OPENAI_API_KEY=your-openai-api-key-here

Getting an API Key

  1. Visit OpenAI Platform
  2. Create an account or sign in
  3. Generate a new API key
  4. Add credits to your account

๐Ÿ“ฆ Installation

# Clone the repository
git clone <repository-url>
cd crisisim-redline

# Install dependencies
npm install

# Start development server
npm run dev

# Build for production
npm run build

๐ŸŽจ Customization

Adding New Diplomatic Tools

Edit src/types/index.ts:

export type DiplomaticTool = 
  | 'BACK-CHANNEL' 
  | 'ECONOMIC LEVERAGE'
  | 'NEW_TOOL'  // Add here
  // ...

Modifying Crisis Events

Edit CRISIS_INJECTIONS in src/types/index.ts

Customizing AI Prompts

Modify system prompts in src/lib/minimaxClient.ts

๐Ÿ”Š Audio System

The game features procedurally generated audio using Web Audio API:

  • Ambient Drone: Low-frequency tension base
  • Rhythmic Pulse: Heartbeat-like heartbeat
  • Static Layer: Distant radio static
  • Sound Effects: Click, alert, success tones

Audio automatically adjusts to scene context:

  • Normal mode: 30% volume
  • Crisis mode: 50% volume
  • Phone call mode: 8% volume

๐Ÿ“Š Outcome Tracking

Possible Endings

Outcome Description
fragile_pause Active conflict avoided, tensions remain
managed_stalemate Limited progress, process maintained
partial_breakthrough Meaningful framework established
qathar_sidelined Lost credibility with key stakeholders
escalation_spiral Military conflict begun

Mediator Style Analysis

Final debrief includes:

  • Your dominant diplomatic style
  • Risk tolerance assessment
  • Red lines crossed
  • Public vs. private exposure
  • Strategic recommendations

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

๐Ÿ“„ License

MIT License - See LICENSE file for details

๐ŸŽฎ Game Tips

  1. Protect Your Back-Channel: Once burned, it cannot be restored
  2. Watch Your Exposure: Public actions limit future deniability
  3. Balance Atlantic Ties: Your security guarantee is non-negotiable
  4. Mind the Haruz Stake: Your 23% economic stake means you feel the pain too
  5. Time Matters: Ultimatums can trigger breakthroughs or walkouts

CrisisSim: RedLine โ€” Where every diplomatic action has consequences.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors