ewardGPT/casefile-noir

โ˜… 0Forks 1JavaScriptGitHub โ†—Compare

README

๐Ÿ•ต๏ธ Casefile Noir

Casefile Noir Start Menu

A noir detective RPG powered by Gemini AI

Built for the Gemini 3 Hackathon | Play Demo | Features

Phaser 3 Gemini AI License


๐Ÿ“– About

Casefile Noir is an immersive top-down detective RPG that combines classic pixel art aesthetics with cutting-edge AI. Players step into the shoes of a 1940s detective, investigating crimes by collecting evidence, interrogating suspects, and using Gemini AI to detect contradictions and solve cases.

๐ŸŽฏ Built For

This project was created for the Gemini 3 Hackathon, showcasing how AI can enhance gameplay through:

  • Dynamic contradiction detection using Gemini's reasoning capabilities
  • Intelligent NPC dialogue generation
  • Context-aware evidence analysis

โœจ Features

๐ŸŽฎ Core Gameplay

  • Top-down RPG exploration with smooth WASD/Arrow key controls
  • Evidence collection system with interactive notebook UI
  • Suspect interrogation with branching dialogue trees
  • AI-powered contradiction detection that analyzes player-collected evidence against suspect statements

๐ŸŽจ Visual & Audio

  • Atmospheric noir aesthetic with rain effects and day/night cycles
  • Dynamic minimap with full-screen toggle (press M)
  • Synthesized ambient soundtrack with noir-themed background music
  • Grain & vignette post-processing for authentic film noir feel

๐Ÿค– AI Integration

  • Gemini-powered logic engine for case solving
  • Real-time contradiction analysis between evidence and testimonies
  • Intelligent hint system when players are stuck

๐Ÿ—บ๏ธ Technical Highlights

  • Procedural NPC spawning with A* pathfinding
  • Advanced collision detection with stair navigation
  • Tiled map integration with 50+ custom layers
  • Responsive UI with mobile-friendly controls

๐Ÿš€ Quick Start

Prerequisites

Installation

  1. Clone the repository
git clone https://github.com/yourusername/casefile-noir.git
cd casefile-noir
  1. Set up the backend
cd server
npm install

# Create .env file
echo "GEMINI_API_KEY=your_api_key_here" > .env

npm run dev
  1. Set up the frontend
cd ../client
npm install
npm run dev
  1. Open the game Navigate to http://localhost:5173 in your browser

โš ๏ธ IMPORTANT: Always use npm run dev to start the Vite dev server. Do NOT use Python's http.server or any other static file server - Vite is required to bundle Phaser and process ES modules.


๐ŸŽฎ Controls

Key Action
WASD / Arrow Keys Move detective
E Interact with evidence/NPCs
M Toggle full-screen map
F7 Toggle minimap visibility
K Mute/unmute audio
F2 Toggle debug overlay
F3 Toggle physics debug
F4 Toggle NPC debug markers

๐Ÿ—๏ธ Tech Stack

Frontend

  • Phaser 3 - Game engine
  • Tiled - Map editor
  • Vite - Build tool
  • Web Audio API - Synthesized music

Backend

  • Node.js + Express - API server
  • Google Gemini API - AI logic engine
  • Multer - File upload handling

Tools & Assets

  • Python scripts - Sprite processing & map validation
  • Custom tileset - Victorian-era pixel art
  • A pathfinding* - NPC navigation

๐Ÿ“‚ Project Structure

casefile-noir/
โ”œโ”€โ”€ client/                 # Frontend Phaser game
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ scenes/        # Game scenes (StartMenu, Game, etc.)
โ”‚   โ”‚   โ”œโ”€โ”€ utils/         # Utilities (AudioManager, Minimap, etc.)
โ”‚   โ”‚   โ””โ”€โ”€ ui/            # UI components (Notebook, Evidence Modal)
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ”‚   โ””โ”€โ”€ assets/        # Sprites, maps, tilesets
โ”‚   โ””โ”€โ”€ index.html
โ”œโ”€โ”€ server/                # Backend API
โ”‚   โ”œโ”€โ”€ routes/            # Express routes
โ”‚   โ”œโ”€โ”€ services/          # Gemini integration
โ”‚   โ””โ”€โ”€ server.js
โ””โ”€โ”€ README.md

๐ŸŽฏ How It Works

  1. Evidence Collection: Players explore the Victorian city, interacting with objects marked with glowing indicators
  2. Interrogation: NPCs can be questioned, with responses generated dynamically
  3. AI Analysis: When ready, players submit their evidence to Gemini, which analyzes contradictions
  4. Case Resolution: The AI provides hints or confirms the solution based on collected evidence

๐Ÿค Contributing

This is a hackathon project, but contributions are welcome! Feel free to:

  • Report bugs via Issues
  • Suggest features
  • Submit pull requests

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments

  • Google Gemini Team for the incredible AI API
  • Phaser Community for excellent documentation
  • Tiled Map Editor for the powerful tilemap tools
  • OpenGameArt for inspiration on pixel art assets

Made with โ˜• and ๐ŸŽฎ for the Gemini 3 Hackathon

โฌ† Back to Top

Contributors

ewardGPT

Issues