Where llamas keep the darkest secrets... and now they can hear yours too! ๐ฆ๐๏ธ
Welcome to GoFigure, the most immersive murder mystery experience in your terminal! Powered by Ollama AI for intelligent character interactions and now featuring Google Speech-to-Text for voice-enabled interviews.
GoFigure transforms your terminal into a noir detective story where you interrogate AI-powered suspects using either your keyboard or your voice. Each character has their own personality, secrets, and motivations - and they might just lie to your face!
- Dynamic conversations with Ollama-powered suspects
- Each character has unique personalities and knowledge
- Some characters are reliable, others... not so much
- Push-to-talk functionality during character interviews
- Powered by Google Cloud Speech-to-Text
- Seamlessly switch between typing and speaking
- Support for multiple languages
- Characters respond with realistic voices
- Google Cloud TTS integration
- Different voice models for different characters
- Narrator voice reads the mystery introduction aloud
- Interview suspects to gather clues
- Make accusations when you think you've solved it
- Two compelling mysteries with different settings and complexity
- JSON-based mystery scenarios (easily customizable!)
- ๐ฐ The Blackwood Manor Murder - Classic English manor mystery with aristocratic intrigue
- ๐ข Death on the Aurora Star - Complex cruise ship thriller with international suspects and red herrings
- Ollama running locally with a model (e.g.,
llama3.2) - Google Cloud credentials (optional, for voice features)
- Go 1.23+
# Clone the repository
git clone https://github.com/tahcohcat/gofigure.git
cd gofigure
# Build the game
go build -o gofigure ./cmd/gofigure
# Play a mystery with voice enabled!
./gofigure play data/mysteries/cruise_ship.json --mic# Play the classic manor mystery
./gofigure play data/mysteries/blackwood.json
# Try the cruise ship thriller (with twists!)
./gofigure play data/mysteries/cruise_ship.json --mic
# Check your configuration
./gofigure confighelp- Show available commandslist- List all characters in the mysteryinterview <character>- Start questioning a suspectaccuse <name> <weapon> <location>- Make your final accusationexit- Quit the game
When you start an interview with --mic enabled:
- Automatic voice mode - No need to type "mic" every time!
- Press ENTER to record each question
- Seamless flow - Ask questions naturally with your voice
- Switch modes - Type 'text' to switch to typing, 'voice' to switch back
๐ญ You are now interviewing Lady Blackwood
๐๏ธ Voice mode enabled - Press ENTER to record questions
๐๏ธ Press ENTER to ask a question: [Press ENTER]
Q: mic ๐๏ธ Press ENTER to start recording...
๐ด Recording... Press ENTER to stop You asked: What were you doing at the time of the murder?
๐ญ Character: Well, detective, I was in the library reading...
๐๏ธ Press ENTER to ask a question: [Press ENTER again for next question]
### ๐๏ธ Immersive Audio Experience
When TTS is enabled, the game provides a rich audio experience:
- **๐ฌ Narrator** reads the mystery introduction in a distinguished voice
- **๐ญ Characters** speak their responses with unique voice models
- **๐ Welcome messages** are announced dramatically
๐ Welcome Detective! You are investigating: The Blackwood Manor Murder [Narrator voice speaks the welcome and introduction]
## โ๏ธ Configuration
Create a `config.yaml` file:
```yaml
ollama:
host: "http://localhost:11434"
model: "llama3.2"
timeout: 50
tts:
enabled: true
type: "google"
sst:
enabled: true # Enable voice input
provider: "google"
language_code: "en-US" # or "en-GB", "es-ES", etc.
sample_rate: 16000
- Create a Google Cloud project
- Enable Speech-to-Text and Text-to-Speech APIs
- Create a service account with appropriate permissions
- Download the JSON key file
- Set the environment variable:
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/credentials.json"โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Your Voice โโโโโถโ Google STT โโโโโถโ Game Engine โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Your Speakers โโโโโโ Google TTS โโโโโโ Ollama LLM โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
- Game Engine (
internal/game/) - Core mystery logic - SST Service (
internal/sst/) - Speech-to-Text integration - TTS Service (
internal/tts/) - Text-to-Speech integration - Ollama Client (
internal/ollama/) - AI character conversations - Config System (
config/) - YAML-based configuration
Mysteries are defined in JSON format. Here's the structure:
{
"title": "The Case of the Missing Cookies",
"killer": "Butler",
"weapon": "Rolling Pin",
"location": "Kitchen",
"introduction": "The cookies have vanished...",
"narrator_tts": [
{
"engine": "google",
"model": "en-GB-Chirp3-HD-Charon"
}
],
"characters": [
{
"name": "Chef Williams",
"personality": "Anxious and defensive",
"knowledge": [
"I was preparing dinner when the cookies disappeared",
"The butler seemed suspicious lately"
],
"reliable": true,
"tts": [
{
"engine": "google",
"model": "en-US-Chirp3-HD-Mason"
}
]
}
]
}gofigure/
โโโ cmd/
โ โโโ gofigure/ # Main application
โ โโโ test-google-sst/ # SST testing tool
โโโ internal/
โ โโโ game/ # Core game logic
โ โโโ sst/ # Speech-to-Text
โ โโโ tts/ # Text-to-Speech
โ โโโ ollama/ # Ollama integration
โ โโโ logger/ # Logging utilities
โโโ config/ # Configuration management
โโโ data/mysteries/ # Mystery scenario files
โโโ docs/ # Documentation
# Install dependencies
go mod download
# Run tests
go test ./...
# Build
go build -o gofigure ./cmd/gofigure
# Cross-compile for different platforms
GOOS=linux GOARCH=amd64 go build -o gofigure-linux ./cmd/gofigure
GOOS=windows GOARCH=amd64 go build -o gofigure.exe ./cmd/gofigure
GOOS=darwin GOARCH=amd64 go build -o gofigure-mac ./cmd/gofigure"No microphone detected"
- Check system permissions
- Ensure microphone isn't used by other apps
"Google authentication failed"
- Verify
GOOGLE_APPLICATION_CREDENTIALSis set - Check service account permissions
"Ollama connection failed"
- Start Ollama:
ollama serve - Pull a model:
ollama pull llama3.2
"Poor speech recognition"
- Speak clearly at moderate pace
- Reduce background noise
- Check microphone quality
export GOFIGURE_LOG_LEVEL=debug
./gofigure play mystery.json --mic --show-responsesWe welcome contributions! Here are some ideas:
- ๐ญ New mystery scenarios - Create engaging cases
- ๐ Language support - Add more language codes
- ๐ค Audio improvements - Noise reduction, better detection
- ๐ค AI enhancements - Better character personalities
- ๐ง Platform support - Windows/Linux testing
git clone https://github.com/tahcohcat/gofigure.git
cd gofigure
go mod download
go run ./cmd/gofigure play data/mysteries/blackwood.jsonThis project is licensed under the MIT License - see the LICENSE file for details.
- Ollama - For making local AI accessible
- Google Cloud - For excellent Speech and TTS APIs
- gen2brain/malgo - For cross-platform audio capture
- spf13/cobra - For the CLI framework
- spf13/viper - For configuration management
- audio soundtrack - Credit Kesha. Not for modified distribution or commercial use
Try these voice commands during interviews:
- "What's your alibi for last night?"
- "Did you see anything suspicious?"
- "Where were you when the lights went out?"
- "Tell me about your relationship with the victim."
Enable TTS to experience atmospheric introductions:
๐ฐ Blackwood Manor: ๐ฌ "It is a stormy evening at Blackwood Manor. The guests have gathered for Lady Blackwood's birthday celebration when a terrible cry echoes through the corridors..."
๐ข Aurora Star Cruise:
๐ฌ "The luxury cruise ship Aurora Star glides through the Mediterranean under a blanket of stars. At 11:32 PM, during the height of the festivities, a blood-curdling scream pierces through the music..."
Each mystery has its own distinct narrator setting the perfect mood!
Please open an issue with:
- Your OS and Go version
- Steps to reproduce
- Expected vs actual behavior
- Log output (with
--show-responsesflag)
Happy detecting, and may your voice be heard! ๐ต๏ธโโ๏ธ๐๏ธ
P.S. - The llamas are always watching... ๐ฆ๐