Content
# Tool List
Development branch based on the original "Hexagonal Chaos" mod from the workshop, expanding new hex factors, stacking **FireTuner / civ6-mcp**, allowing external large models to select and write decision reasons for each AI from candidate cards after human confirmation of hexes.
This project is purely AI-generated.
This repository contains:
| Directory | Content |
|------|------|
| [`Haikesi_Dev/`](Haikesi_Dev/) | Hexagonal Chaos Dev mod (not enabled simultaneously with the original workshop mod). Copy the entire directory to: `%USERPROFILE%\Documents\My Games\Sid Meier's Civilization VI\Mods\Haikesi_Dev\` |
| [`civ6-mcp-haikesi/`](civ6-mcp-haikesi/) | Local copy of [civ6-mcp](https://github.com/lmwilki/civ6-mcp) with Hex AI decision-making extensions (not pushed to upstream) |
## Description
This project implements a single-machine/development closed loop of "**Human selects hex → External large model reads situation → AI submits hex selection and reasons via FireTuner**":
1. **Mod side (`Haikesi_Dev`)**
When "AI optional hexes" and "External large model AI hexes" are enabled, after human confirmation of card selection, an asynchronous request is suspended; if it times out, it will deterministically fall back. Supports online host authoritative distribution, AI exclusive hex pool expansion, resource creation type hexes, barbarian invasions, and other effects, and displays large model decision reasons on the tracking panel.
2. **Tool side (`civ6-mcp-haikesi`)**
Through FireTuner polling pending decision requests, calls DeepSeek / OpenAI compatible / Anthropic and other backends to complete card selection and reason generation, and then writes back to the game with `submit_haikesi_ai_choices`. It can also be semi-automatically debugged by Cursor Agent via MCP.
Keys are only placed in the local `.env` (already `.gitignore`), and the repository only retains [`.env.example`](civ6-mcp-haikesi/.env.example).
## Prerequisites
Additionally required: Civilization 6 (including Gathering Storm), **Development Tools (FireTuner, AppID 404350)**, `AppOptions.txt` with `EnableTuner 1` and window mode. See the "Startup Configuration" document below for complete steps.
### Inheritance and Reference (independent implementation within the repository, not dependent)
The following projects are the inheritance baseline or idea sources for this repository; relevant capabilities have been implemented within this repository, and **do not require enabling corresponding workshop mods / upstream repositories** at runtime.
1. **civ6-mcp (upstream MCP repository)**
https://github.com/lmwilki/civ6-mcp
The repository's [`civ6-mcp-haikesi/`](civ6-mcp-haikesi/) is a vendored copy (including Haikesi extensions); upstream provenance see [`civ6-mcp-haikesi/UPSTREAM.md`](civ6-mcp-haikesi/UPSTREAM.md).
2. **Hexagonal Chaos (original mod · Steam Workshop)**
https://steamcommunity.com/sharedfiles/filedetails/?id=3751996207
It is recommended to subscribe to the original version to understand the gameplay; for local development, enable this repository's `Haikesi_Dev` (do not mix with the workshop mod with the same ID to avoid data confusion).
3. **Builder Plants Resources (Builder Plants Resources)**
https://steamcommunity.com/sharedfiles/filedetails/?id=3758337710
The planting interface and recharge energy idea of "Builder Plants Resources" are referenced from this mod; this repository has independently implemented it and does not depend on or require enabling this workshop mod.
### Extended Dependencies (soft dependencies)
The following mods enhance the experience, **not strictly necessary**; it is recommended to enable them with Hex PVE / external large model process.
1. **Real Strategy / RST (Steam Workshop)**
https://steamcommunity.com/sharedfiles/filedetails/?id=1617282434
AI behavior enhancement; used in conjunction with hexes and external large model selection processes.
## Update Log
Compared to the workshop original Hexagonal Chaos, the new/ fixed content of this repository's Dev branch is as follows. **Please add a new line to the top of this table for each meaningful update** (including date and description).
| Upload Date | Description |
|----------|------|
| 2026-07-15 | **Removed**: Player hex "Joint Operations" (`JOINTOPSRUNE`). The engine has no "Two-Ring Alliance / Suzerainty" count Effect, and the halo GRANT scheme is prone to crashes, so the card surface and all Modifier/ text/ icon aliases are deleted. |
| 2026-07-15 | **Fixed**: `Haikesi_GamePlay_Script.lua` file-level local touch top (Lua 5.1 register limit) causes the entire file to fail to load, and card selection does not land (contributed units do not appear); planting logic is disassembled into `Haikesi_Planter_GamePlay.lua`. |
| 2026-07-15 | **Refactored**: Builder Plants Resources/ Dracula / Eternal Band changed to "add RelicType + borrow icon"; restore original placeholder "Beware of Grapefruit" "Ominous Contract" "War Symphony" (`IsActive=0`, effect to be filled). New keys: `FARMIMMORTALRUNE` / `DRACULARUNE` / `ETERNALBANDRUNE`. (Joint Operations has been removed) |
| 2026-07-15 | **Player hex "Pearl Pig"**: Added `PEARLPIGRUNE` (card surface temporarily borrowed unused "Group Otter Gift" icon, occupying); the capital receives a special unit "Juan" (unit uses pig nose icon, 3D reuse classical great general). Units within 3 grids of Juan have +1 movement force (great general AOE paradigm). |
| 2026-07-15 | **Player hex "Builder Plants Resources"**: Added `FARMIMMORTALRUNE` (temporarily borrowed "Beware of Grapefruit" icon); the capital receives a special builder that can plant bonus/ luxury resources on legitimate terrain (white list + `CanHaveResource`); hang `CLASS_BUILDER` to eat pyramid and other construction times correction; ordinary workers do not have this ability. Planting UI reference BP_ResourcePlanter, not dependent on this mod. The white list is scanned from the `Resources` table when LoadOrder is 16798 (BONUS/ LUXURY and Frequency or SeaFrequency > 0); if the third-party resource mod writes `Resources` later, it needs to add `Haikesi_PlanterResources` itself or adjust the loading order of this mod to be captured. |
| 2026-07-15 | **Player hex "Dracula"**: Added `DRACULARUNE` (temporarily borrowed "Ominous Contract" icon); immediately obtain 3 vampires in the capital. The prerequisite table adds `CAPABILITY` type, only entering the selection pool in secret society mode. |
| 2026-07-15 | **AI hex series extension**: Added "Confusion Interference" series (barbarian invasions included); added "Peaceful Mutual Benefit" series and "Tianchao Shangguo" - international trade routes to the city of this civilization for the other party +1 science +1 culture, and for this party +4 gold +2 faith (Egyptian same Incoming Trade Modifier). |
| 2026-07-15 | **External large model selection hexes consolidation and situation information**: Fixed ExtAI landing `Haikesi_GetPlayerRelicCount` prerequisite statement error (Apply crash causes pending unclear, next card selection random completion); Apply/ timeout path plus `pcall`; LLM Prompt changed to bit-by-bit leader fog perspective (own city, encountered civilization, visual threat, RST/ religion/ victory progress), and completed **two-way diplomatic dissatisfaction**, opponent perception modifier and **World Congress resolution**; DeepSeek V4 default off thinking / JSON Mode, illegal JSON automatic retry; `.env.example` supplemented model and token description. |
| 2026-07-15 | **Repository first release**: Online/ non-0 bit AI hex distribution repair (host authority + deterministic `AIChoices` fallback); added "External Large Model AI Hexes" asynchronous decision-making (FireTuner / MCP submit choices + reasons, timeout deterministic fallback); tracking panel display decision reasons; **new human hexes** - Triangular Trade (`TRIANGULARTRADERUNE`, temporarily borrowed three-fold light icon), Eternal Band (later moved to `ETERNALBANDRUNE`, temporarily borrowed War Symphony icon, capital sent high-level "Eternal Band"); AI hex pool expansion - barbarian invasions, resource creation type (cotton/ tobacco/ sugar/ silk/ tea, etc., data table `Haikesi_Relic_ResourceSpawns`); vendored `civ6-mcp-haikesi` and DeepSeek/ universal LLM monitoring script. |
## Large Model Selection Hexes · Startup Configuration
Environment installation, advanced setting switches, MCP / DeepSeek monitoring scripts, Cursor Agent debugging process, etc., see:
**[`Haikesi_Dev/FIRETUNER_MCP_SETUP.md`](Haikesi_Dev/FIRETUNER_MCP_SETUP.md)**
Recommended quick path: configure `.env`, game into archive and enable related options, and open another terminal resident:
```powershell
Set-Location "G:\Civ6Mods\civ6-mcp-haikesi"
uv run python scripts/haikesi_deepseek_watch.py
```