Quick Start Guide - AI Player Mod
Setup (5 minutes)
Step 1: Install LM Studio
- Download LM Studio from https://lmstudio.ai/
- Install and launch LM Studio
- In LM Studio, download the Qwen3-VL-4B model
- Click "Start Server" (usually on port 1234)
- Load the Qwen3-VL-4B model in the server
Step 2: Start the Bridge
Run the Start_bridge.VBS. This will create and install the necessary files.
Or you can run it manually As shown below.
Windows (PowerShell):
python -m pip install requests factorio-rcon
python lm_studio_bridge.py
macOS/Linux:
python3 -m pip install requests factorio-rcon
python3 lm_studio_bridge.py
Keep the terminal window open — it bridges Factorio to LM Studio via RCON. You should see "Bridge is running. Waiting for requests...".
Step 3: Launch Factorio
- Start Factorio
- Enable the "AI Player" mod if not already enabled
- Start or load a game (single-player or multiplayer with RCON enabled)
Step 4: Spawn the AI
- Open console with
~key (tilde) - Type:
/spawn-ai-player - Press Enter
What to Expect
The AI player will:
- Appear as a separate character in your world
- Start exploring and gathering resources
- Mine trees, rocks, and ore deposits
- Build basic structures
- Defend itself from enemies
- Occasionally chat about its status
Console Commands
| Command | Description |
|---|---|
/spawn-ai-player |
Create/reset the AI player |
/remove-ai-player |
Remove the AI player |
/goto-ai-player |
Teleport to the AI's location |
Troubleshooting
AI isn't moving:
- Check the bridge script is running
- Verify LM Studio server is active (green indicator)
- Check console for error messages
Bridge shows errors:
- Ensure LM Studio is running on port 1234
- Check the model is loaded in LM Studio
- Verify Python and requests library are installed
AI keeps dying:
- Enable auto-respawn in mod settings
- Give the AI some starting defenses
- Clear enemies near spawn point
Performance issues:
- Increase tick interval in mod settings (Settings → Mod Settings → Map)
- Reduce vision radius
- Lower LM Studio's token limit
Advanced Configuration
Edit mod settings in-game:
1. Settings → Mod Settings → Map
2. Find "AI Player" section
3. Adjust:
- Tick interval (higher = slower but less lag)
- Vision radius (lower = less data, faster)
- Enable/disable chat
- Auto-respawn setting
Tips
- Watch the AI learn: Use
/goto-ai-playerto follow it around - Help the AI: Drop resources near it to speed up progress
- Team play: The AI is friendly with players by default
- Multiple AIs: You can spawn multiple instances (edit global.ai_player table)
Next Steps
- Customize the AI's goals by editing the system prompt in
scripts/ai_brain.lua - Add new actions in
scripts/ai_actions.lua - Modify starting items in
scripts/ai_character.lua - Adjust perception detail in
scripts/ai_perception.lua
Need Help?
- Check README.md for detailed documentation
- Review Factorio log file for errors
- Ensure all files are in the correct mod directory
- Verify Factorio version compatibility (2.0+)
Enjoy watching your AI player build a factory!