An AI-powered tool for designing and generating RimWorld bases using real prefabs from the AlphaPrefabs mod, with natural language understanding and Claude AI integration.
- Python 3.8+ installed
- Poetry for dependency management
- AlphaPrefabs mod (optional but recommended)
# 1. Clone the repository
git clone https://github.com/yourusername/rimworldbuilder.git
cd rimworldbuilder
# 2. Install dependencies with Poetry
poetry install
# 3. (Optional) Clone AlphaPrefabs for full functionality
cd data
git clone https://github.com/juanosarg/AlphaPrefabs.git
cd ..
# 4. (Optional) Set up Claude API key for AI features
# Windows:
set ANTHROPIC_API_KEY=your-api-key-here
# Linux/Mac:
export ANTHROPIC_API_KEY=your-api-key-herestart.batchmod +x start.sh
./start.shpoetry run python rimworld_assistant.pypoetry run python rimworld_assistant_gui.pyWhen you launch the CLI, you'll see this menu:
==================================================
MAIN MENU
==================================================
1. Load Save File
2. Analyze Current Base
3. Generate from Natural Language
4. Generate with Prefab Anchors
5. Generate Enhanced Hybrid Base
6. AI-Designed Base (Claude)
7. Smart Generate (NLP โ Prefabs) โ RECOMMENDED
8. Visualize Last Generation
9. Interactive Layer Viewer
*. Export Base Design
0. Exit
This is the most advanced generation method:
-
Describe your base in plain English:
> defensive base for 10 colonists with hospital and workshops -
The system will:
- Parse your requirements using NLP
- Optionally use Claude AI for detailed planning
- Match requirements to real RimWorld prefabs
- Intelligently place prefabs with proper adjacency
- Fill remaining space with corridors
- Save a PNG visualization
- Save File Parser: Full .rws save file parsing with terrain decompression
- Natural Language Interface: Describe bases in plain English
- Claude AI Integration: Intelligent base planning with Claude API
- Prefab System: Uses 100+ real bases from AlphaPrefabs mod
- Smart Generation: Matches requirements to prefabs intelligently
- Multiple Generators: WFC, hybrid, prefab-based options
- Real-time Progress: Spinners, progress bars, and status updates
- Cross-platform: Works on Windows, Linux, and macOS
defensive base for 8 colonists with killbox and medical bay
efficient production base with 4 workshops, large storage, and minimal bedrooms
spacious base for 12 colonists with recreation room, dining hall, and individual bedrooms
Place your RimWorld save files (.rws) in:
data/saves/
The tool will automatically detect and list them when loading.
Generated bases are saved as PNG images:
smart_generated.png- From Smart Generatenlp_generated.png- From Natural Languageai_designed.png- From AI Design
# Parse a save file
poetry run python scripts/test_parser.py
# Test visualization
poetry run python scripts/full_map_visualize.py
# Test progress indicators
poetry run python scripts/test_progress.pyRun from the project root directory, not from scripts/
Clone AlphaPrefabs into data/ directory:
cd data
git clone https://github.com/juanosarg/AlphaPrefabs.gitThe system automatically falls back to ASCII characters if Unicode isn't supported.
The tool loads entire saves into memory. For very large saves (100MB+), ensure you have sufficient RAM.
- Ensure you have set the ANTHROPIC_API_KEY environment variable
- Check you have API credits available
- The system will fall back to non-AI generation if API is unavailable
rimworldbuilder/
โโโ rimworld_assistant.py # Main CLI interface
โโโ rimworld_assistant_gui.py # GUI interface
โโโ src/
โ โโโ parser/ # Save file parsing
โ โโโ models/ # Data models
โ โโโ generators/ # Base generation algorithms
โ โ โโโ wfc_generator.py # Wave Function Collapse
โ โ โโโ hybrid_prefab_generator.py
โ โ โโโ requirements_driven_generator.py # Smart generation
โ โโโ nlp/ # Natural language processing
โ โโโ ai/ # Claude AI integration
โ โโโ utils/ # Progress indicators & symbols
โโโ scripts/ # Utility scripts
โโโ data/
โ โโโ saves/ # Place .rws files here
โ โโโ AlphaPrefabs/ # Clone from GitHub
โโโ docs/ # Documentation
Feel free to submit issues and enhancement requests!
- AlphaPrefabs Mod - Source of prefab designs
Made with โค๏ธ for the RimWorld community