XavierCHN/x-template
About
DOTA2自定义游戏开发模板项目,使用typesscript和react开发; Xavier's DOTA 2 custom game template using typescript and react-panorama
Games & EmulationMeasured star growth
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.EN.MD
OriginalX-Template
简体中文 | English Readme | Русское описание
Xavier's Dota 2 Custom Game Development Template
English translated with DeepSeek
Usage Steps
Quick Video Tutorial (Chinese)
Create New Project
- Click to use this repo as a template or fork this repo
- Install Node.js
git cloneyour own project- Install VSCode and open the cloned folder with VSCode
- Open
scripts/addon.config.ts, modifyaddon_nameto your project name - Run
yarn installto install dependencies - Run
yarn devto start development - Use
yarn launch map_nameto quickly launch tests, oryarn launchto only launch tools;
Benefits
- Develop with modern language (TypeScript) for both client and server
- Manage KV files via spreadsheet tools
- Use
Reactfor UI development without writing XML - Solves Valve toolchain issues like "UI cannot read KV files" and "UI images not auto-compiling"
- Supports code encryption for production
- Jest-compatible test framework — write and run tests in-game via chat commands, see Test Framework Guide
- Flame graph performance analysis - see Flame Graph Profiler Guide
Features
- Client code in
content/panorama/srcand server code ingame/scripts/srcusing TypeScript - Convert Excel → KV files in
game/scripts/npc, with auto-generated JSON files for TS access - Bidirectional conversion between
addon.csv↔addon_*.txt - Generate TS interfaces from server APIs using openapi-typescript-codegen
Commands
- Recommended:
yarn launch [[addon_name] map_name] yarn dev- Start dev mode with watch compilationyarn prod- Build for production (with optional encryption)yarn api- Generate API clients fromscripts/server_api.json(Swagger 3.0 spec) togame/scripts/src/server/services
Publish Process
# 1. Ensure publish keys are configured (see Configuration)
# 2. Execute publish
yarn prod
# Publish process automatically performs:
# - gulp predev (Excel → KV → JSON, CSV → localization, image precache)
# - Production Webpack build (minified)
# - TSTL production compilation
# - Code encryption (per encrypt_files config)
# - Copy to publish directory
Publish Directory
Published files are output to dota 2 beta/game/dota_addons/{addon_name}_publish/, ready for uploading to Dota 2 Workshop.
Use yarn launch {addon_name}_publish to directly launch the Workshop tools for uploading.
Directory Structure
contentsyncs withdota 2 beta/content/dota_addons/your_addon_namegamesyncs withdota 2 beta/game/dota_addons/your_addon_namesharedcontains common TS declarations for panorama and tstlscriptscontains Node.js tooling scripts- See
gulpfile.tsfor build details
Recommended DOTA2 Modding Tools
- Environment: Node.js, LuaForWindows, Python
- Always launch Dota 2 via Steam
Essential Software:
- Code Editor: VSCode
- Decompilers: ValveResourceFormat / GCFScape
- Adobe Suite: Photoshop, Audition
- Version Control: GitHub Desktop, SourceTree, TortoiseSVN
- Modeling: Blender via Steam (Store Page)
- Utilities: Everything, DeepL, nvm-windows
FAQ
- Permission errors during
yarn install?
Close editors and retry in console, or reboot. - Network issues during install?
Useyarn config set registry https://registry.npmmirror.comthen retry. - Run multiple commands while keeping
yarn dev?
Use Ctrl+Shift+5 in VSCode to open multiple terminals. - Tutorials available?
TODO: Create tutorials.
AI-Assisted Development Skills
The project includes a set of AI-assisted development skills (Skills) in .agents/skills/, designed to guide AI coding assistants (such as OpenCode) in understanding and generating domain-specific code:
| Skill | Description |
|---|---|
dota2-ability |
Dota 2 custom ability creation |
dota2-game-logic |
Game server-side logic development |
dota2-item |
Custom item creation |
dota2-localization |
Localization text generation |
dota2-ui |
Panorama UI development |
dota2-unit |
Custom unit creation |
These skills are continuously optimized test modules that define the standards, conventions, and best practices AI should follow when generating code. Community improvements via Pull Requests are welcome.
Others
- For issues, visit GitHub Issues
- Launch normal Dota 2 with
yarn launch dooryarn launch dopfor Perfect World servers
Explore related projects
Loading…