An open API service indexing awesome lists of open source software.

https://github.com/murikisaisrinivas/negotiatewithai

The AI Negotiation Game is an interactive, text-based negotiation game where players must persuade an AI-controlled villain to agree to a deal. The game is built using Google Gemini AI for dynamic conversations and Reddit's Devvit API for integration with Reddit's interactive posts.
https://github.com/murikisaisrinivas/negotiatewithai

css devvit game-development gemini-api html-css-javascript interactive-post javascript negotiation reddit

Last synced: 3 months ago
JSON representation

The AI Negotiation Game is an interactive, text-based negotiation game where players must persuade an AI-controlled villain to agree to a deal. The game is built using Google Gemini AI for dynamic conversations and Reddit's Devvit API for integration with Reddit's interactive posts.

Awesome Lists containing this project

README

          

# AI Negotiation Game

## 📌 Overview
The **AI Negotiation Game** is an interactive, text-based negotiation game where players must persuade an AI-controlled villain to agree to a deal. The game is built using **Google Gemini AI** for dynamic conversations and **Reddit's Devvit API** for integration with Reddit's interactive posts.

## 🎯 Features
- **AI-Generated Scenarios**: Unique negotiation storylines with dynamic villains.
- **Limited Responses**: Players can only send **5 messages** with a character limit per message.
- **Adaptive AI**: The villain responds based on **personality, motivations, and player arguments**.
- **Final Verdict & Feedback**: AI determines if the player **won or lost** and provides constructive feedback.
- **Reddit Integration**: Players can post their negotiation logs on Reddit for community voting.

## 🛠️ Tech Stack
- **Google Gemini AI** - AI-driven responses and decision-making.
- **Reddit Devvit API** - Interactive post integration.
- **TypeScript/JavaScript** - Backend logic for game processing.

## 🚀 Installation & Setup
### 1️⃣ Clone the Repository
```bash
git clone https://github.com/MurikiSaiSrinivas/negotiatewithai.git
cd negotiatewithai
```

### 2️⃣ Install Dependencies
```bash
npm install
```

### 3️⃣ Set Up Environment Variables
Add the gemini-api-key to the secret storage:
```bash
devvit settings set gemini-api-key
```

### 4️⃣ Run the Devvit App
```bash
devvit playtest negotiatewithai
```

### 4️⃣ Open the Devvit App
URL: [https://www.reddit.com/r/negotiatewithai/?playtest=negotiatewithai](https://www.reddit.com/r/negotiatewithai/?playtest=negotiatewithai)

## 📜 Game Flow
1. **Start Game** → AI generates a **scenario, villain profile, and first message**.
2. **Player Negotiates** → Sends up to **5 messages**, villain responds dynamically.
3. **Final Verdict** → AI determines if the negotiation was successful and provides feedback.
4. **Share on Reddit** → Players can post the conversation to Reddit for community votes.
5. **Restart** → Users can start a **new negotiation scenario** anytime.

## 🎮 Example Gameplay
### **Example Scenario (Generated by AI):**
```plaintext
The year is 2099. A notorious hacker named Razor has stolen classified government files. You, an intelligence officer, must convince Razor to return the files without leaking them.

Villain: "Well, well, looks like the government finally sent someone who wants to talk. What do you have for me?"
```
### **Player Response:**
```plaintext
"I can offer you partial immunity if you return the files."
```
### **Villain Response:**
```plaintext
"Hah! Immunity from what? You think I’m scared of your justice system? Give me something real, or this conversation is over."
```
### **Final Verdict:**
```plaintext
"Fine. You drive a hard bargain, but I’ll take it. Just make sure I get out of here safely."
Verdict: WIN ✅
Feedback: "You used logic well, but next time, start with a lower offer to have room to negotiate up."
```

## 🔥 Future Enhancements
- **Multiplayer Mode** - Team-based negotiations.
- **Leaderboards** - Ranking system for best negotiators.
- **More Negotiation Styles** - Aggressive, passive, logical approaches.

---
🚀 **Ready to negotiate? Start playing now in [r/negotiatewithai](https://www.reddit.com/r/negotiatewithai/)!**