Skip to content
Projects

About

DOTA2自定义游戏开发模板项目,使用typesscript和react开发; Xavier's DOTA 2 custom game template using typescript and react-panorama

Games & Emulation

How these counts are measured

Measured 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

Original

X-Template

License: MIT

简体中文 | English Readme | Русское описание

Xavier's Dota 2 Custom Game Development Template

English translated with DeepSeek

Usage Steps

Quick Video Tutorial (Chinese)

Create New Project

  1. Click to use this repo as a template or fork this repo
  2. Install Node.js
  3. git clone your own project
  4. Install VSCode and open the cloned folder with VSCode
  5. Open scripts/addon.config.ts, modify addon_name to your project name
  6. Run yarn install to install dependencies
  7. Run yarn dev to start development
  8. Use yarn launch map_name to quickly launch tests, or yarn launch to only launch tools;

Benefits

  1. Develop with modern language (TypeScript) for both client and server
  2. Manage KV files via spreadsheet tools
  3. Use React for UI development without writing XML
  4. Solves Valve toolchain issues like "UI cannot read KV files" and "UI images not auto-compiling"
  5. Supports code encryption for production
  6. Jest-compatible test framework — write and run tests in-game via chat commands, see Test Framework Guide
  7. Flame graph performance analysis - see Flame Graph Profiler Guide

Features

  1. Client code in content/panorama/src and server code in game/scripts/src using TypeScript
  2. Convert Excel → KV files in game/scripts/npc, with auto-generated JSON files for TS access
  3. Bidirectional conversion between addon.csv ↔ addon_*.txt
  4. Generate TS interfaces from server APIs using openapi-typescript-codegen

Commands

  1. Recommended: yarn launch [[addon_name] map_name]
  2. yarn dev - Start dev mode with watch compilation
  3. yarn prod - Build for production (with optional encryption)
  4. yarn api - Generate API clients from scripts/server_api.json (Swagger 3.0 spec) to game/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

  • content syncs with dota 2 beta/content/dota_addons/your_addon_name
  • game syncs with dota 2 beta/game/dota_addons/your_addon_name
  • shared contains common TS declarations for panorama and tstl
  • scripts contains Node.js tooling scripts
  • See gulpfile.ts for build details

Recommended DOTA2 Modding Tools

Essential Software:
  1. Code Editor: VSCode
  2. Decompilers: ValveResourceFormat / GCFScape
  3. Adobe Suite: Photoshop, Audition
  4. Version Control: GitHub Desktop, SourceTree, TortoiseSVN
  5. Modeling: Blender via Steam (Store Page)
  6. Utilities: Everything, DeepL, nvm-windows

FAQ

  • Permission errors during yarn install?
    Close editors and retry in console, or reboot.
  • Network issues during install?
    Use yarn config set registry https://registry.npmmirror.com then 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 do or yarn launch dop for Perfect World servers

Explore related projects

Loading…