explaingit

wangwei-ying3/ming-salvage-sim

13PythonAudience · generalComplexity · 3/5Setup · moderate

TLDR

An AI-powered political strategy game set in the final years of China's Ming dynasty where you play as the last emperor, making monthly decisions by conversing with LLM-powered officials whose reports may be distorted by corruption and factional interests.

Mindmap

mindmap
  root((ming-salvage-sim))
    What It Does
      Political strategy game
      LLM-powered officials
      Historical simulation
    Gameplay
      Monthly turns
      Official conversations
      Edict system
    Tech Stack
      Python
      LLM API
      SQLite
    Use Cases
      History learning
      Strategy gaming
      Content modding
    Audience
      History enthusiasts
      Strategy gamers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Play a historically grounded political strategy game where your edicts may be ignored or distorted by corrupt officials before they reach local administrators.

USE CASE 2

Learn about the collapse of the Ming dynasty through monthly decision-making conversations with AI-powered advisors representing different factions.

USE CASE 3

Extend the game content by adding new historical figures, events, armies, or outcome paths in the separate content folder without touching the core code.

Tech stack

PythonLLM APISQLite

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a DeepSeek or compatible LLM API key, a full 300-turn playthrough costs under a few dollars using DeepSeek's caching.

In plain English

This is an AI-powered political strategy game set in the final years of China's Ming dynasty, written in Python with a web interface. The README is in Chinese. You play as the Chongzhen Emperor, the last Ming ruler, with full knowledge of how history ended: Beijing will fall in seventeen years, and the dynasty will collapse from an empty treasury, military unpaid wages, peasant uprisings, and bureaucratic infighting rather than from any single enemy. The premise is that you now have the chance to act differently. Each turn of the game represents one month. At the start of each month you receive reports on what happened: how much tax was collected, what disasters occurred, how your previous edicts were actually carried out. You then summon officials from different branches of government, the six ministries, the imperial household, military commanders, and regional governors, and hold conversations with them. Each official has their own factional loyalty, personal interests, and information they may withhold or distort. The edicts you issue do not automatically take effect as written. If imperial authority is low or funds are insufficient, the instructions that reach local officials may have been altered or partially ignored by the time they arrive. The conversation with each official is powered by a large language model. The project is designed to work with any API-compatible AI service and recommends DeepSeek models for cost efficiency, noting that a full playthrough of 300 turns can be completed for under the equivalent of a few dollars due to the model's caching behavior. At the end of each month the AI also generates a summary report written in a style meant to resemble official Ming court documents. The state of the empire is tracked through a set of numerical meters covering the treasury, popular sentiment, imperial authority, border defense, civil unrest, factional conflict, compliance with orders, and the level of concealment by officials. Every decision you make affects one or more of these meters, and those changes in turn affect what future actions are available or affordable. There is no technology tree or automatic progression. The game explicitly states it has no shortcuts to national revival. The game has a web interface with maps and character portraits, and also a command-line version for quick testing. Progress is saved locally in a database file. The character data, events, regions, armies, and AI prompts are kept in a separate content folder so players can extend or modify the game's world without changing the core code. The README describes planned additions including more historical figures, expanded outcome paths such as relocating the capital or negotiating with the Manchu forces, and more detailed factional mechanics.

Copy-paste prompts

Prompt 1
I am playing ming-salvage-sim as the Chongzhen Emperor and my imperial authority meter is low. Which type of official should I summon and what kind of edicts typically raise authority without draining the treasury?
Prompt 2
How do I add a new historical figure to the ming-salvage-sim content folder? Show me the data format for a new official with factional loyalty and the kind of information they would withhold.
Prompt 3
I want to run ming-salvage-sim using the DeepSeek API instead of OpenAI. Show me how to configure the API endpoint and model name in the settings.
Prompt 4
Explain how the compliance and concealment meters in ming-salvage-sim interact and how low compliance changes what your edicts actually do when they reach local officials.
Open on GitHub → Explain another repo

← wangwei-ying3 on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.