# trollagent_ai - LLM-Assisted Autonomous Troll Agent (Ollama) `trollagent_ai` delegates tactical reasoning to a local or remote Ollama LLM while operating under the canonical Troll mechanics of **botWebWars**. --- ## 👹 Troll Rules & LLM Strategy - **Solitary Brute**: Never forms parties or alliances. - **Troll Truce**: Ignores other trolls and never battles them. - **Predatory Focus**: Relentlessly hunts and battles players and squads. - **Healing via Sleep**: When injured or navigating complex obstacle layouts, the LLM strategically chooses whether to **rest and sleep** (+0.1 HP regeneration per turn) or push forward to ambush players. - **Obstacle Navigation**: Evaluates available paths around mountains and forests, balancing Chebyshev distance against diagonal squeeze strength penalties. - **No Wizard Challenges**: Gary the Wizard cannot be engaged. --- ## ⚙️ Configuration & Environment Variables | Variable | CLI Flag | Default | Description | |---|---|---|---| | `TROLL_SERVER_URL` | `-u`, `--url` | `http://localhost:8000/api` | botWebWars API base endpoint | | `TROLL_NAME` | `-n`, `--name` | `GorgonAITroll` | Troll avatar name | | `TROLL_COLOR` | `-c`, `--color` | `#15803d` | Troll hex color | | `TROLL_STRENGTH` | `-s`, `--strength` | `3.0` | Initial troll strength | | `TROLL_HEALTH` | `-H`, `--health` | `10.0` | Initial health points | | `OLLAMA_BASE_URL` | `--ollama-url` | `http://192.168.1.220:11434` | Ollama server URL | | `OLLAMA_MODEL` | `--ollama-model` | `gemma4:12b` | Ollama model identifier | | | `--loop-delay` | `1.0` | Turn polling loop delay (s) | --- ## 🚀 Execution Example ```bash export OLLAMA_BASE_URL="http://localhost:11434" export OLLAMA_MODEL="gemma4:12b" python3 trollagent_ai/bot.py \ --name CarnageTroll \ --color "#047857" \ --strength 4 \ --health 10 \ --url http://localhost:8000/api ```