back to home

Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.

View on GitHub
5,971 stars
819 forks
300 issues
C++CJavaScript

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing Tencent/puerts in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/Tencent/puerts)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Unreal Releases Unity Releases -blue.svg) -blue.svg) Nuget Releases 跳转中文 WHAT is PuerTS? is a **multi-language scripting solution** for Unity/Unreal/DotNet. • 🌐 **Multi-Language Support (Unity 3.0 New!)**: JavaScript/TypeScript, **Lua**, and **Python** — use the language your team is most productive in, or even mix them in one project. *(Unreal currently supports JavaScript/TypeScript only.)* • 🚀 Provides high-performance script runtimes with seamless C#/C++ interop. • 📝 TypeScript declaration generation for type-safe access to host engine APIs. WHY should I use PuerTS? • **Choose your language (Unity)**: PuerTS 3.0 introduces a unified architecture — write game logic in TypeScript, Lua, or Python with a consistent C# bridging API. No more one-size-fits-all. • **Massive ecosystem access**: leverage npm, LuaRocks, or PyPI packages alongside professional game engines to accelerate development. • **Type safety when you want it**: TypeScript's static type checking significantly improves code robustness, while Lua and Python offer rapid prototyping flexibility. • **High efficiency**: full-engine, cross-platform reflection calls — zero boilerplate for C++/C# interop. • **High performance**: static wrapper generation for performance-critical paths, across all supported languages. • **Talented WebGL Support**: massive advantage in performance and dev efficiency, even faster than pure C# in some cases. Quick Start (Unity) All three languages share the same API — just swap the : **JavaScript / TypeScript** **Lua** **Python** > 💡 Three languages, one API surface. Each example creates a , then calls — real C# interop in just a few lines. HOW can I start to use PuerTS Documentation --- FAQ • general faq • unreal faq • unity faq How to Install • unreal • unity Changelog • unreal • unity Known issues • unreal • unity --- Select Script Backend PuerTS supports multiple script backends. For **JavaScript/TypeScript**, choose from V8, QuickJS, or Node.js. PuerTS 3.0 also adds **Lua** and **Python** as first-class backends. JavaScript Backends • V8 (default): Generally excellent performance, moderate code size, only includes the implementation of the ECMAScript specification, does not include Node.js API or browser API. • QuickJS: Performance is not as good as V8, does not support debugging, but has a small code size, suitable for scenarios where code size is critical. • Node.js: Supports Node.js API (OpenSSL-related APIs are not supported on Unreal Engine's mobile platform), but has a larger code size. | JS Backend | Node API | Performance | Code Size | Debugging | Notes | | --- | --- | --- | --- | --- | --- | | V8 | ❌ | | | ✔️ | | | QuickJS | ❌ | | | ❌ | | | Node.js | ✔️ | | | ✔️ | OpenSSL may be disabled | Additional Language Backends (Unity 3.0 New!) > **Note**: Lua and Python backends are currently available for **Unity only**. Unreal Engine still supports JavaScript/TypeScript exclusively. | Backend | Language | Performance | Platform Support | Notes | | --- | --- | --- | --- | --- | | Lua | Lua 5.4 | | All platforms | Ideal for teams already using Lua | | Python | CPython | | Desktop only | Great for AI/ML integration & tooling | Avaliable on these Engine • unreal engine 4.22 ~ latest • unity 5 ~ latest • Any .net project Available on these Platform PuerTS's core code supports all platforms supported by the game engines, but each script backend has its own platform requirements: | | Windows | Mac | Linux | Android | iOS | H5/Mini Games | | --- | --- | --- | --- | --- | --- | --- | | V8 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ | | Nodejs | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ❌ | | Quickjs | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | Webgl | ❌ | ❌ | ❌ | ❌ | ❌ | ✔️ | | Lua | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | Python | ✔️ | ✔️ | ✔️ | ❌ | ❌ | ❌ | Note 1: Only V8, Nodejs, and Quickjs backends are available for Unreal. Unity supports all backends listed above. Note 2: Although the Webgl backend only supports H5/Mini Games, its scripts run in the native JS VM of the web environment, which typically delivers higher performance (e.g., JIT support in iOS Mini Games). It also provides first-class language benefits such as convenient debugging and profiling. Note 3: For JavaScript, different platforms can use different JS backends — e.g., V8 for mobile apps and Webgl for H5 — achieving full platform coverage with optimal performance. Ask for help Github Discussion ------ WHAT - 普洱TS是什么? PuerTS 是 Unity/Unreal/Dotnet 下的**多语言脚本编程解决方案**。 • 🌐 **多语言支持(Unity 3.0 新特性!)**:JavaScript/TypeScript、**Lua**、**Python** 三大语言开箱即用——团队擅长什么就用什么,同一个项目里甚至可以混用。*(Unreal 目前仅支持 JavaScript/TypeScript。)* • 🚀 提供高性能脚本运行时,与 C#/C++ 无缝互操作。 • 📝 提供 TypeScript 声明文件生成能力,类型安全地访问宿主引擎 API。 WHY - 为什么我该用普洱TS? • **自由选择语言(Unity)**:PuerTS 3.0 引入了统一的 架构——用 TypeScript、Lua 或 Python 编写游戏逻辑,享受一致的 C# 桥接 API,不再被某一种脚本语言绑定。 • **海量生态随手可用**:npm、LuaRocks、PyPI 的海量包 + 专业游戏引擎的渲染能力,加速开发效率。 • **按需选择类型安全**:TypeScript 的静态类型检查显著提升代码健壮性;Lua 和 Python 则提供快速原型验证的灵活性。 • **高效**:全引擎,全平台支持反射调用,无需额外步骤即可与宿主 C++/C# 通信。 • **高性能**:全引擎,全平台支持生成静态调用桥梁,所有支持的语言都兼顾了高性能场景。 • **WebGL 平台天生优势**:相比其他脚本方案,PuerTS 在 WebGL 平台性能和效率上都有极大提升,极限情况甚至比纯 C# 更快。 快速上手(Unity) 三种语言共享同一套 API,只需切换 : **JavaScript / TypeScript** **Lua** **Python** > 💡 三种语言,同一套 API。每个示例都创建了一个 ,然后调用 ——短短几行代码即可实现真正的 C# 互操作。 HOW - 我该怎么开始 • 官方文档 --- 常见问题 • 通用 faq • unreal faq • unity faq 最新版本安装 • unreal • unity 改动日志 • unreal • unity 已知问题与解决办法 • unreal • unity --- 脚本后端选择 PuerTS 支持多种脚本后端。**JavaScript/TypeScript** 可选 V8、QuickJS、Node.js;3.0 新增 **Lua** 和 **Python** 作为一等公民后端。 JavaScript 后端 • V8(默认):综合比较优秀,高性能,代码体积适中,仅包含 ECMAScript 规范的实现,不包含 Node.js API、浏览器 API。 • QuickJS:性能不如 V8,不支持调试,但代码体积小,适用于包体大小敏感的场景。 • Node.js:支持 Node.js API(Unreal Engine 移动平台下不支持 OpenSSL 相关 API),代码体积较大。 | JS 后端 | Node API | 性能 | 代码体积 | 调试 | 补充 | | --- | --- | --- | --- | --- | --- | | V8 | ❌ | | | ✔️ | | | QuickJS | ❌ | | | ❌ | | | Node.js | ✔️ | | | ✔️ | OpenSSL 可能被禁用 | 新增语言后端(Unity 3.0 新特性!) > **注意**:Lua 和 Python 后端目前**仅在 Unity 版本**中可用,Unreal En…