How genggode/genshinimpact_tianli works
<explanation>
1. Identify the project type and purpose
- This is a Windows desktop “super‐terminal” application for Genshin Impact (“原神天理”), built with Qt for its GUI.
- It’s modular: a central Qt‐based front end plus a set of DLL plugins (Core, Data, Map, Ocr, Resource, Sqlite, Track), common libraries (Logger, TianLiQtCommon), build tools, and tests.
2. Analyze the file structure
- Top‐level solution (GenshinImpact_TianLi.sln)
• GenshinImpact_TianLi — the main Qt GUI application
• GenshinImpact_TianLi_Setup — the installer UI (Qt)
• GenshinImpact_TianLi_Core, …_Data, …_Map, …_Ocr, …_Resource, …_Sqlite, …_Track — each is a DLL plugin
• GenshinImpact_TianLi_Resource_GIMAP_KEYPOINT & _KongYingJiuGuanData — standalone CLI build tools for preparing resource/data (CSV → JSON → SQLite)
• Logger & TianLiQtCommon — shared libraries for logging and common Qt widgets/UI components
• Test_* projects — unit tests for Resource and Sqlite modules
- Config files: .vcproj/.filters, .gitignore, GitHub workflows, JSON & SQLite C sources in the resource/data build tools.
3. Examine the README
- Describes a HUD overlay & map/navigation tool, with screenshots of floating windows and map overlays.
- Future roadmap: integrate map, voice chat, navigation, collection logs, scheduling.
4. How to create the system design diagram
a. Main components:
• User (runs the app)
• Qt GUI (GenshinImpact_TianLi)
• Installer GUI (GenshinImpact_TianLi_Setup)
• Plugin Manager/Core Service (GenshinImpact_TianLi_Core)
• Data Processor (…_Data)
• Map Engine (…_Map)
• OCR Engine (…_Ocr)
• Resource Manager (…_Resource)
• Persistence Layer (…_Sqlite)
• Tracking Engine (…_Track)
• Common Libraries (Logger, TianLiQtCommon)
• External Dependencies:
– Game Capture APIs (BitBlt, DirectX)
– SQLite C library
– JSON library (meojson)
b. Relationships & interactions:
– GUI ↔ Core Service (plugin loader, command dispatcher)
– Core Service ↔ each plugin (Data, Map, Ocr, Resource, Sqlite, Track) via well‐defined interfaces
– Track module uses Capture libs to grab game screen → provides frames to Ocr and Map
– Ocr module performs text recognition, passes results to Data & Core
– Map module matches seen items onto map tiles (resources from Resource module), uses Data definitions
– Resource module serves bitmaps, templates, UI assets
– Sqlite module: persistent store for logs, collection data, configuration
– Logger is injected into all modules for unified logging
– TianLiQtCommon provides reusable UI widgets to GUI and Setup
– Setup module uses installer framework to package GUI, plugins, dependencies
– Build tools (CLI apps) run offline to generate resource databases used by Resource & Sqlite modules
c. Architectural patterns / design principles:
– Plugin‐based architecture (Core loads DLLs at runtime)
– Clear layer separation: Presentation (Qt GUI), Orchestration (Core), Services (plugins), Persistence
– Shared utilities (Logger, QtCommon) for cross‐cutting concerns
– External dependencies isolated within specific modules (Track for capture, Sqlite for storage)
d. Key technologies / frameworks / libraries:
– Qt (Widgets, .ui/.qrc resource system)
– Win32 / DirectX capture APIs
– SQLite (C source compiled into modules)
– JSON via meojson
– Visual Studio / MSBuild solution + .vcxproj files
5. Tailoring the diagram to this full‐stack desktop project
- Show separation of concerns:
• Frontend (Qt GUI + Setup GUI)
• Backend orchestrator (Core plugin manager)
• Service modules (Data, Map, Ocr, Resource, Sqlite, Track)
- Emphasize data flow:
• screen capture → OCR → Map/Data → GUI overlay
• user commands → Core → plugin actions → Sqlite for persistence
- Highlight installer packaging of modules and assets
6. Diagramming guidelines
- Use clear boxes for each module; group them by layer (e.g., Presentation, Core, Services, Persistence).
- Draw directional arrows:
• GUI → Core (commands)
• Core → Plugin (invoke service)
• Track → Ocr/Map (data feed)
• Ocr/Map/Data → Core → GUI (results)
• Any plugin → Sqlite (store/retrieve)
- Color‐code by layer:
• Blue for Presentation
• Green for Core/Orchestration
• Orange for Service modules
• Brown for Persistence
- Use distinct shapes for external dependencies (cylinder for database, parallelogram for capture APIs, document icon for JSON)
7. Essential details to capture
- Each DLL/project as a component with its role & technologies
- Shared libs (Logger, QtCommon) and their consumers
- Offline resource build tools feeding into Resource/Sqlite modules
- Installer module bundling everything
By following this breakdown, the resulting system design diagram will clearly depict all moving parts, their relationships, data flows, and key technologies—providing an accurate architectural overview of the GenshinImpact_TianLi project.
</explanation>