An interactive text-based RPG game based on J.R.R. Tolkien's works, where you control Bilbo Baggins in his journey through Middle-earth. The game uses AI (Claude) to generate dynamic narratives and character reactions.
🎭 Living Character System: Bilbo isn't just a player avatar - he has his own personality, emotions, plans, and thoughts that evolve based on your actions. Your decisions shape his character development, while his current state influences how he perceives and reacts to the world around him, just like in real life!

- 🎮 Interactive RPG with full immersion in Tolkien's world
- 🎭 Living Character System - Bilbo has personality, emotions, plans and thoughts that evolve
- 🔄 Bidirectional Influence - your actions shape Bilbo's character, his state affects his reactions
- 🌍 Multilingual support - complete support for Russian, English and Spanish
- 💾 Manual/automatic saves - play with it to get the desirable setting
- 🧠 Bilbo's Personal Memory - stores Bilbo's subjective memories of events
- 😃 Fun - incredibly fun!
- 🌿 Therapy - very meditative and relaxing
- Node.js (version 18 or higher)
- Claude API key from Anthropic
- Claude Sonnet 3.5 or newer model (required for proper game functionality)
-
Clone the repository
git clone https://github.com/your-username/hobbit_game.git cd hobbit_game
-
Install dependencies
npm install
-
Configure the game
cp game.json.example game.json
Edit
game.json
and replace"your-claude-api-key-here"
with your actual Claude API key. -
Run the game
Option A - Automatic (Windows):
start-game.bat
Option B - Manual:
npm run dev # Development mode # OR npm run build # Build for production npm run start # Run production server
-
Open your browser and go to: http://localhost:5000
npm run dev # Start development server with hot reload
npm run build # Build for production
npm run start # Start production server
/
├── src/
│ ├── App.tsx # Main game component
│ ├── main.tsx # React initialization with i18n
│ ├── i18n/
│ │ └── index.ts # react-i18next configuration
│ └── index.css # Tailwind CSS imports
├── server/
│ └── index.ts # Express server with API endpoints
├── public/
│ └── locales/ # Translation files (ru/en/es)
│ ├── ru/ # Russian (common.json, state.json, prompt.md)
│ ├── en/ # English (common.json, state.json, prompt.md)
│ └── es/ # Spanish (common.json, state.json, prompt.md)
├── memory_db/ # LanceDB vector database
├── package.json # Dependencies and scripts
├── game.json.example # Configuration template
└── start-game.bat # Quick start script
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: Node.js + Express + TypeScript
- AI Integration: Claude API (Anthropic)
- Internationalization: react-i18next
- Vector Database: LanceDB with semantic memory search
- Build Tools: Vite, PostCSS
The game.json
file contains minimal essential settings:
{
"api": {
"anthropic": {
"apiKey": "your-claude-api-key-here",
"baseUrl": "https://api.anthropic.com/v1/messages"
}
},
"game": {
"model": "claude-3-5-sonnet-20241022"
}
}
All language settings are handled by react-i18next configuration.
- Create folder
public/locales/{language_code}/
- Copy translation files from existing language (ru/en/es)
- Translate all content:
common.json
,state.json
,prompt.md
- Add language to
src/i18n/index.ts
supportedLngs array - Add option to language switcher in
src/App.tsx
"game.json not found"
- Make sure you copied
game.json.example
togame.json
"API key not configured"
- Check that your Claude API key is properly set in
game.json
- Ensure you have sufficient credits in your Anthropic account
Translation errors
- Verify all files in
public/locales/
have valid JSON syntax - Make sure all language folders have all required files (common.json, state.json, prompt.md)
Save incompatibility issues
- Save files may be incompatible between different game versions
- If you experience errors when loading saves, clear browser cookies
- Start a new game if save loading continues to fail
This project is open source. Feel free to fork, modify, and share!
- J.R.R. Tolkien - for creating the incredible world of Middle-earth
- Anthropic - for providing the Claude AI that brings the world to life
"In a hole in the ground there lived a hobbit..."