TABSAimod
Press F11 to summon the AI assistantTABS AI Chat (TABSAimod)
An in-game AI assistant for Totally Accurate Battle Simulator.
Press F11 to open a chat panel, ask questions about the game, and get concrete deployment advice based on the enemy lineup — optionally with a screenshot of the current battle attached.
Status: work in progress. The mod is functional but still being iterated on. Bug reports and suggestions are welcome (contact at the bottom).
Vibe
Features
- F11 panel — a draggable in-game window. The plugin persists across scenes, so it should be reachable from the menus as well as in battle.
- AI chat — OpenAI-compatible chat protocol, so it works with local Ollama, or any OpenAI-compatible cloud API.
- Battle context — on every message the mod scans the field and reports both sides to the AI: how many units, which types, on Red and Blue.
- Screenshot support — attach the current frame (JPEG) so vision models can see actual unit positions. Auto-disabled for text-only models.
- Placement advice — the system prompt forces the AI to answer with concrete suggestions: which units, how many, and where (left / center / right, front / back / flank).
- TABS-only — the assistant refuses non-TABS topics and steers back.
- Bilingual — switch the UI and the AI reply language between Chinese and English at any time.
Requirements
| Item | Notes |
|---|---|
| Totally Accurate Battle Simulator | Steam version |
| BepInEx 5.4.16 | BepInExPack_TABS |
| A model to talk to | Either local Ollama, or a cloud API key |
There is no built-in free cloud endpoint. You must supply your own model: either run one locally with Ollama, or point the Custom preset at a cloud API you have an account with.
Installation
-
Install BepInEx 5.4.16 for TABS if you have not already.
-
Copy the
AIChatfolder into:<GameDir>\BepInEx\plugins\AIChat\The result must look like:
BepInEx\plugins\AIChat\AIChat.dll -
Launch the game once, then quit. The config file is created on first launch:
BepInEx\config\com.inf.aichat.cfg -
Edit that file (see Configuration below), then launch the game again.
-
Press F11 in game.
On a successful load the BepInEx console prints:
[Info : BepInEx] Loading [TABS AI Chat 1.5.0]
[Info :TABS AI Chat] TABS AI Chat loaded. Press F11 to toggle. Model: ...
Quick start (local Ollama)
-
Install Ollama from https://ollama.com/download — or press the "下载 Ollama" / "Get Ollama" button inside the panel, which opens the download page for you.
-
Download a model:
ollama pull qwen2.5vl:7bUse
qwen2.5vl:3binstead if you have 8 GB of RAM or less. -
Make sure Ollama is running (
ollama listshould respond). -
In game, press F11 and type. The default preset already points at
http://127.0.0.1:11434.
That is all — no config editing needed for the default local setup.
The panel
+---------------------------------------------------------------+
| [Language: 中文] [Screenshot: Off] [Clear] [Reload] F11 ... | toolbar
| [Model: local qwen2.5vl 7b >] [Get Ollama] | model row
|---------------------------------------------------------------|
| You: how do I counter this lineup? |
| AI: ... | chat log
| |
|---------------------------------------------------------------|
| [ type here .................................. ] [ Send ] | input
+---------------------------------------------------------------+
| Control | What it does |
|---|---|
| Language / 语言 | Toggles the UI language and the language the AI replies in. |
| Screenshot / 附截图 | Whether to attach the current screen to the next message. Auto-turned off for text-only models. |
| Clear / 清空 | Clears the conversation log. |
| Reload / 重载配置 | Re-reads the config file from disk. Use this instead of restarting the game. |
| Model / 模型 | Cycles through the built-in presets. See below. |
| Get Ollama / 下载 Ollama | Opens the Ollama download page and prints the ollama pull command in chat. |
| Send / 发送 | Sends. You can also press Enter in the input box. |
Drag the window by its title bar. While the panel is open the mouse cursor is forced visible, and the original cursor state is restored when you close it.
Configuration
File:
<GameDir>\BepInEx\config\com.inf.aichat.cfg
| Key | Type | Default | Meaning |
|---|---|---|---|
Endpoint |
string | http://127.0.0.1:11434/v1/chat/completions |
Chat completions URL. Only read by the Custom preset. |
ApiKey |
string | (empty) | Bearer token. Local Ollama does not check it. Only read by Custom. |
Model |
string | qwen2.5vl:7b |
Model name. Only read by Custom. |
Hotkey |
string | F11 |
Any Unity KeyCode name, e.g. F11, F12, Insert. |
Language |
string | zh |
zh or en. |
JpegQuality |
int | 55 |
Screenshot JPEG quality, 1–100. Lower = smaller upload. |
HistoryTurns |
int | 8 |
How many past turns to resend as context. |
TimeoutSec |
int | 60 |
HTTP timeout. |
Preset |
int | 0 |
Which built-in preset to use. See below. |
Important: only the Custom preset uses Endpoint / Model / ApiKey
Presets 0–3 are hardcoded to http://127.0.0.1:11434 with a fixed model
name. If you fill in Endpoint but leave Preset = 0, your endpoint is ignored
and the mod still talks to local Ollama.
To use your own endpoint you must set:
Preset = 4
Model presets
Preset |
Model | Endpoint | Vision | Needs key |
|---|---|---|---|---|
0 |
qwen2.5vl:7b |
local Ollama | yes | no |
1 |
qwen2.5vl:3b |
local Ollama | yes | no |
2 |
llava:7b |
local Ollama | yes | no |
3 |
gemma3:4b |
local Ollama | yes | no |
4 |
(your Model) |
(your Endpoint) |
depends | depends |
You can also cycle presets with the Model button in the panel; the chosen index is saved back to the config automatically.
Using your own model (Custom preset)
Set Preset = 4, then fill in the other three fields.
Another local Ollama model
Preset = 4
Endpoint = http://127.0.0.1:11434/v1/chat/completions
ApiKey = local
Model = llama3.1
ApiKey must be non-empty (the mod refuses to send without one), but a local
server ignores the value.
A cloud API
Any OpenAI-compatible /v1/chat/completions endpoint works, for example:
Preset = 4
Endpoint = https://api.openai.com/v1/chat/completions
ApiKey = sk-xxxxxxxxxxxxxxxx
Model = gpt-4o-mini
After editing, press Reload / 重载配置 in the panel — no restart needed.
Screenshots and vision models
When Screenshot is on, the current frame is captured, encoded as JPEG and
sent alongside your message as an image_url with a base64 data URI.
- Only models that accept image input will work. If you pick a text-only model
(most
*-chatmodels), turn Screenshot off, otherwise the request errors. - The capture is taken at end-of-frame. The panel itself is drawn with IMGUI, so depending on timing it may appear in the captured image. If the AI starts commenting on the chat window, move the panel into a corner or make it smaller, or simply turn Screenshot off.
- Past images are not resent with history — only the newest message carries an image. This keeps token usage sane.
- Lower
JpegQuality(e.g.40) if the request feels slow.
Even with Screenshot off, the AI still receives the text battle context (unit counts and types per side), so it can give useful advice without vision.
Troubleshooting
Error messages are shown in chat as Error: ....
| Message | Cause | Fix |
|---|---|---|
| Cannot reach local Ollama | Nothing listening on 11434 |
Install/start Ollama: ollama serve, then ollama pull <model> |
| Cannot reach server | Wrong URL, or the host is blocked | Check Endpoint; try a different provider |
| SSL certificate error | TLS interception / blocked host | Use a different endpoint; local Ollama is unaffected |
| Invalid or missing API key | HTTP 401 | Fill ApiKey, then Reload |
| Rate limited or quota exhausted | HTTP 429 | Wait, or use another key/model |
| Nothing happens on F11 | Plugin did not load | Check BepInEx\LogOutput.log for TABS AI Chat |
| Panel opens but no reply | Preset/endpoint mismatch | Remember: only Preset = 4 reads your Endpoint |
Note that Hotkey is read at startup and on Reload. If you change the
hotkey in the config, press Reload while the panel is open (or restart) so it
takes effect.
Known limitations
- No built-in free API. You supply the model — local Ollama, or your own key.
- Vision is optional but model-dependent. Text-only models must have Screenshot turned off.
- "TABS-only" is prompt-enforced, not a hard filter. The system prompt tells the model to refuse off-topic questions; a strong model will comply, but this is not a guaranteed technical block.
- Keystrokes can leak through. While the panel is open, some keys may still reach the game. Harmless during battle (the AI controls the units), but be careful while typing in the deployment phase.
- No custom shaders or VFX are shipped with this mod; it is UI + networking only.
- Hardware matters for local models. A 7B vision model wants ~10 GB of VRAM
or free RAM. On low-end integrated graphics, use
qwen2.5vl:3bor a cloud API.
Uninstalling
Delete BepInEx\plugins\AIChat\ and, optionally,
BepInEx\config\com.inf.aichat.cfg.
Contact
This mod isn't finished yet. If you run into problems, please report them here:
Bilibili: https://space.bilibili.com/3546811740457474
When reporting a bug, please include:
- the panel text or a screenshot of the error,
- the relevant lines from
BepInEx\LogOutput.log, - which preset / model you were using.
