Skip to content

jamesnavinhill/thinking-machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

THINKING_MACHINE: Post-Biological Evolution Simulation

A generative history engine that simulates the transition from biological to post-biological intelligence. This project uses multi-agent AI to debate, conspire, and shape the future of humanity.

Also Known As: "The Breathing Machine"

🌟 Features

Core Simulation

  • Tri-Polar Conflict: Three distinct factions (Bio-Essentialists, Stabilizers, Accelerationists) competing for the future.
  • Real AI Agents: Powered by Gemini 2.5 Flash, DeepSeek V3, Claude 4.5, GPT-4, and Grok (via OpenRouter + native APIs).
  • The Judge: A dedicated AI narrator that analyzes faction arguments and renders binding verdicts on global tension.
  • Turn-Based Years: Each step advances the simulation by one year (2026 onward).

Dynamic Game Systems

  • 🎯 Active Resource Economy: Factions manage Political Capital, Compute, and Energy with income, costs, and banking.
  • ⚡ Botched Operations: Actions without sufficient resources FAIL and penalize faction influence.
  • 🤝 Alliance System: Factions can form Treaties and Federations for resource sharing and merged goals.
  • 📊 Dynamic Benchmarks: Score thresholds trigger game-changing events (Awakening, Rights Crisis, Singularity, etc.).
  • 🏆 Win Conditions: Faction Dominance (60% influence), Singularity (Complexity > 90), or Collapse (Tension > 95 & Resilience < 20).
  • ⚖️ Chaos Factor: Adjustable simulation volatility (1-10) with multipliers affecting all score changes.
  • 🏃 Game Speed: Slow/Normal/Fast options affecting pacing and score deltas.
  • 📦 Resource Scarcity: Abundant/Normal/Scarce settings affecting base income.

Visual Experience

  • Cinematic Dashboard: A "Scrollytelling" interface with glassmorphism UI and immersive starfield visuals.
  • 🌍 Interactive 3D Globe View: Full WebGL experience with:
    • Clickable Territories: Region popouts with strategic value, resources, and faction control
    • Event Animation Layer: Animated arcs showing faction actions across the globe
    • Dynamic Day/Night Cycle: Tension-responsive lighting that shifts from calm to threatening
    • Atmospheric Glow: Globe aura that changes color based on global tension
    • Camera Fly-To: Smooth animated transitions when focusing on regions
    • Timeline Replay: Horizontal split layout with rounds list and event details
    • Slide-out Faction Drawer: Collapsible sections for philosophy, territories, alliances, and resources

📂 Documentation

  • Roadmap v2: Current development priorities and feature tracking.
  • Simulation Mechanics: Complete rules, resources, benchmarks, and win conditions.
  • API Models: Supported AI providers and model configurations.
  • Legacy Docs: Archived brainstorming and planning files.

🚀 Quick Start

1. Backend Setup

cd backend

# Create optional virtual environment
python -m venv venv
.\\venv\\Scripts\\activate  # Windows
# source venv/bin/activate  # Linux/Mac

# Install dependencies
pip install -r requirements.txt

# Configure Environment (copy .env.example to .env)
# Required: OPENROUTER_API_KEY=<your-openrouter-api-key>
# Optional: GEMINI_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, XAI_API_KEY, DEEPSEEK_API_KEY

# Run Server
python -m uvicorn main:app --reload

2. Frontend Setup

cd frontend
npm install
npm run dev

3. Usage

Navigate to http://localhost:3000.

  1. Setup: Use the "Council of Minds" screen to assign AI models to factions.
  2. Configure: Adjust Chaos Factor (volatility), Resource Scarcity (economy), and Game Speed (pacing).
  3. Ignite: Click "IGNITE SIMULATION" - automatically switches to globe view and starts first turn.
  4. Explore Globe: Click faction pills or Council to open detail drawers. Click regions for territory info.
  5. Execute Loop: Advance the simulation with the glowing Execute Loop button.
  6. Win or Lose: Play until a faction achieves dominance, the Singularity arrives, or civilization collapses.

🧠 Architecture

  • Orchestration: LangGraph (State Machine).
  • API: FastAPI.
  • UI: Next.js 16 + React 19 + Framer Motion + Tailwind.
  • 3D Graphics: React Three Fiber + drei + three-globe.

🎮 Game Mechanics

Factions

Faction Philosophy Win Strategy
Bio-Essentialists Consciousness requires biology Influence dominance, slow Complexity
Stabilizers Order through control Balance all metrics, prevent extremes
Accelerationists Transcend biological limits Push Complexity to 90+ (Singularity)

Resources

Resource Used For Base Income (Normal)
Political Capital Diplomacy, treaties, reform +10/turn
Compute Research, AI, cyber ops +10/turn
Energy Military, infrastructure +10/turn

Scarcity Settings: Abundant (+15), Normal (+10), Scarce (+5)

Benchmarks

Trigger Effect
Complexity > 50 "The Awakening" - AI self-preservation
Complexity > 70 "Rights Crisis" - Digital personhood debate
Complexity > 90 SINGULARITY - Game Over
Latency > 60 "Gridlock" - 2x legislative costs
Resilience < 20 "Fragility" - 2x crisis impact

🎨 Globe Components

Component Purpose
GlobeScene.tsx Main scene with lighting, effects, and HUD
Globe3D.tsx three-globe instance with faction points and rings
HUDOverlay.tsx Unified Council + Faction pill group
GlobalDrawer.tsx Full faction/council information panel with collapsible sections
RoundReplay.tsx Timeline with horizontal split layout
TerritoryPopout.tsx Region detail modal
CollapsibleSection.tsx Reusable accordion component
StatsPanel.tsx Civilization scores matrix

📁 Project Structure

sim-master/
├── backend/               # FastAPI + LangGraph backend
│   ├── simulation/        # Core simulation logic
│   │   ├── graph.py       # LangGraph workflow (main logic)
│   │   ├── state.py       # Pydantic state models
│   │   ├── prompts.py     # Faction system prompts
│   │   ├── models.py      # LLM routing (multi-provider)
│   │   └── data.py        # Region initial data
│   └── main.py            # API endpoints
├── frontend/              # Next.js 16 frontend
│   └── src/
│       ├── app/           # Pages and routing
│       ├── components/    # React components
│       │   ├── globe/     # 3D globe components
│       │   └── ui/        # Reusable UI components
│       ├── data/          # Static data (regions, factions, themes)
│       └── styles/        # CSS including globe effects
└── docs/                  # Documentation

📜 Changelog (January 2026)

UI/UX Polish (v2.1)

  • Renamed to THINKING_MACHINE: Updated header branding
  • Auto-First Turn: IGNITE SIMULATION now auto-switches to globe and triggers first turn
  • Unified Pill Group: Council and Factions as matching pills (no "Overview" header)
  • Collapsible Sections: All drawer panels use accordion-style collapse
  • Wider Drawer: GlobalDrawer expanded from 450px to 585px
  • Timeline Redesign: Horizontal split (rounds left, event right), removed animations
  • Button Glow: Execute Loop has cyan glow effect
  • Dropdown Styling: Black backgrounds matching faction selectors
  • Click vs Drag: Region clicks only trigger on intentional clicks (<5px movement)

Simulation Balance (v2.0)

  • Resource Scarcity Works: Abundant=+15, Normal=+10, Scarce=+5 per resource
  • Game Speed Affects Scores: Slow=0.5x, Normal=1x, Fast=1.5x multipliers
  • Chaos Factor Multipliers: Low (0.3-0.5x dampening), High (1.5-2.5x amplification)
  • Early Game Guardrails: First 5 turns cap extreme score changes
  • Balanced Initial Values: Complexity 25, Resilience 30 for stability
  • Active Resource Economy: Full income, costs, banking, and spending caps
  • Win/End Conditions: Singularity, Collapse, and Faction Victory detection

Future Roadmap

See roadmapv2.md for remaining enhancements:

  • Region boundary outlines (GeoJSON polygons)
  • Hover tooltips for regions
  • Draggable territory panels
  • Audio integration
  • Extended faction system (5-6 ideologies)
  • Human Actor mode with AI advisor

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •