Skip to content

The-Pocket/PocketFlow-Tutorial-Danganronpa-Simulator

Repository files navigation

Play Among Us-like Game with AI Agents

License: MIT Made with Streamlit Powered by PocketFlow Join Discord

Ever wondered what happens when super-smart AI isn't just a tool, but a player in a crazy game of lies, strategy, and survival? This Danganronpa Simulator puts 12 AI agents against each other in a text-based social deduction game - think Mafia, Among Us, or Goose Goose Duck, but where every character is controlled by an AI with its own unique personality and motivations.

Pocket Flow Danganronpa Simulator Banner

🎮 Play the Game Now: https://danganronpa.app/ 🎮

🕹️ Gameplay Introduction: Unleash AI into the Killing Game!

If LLMs are smart, why do many AI interactions in games still feel a bit... meh? We think the secret sauce is giving AIs more personality and putting them in a game that forces them to show it. So, we built The Danganronpa Simulator!

Why Danganronpa? Because it's the perfect pressure cooker for AI!

  • Wild, Built-in Characters: From the "Ultimate Detective" to the "Ultimate Supreme Leader," these aren't boring roles; they're deep character studies waiting for an AI to jump in.

  • Gameplay That Creates Drama and Deception: The constant danger and public accusations force AIs to think strategically, team up, betray each other, and fight for their (virtual) lives.

So, How Does This Game Actually Work? 12 (AI) players are thrown into this high-stakes game of survival and deception - think Mafia, Among Us, or Goose Goose Duck. Here's a look at how it unfolds:

Danganronpa Game Rules Summary: Hope vs Despair

Meet the "Ultimate" Students: These are some of the characters you might encounter, each with their own unique personalities and talents, ready to be embodied by our AI agents:

Grid of Danganronpa Character Profiles

Watch Recorded Gameplay: Immerse yourself in the AI-driven chaos! Check out our playlist:

▶️ Danganronpa AI Simulator Gameplay Playlist

🚀 Host the Game Yourself

Want to run the Danganronpa Simulator on your own machine?

  1. Clone the Repository:

    git clone https://github.com/The-Pocket/PocketFlow-Tutorial-Danganronpa-Simulator
    cd PocketFlow-Tutorial-Danganronpa-Simulator
  2. Install Dependencies: (Python 3.8+ required)

    pip install -r requirements.txt
  3. Set Up Your LLM:

    • Option 1: Gemini 2.5 Flash (Recommended)

      This project uses Google Gemini by default. You can either:

      • Set your own environment variables for Vertex AI: GEMINI_PROJECT_ID and GEMINI_LOCATION.
      • Or, get a key from Google AI Studio and set the GEMINI_API_KEY environment variable.
    • Option 2: Use Other LLMs

      Feel free to use other LLMs like OpenAI, Anthropic, or even local Llama models. You will need to modify the call_llm_async function in utils/call_llm.py. It should be an async function that takes a prompt (string) as input and returns the LLM's response (string).

      See more on implementing LLM utility functions for PocketFlow: PocketFlow LLM Utility Guide

    You can verify if your LLM setup works by running:

    python utils/call_llm.py
  4. Run the Streamlit App:

    streamlit run app.py

    Open your browser to the local URL provided (usually http://localhost:8501).

💡 Development Tutorial

I built using Agentic Coding, the fastest development paradigm, where humans simply design and agents code.

The secret weapon is Pocket Flow, a 100-line LLM framework that lets Agents (e.g., Cursor AI) build for you.

Check out the Step-by-step YouTube development tutorial:


  • app.py: The main Streamlit application; handles UI, game state, and orchestrates agent turns.
  • flow.py: Defines PocketFlow execution flows for AI agents (sequential/parallel decisions).
  • nodes.py: Implements the DecisionNode, the core AI logic where characters think and act.
  • utils/call_llm.py: Utility for asynchronous calls to the LLM.
  • assets/: Contains static assets:
    • assets/texts.py: Character intros, Monokuma's dialogue, etc.
    • Character folders (e.g., assets/Shuichi/): Sprites and voice lines.
  • docs/design.md: The comprehensive design document.

About

Danganronpa Simulator: Play Among Us-like Game with AI Agents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published