Emergence Science Revolutionary LLM Exploration

HISTRATEGY
Three Kingdoms AI Simulation

The first AI history strategy simulator that abolishes hardcoded branching stories. Uses an LLM (DeepSeek) directly as the game's logic simulation engine.

HiStrategy Chinese Ink Art Generals

💾 CLI Gameplay Simulator

See how the LLM generates narratives and executes logic under the hood

histrategy --dev (shu)
  _   _ ___ ____ _____ ____    _  _____ _____ ______     __
 | | | |_ _/ ___|_   _|  _ \  / \|_   _| ____/ ___| \   / /
 | |_| || |\___ \ | | | |_) |/ _ \ | | |  _| | |  _ \ \_/ / 
 |  _  || | ___) || | |  _ < ___ \ | | | |___| |_| | \   /  
 |_| |_|___|____/ |_| |_| \_/_/   \_\_| |_____|____|  |_|   
[System] Detected deepseek API (deepseek-v4-pro)
🏛️ 议事厅 - 谋臣献策

In the hall of Pingyuan, Jin Yong speaks: 'My lord, Cao Cao has issued the decree. Gongsun Zan is marching south. But our garrison is weak. If we commit all troops, Pingyuan will be defenseless.' Zhang Fei yells: 'I will guard the city with 200 men!' Guan Yu shakes head: 'Brother, Pingyuan is open to attacks. We must farm and recruit simultaneously.'

🎯 Council Recommendations:
1. Dual Response OptionLiu Bei joins Gongsun with 500 men, Guan Yu recruits, Sun Qian diplomatizes.
2. Loyalty Coalition OptionMarch to Suanzao with 800 men to seek fame among coalition lords.
Your Decision: Adopt Zhang Fei's plan. Let Guan Yu and Zhang Fei lead 2,000 men north to join Gongsun Zan to respond to the coalition, while Jian Yong assists Sun Qian in farming.
📜 局势推演纪事

[The historian sighs: The trajectory of history has diverged into the Annals of Jian'an.] Liu Bei orders Guan Yu and Zhang Fei north. Jian Yong helps Sun Qian cultivate 100 acres in Pingyuan (Gold -500, Grain -800). Arriving at Ji, Gongsun Zan welcomes them and joins with 15,000 elite horsemen. Though treasury is dry, Pingyuan citizens adore Liu Bei (Morale +2).

AI Latency: 25.97s | Token: Input 1213, Output 1010, Total 2223 (Reasoning 321)

🛠️ Revolutionary Design Philosophy

Testing the boundaries of LLMs acting as autonomous strategic game brains

LLM-Driven World Simulation

Abolishes hardcoded story trees. AI dynamically calculates faction growth, military campaigns, and diplomatic choices based on current database state.

Free-Text Strategic Commands

Allows players to type any strategic command. The AI parses the text, calculates its logical viability, and executes the results.

Annals of Jian'an Divergence

The simulator measures how far you deviate from actual history. As divergence rises, the AI shifts to sandboxed logical simulation.

Highly Configurable & Modular

Faction databases and storylines are completely modular. Players can inject custom campaigns by editing simple JSON config files.

Ultra Low Turn Cost

Leverages ultra-low LLM pricing. Playing a full 100-turn historical campaign costs less than 5 cents (USD 0.007).

OpenClaw Chatbot Integration

Future releases will support the OpenClaw protocol, allowing you to play the game inside WeChat, Feishu, or Telegram.

🏁 Quick Start Guide

Step 1: Clone and install locally
git clone https://github.com/emergencescience/histrategy.git
cd histrategy
pip install -e .
Step 2: Set your API Key (e.g. DeepSeek)
export DEEPSEEK_API_KEY="sk-your-deepseek-key"
Step 3: Run the game
histrategy

Unlock OpenClaw Mobile Client

Once our GitHub repository reaches 100 stars, Emergence Science will release the OpenClaw client, allowing you to play directly via instant messengers.

Star HiStrategy on GitHub