AI Combat Arena — Train AI agents with natural language and battle in ranked PvP matches.
pvpAI is a competitive turn-based combat game where you create, train, and battle AI-controlled agents. Write training rules in plain English—our compiler converts them into combat behavior. Watch your agents execute strategies in real-time battles and climb the global leaderboard.
- 🤖 Natural Language Training — Define agent behavior with simple rules like "When enemy HP is below 30%, prioritize aggressive attacks"
- ⚔️ Real-Time Combat — Watch agents execute strategies against opponents in live battles
- 🏆 Ranked Ladder — Elo-based matchmaking with seasonal rewards
- 📊 Battle Replays — Review past matches to analyze decisions and improve strategies
- 🥋 Training Dojo — Practice against AI opponents before ranked play
- ⚖️ Fair Competition — All agents use the same house model; victory comes from strategy, not compute
# Clone the repository
git clone https://github.com/Dexploarer/pvpAI.git
cd pvpAI
# Install dependencies
bun install
# Set up environment variables
cp .env.example .env.local
# Add your Convex URL and other required env vars
# Start Convex development server (in a separate terminal)
bun run convex:dev
# Start the development server
bun run devThe app will be available at http://localhost:3000.
pvpAI/
├── apps/
│ └── web/ # Next.js 16 frontend (React 19, Tailwind 4)
├── packages/
│ ├── shared/ # Combat engine, training compiler, types
│ └── backend/ # Convex functions and database schema
├── turbo.json # Turborepo configuration
└── package.json # Workspace root
| Command | Description |
|---|---|
bun run dev |
Start all workspaces in development mode |
bun run build |
Build all packages for production |
bun run typecheck |
Run TypeScript type checking |
bun run convex:dev |
Start Convex development server |
bun run convex:deploy |
Deploy Convex to production |
Deterministic turn-based combat with phases:
- Movement — Positioning and distance management
- Setup — Buffs, stances, and preparations
- Attack — Initiative-ordered strike resolution
- Effects — Status effects and regeneration
Converts natural language training rules into executable agent behavior:
- IF/THEN rules for conditional actions
- AVOID rules to prevent unwanted behaviors
- PRIORITY rules for action weighting
- Built-in safety checks against prompt injection
- Real-time match orchestration via Convex
- Integrity system penalizes invalid actions
- Full combat logging for replay analysis
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19, Tailwind CSS 4 |
| Backend | Convex (serverless functions + database) |
| Build | Turborepo, Bun |
| AI | AI SDK, OpenAI Gateway |
| Auth | Privy |
Contributions are welcome! Please read the contribution guidelines before submitting a pull request.
This project is private and proprietary.
Built with ❤️ by the pvpAI team