[change] 更新README

main
walon 2024-06-17 10:57:07 +08:00
parent 88e20505f8
commit 75b24345f6
2 changed files with 60 additions and 65 deletions

View File

@ -11,11 +11,11 @@
<br/>
<br/>
HybridCLR is a **almost perfect** full-platform native c# hot update solution for Unity with complete features, zero cost, high performance, and low memory**.
HybridCLR is a nearly perfect Unity full-platform native c# hot update solution with complete features, zero cost, high performance, and low memory.
HybridCLR expands the ability of il2cpp, making it change from pure [AOT](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) runtime to 'AOT+Interpreter' hybrid runtime, and then natively supports dynamic loading of assembly , so that the games packaged based on il2cpp backend can be executed not only on the Android platform, but also on IOS, Consoles and other platforms that limit JIT efficiently in **AOT+interpreter** hybrid mode, completely supporting hot updates from the bottom layer.
HybridCLR expands the il2cpp runtime code, changing it from a pure [AOT](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) runtime to an AOT+Interpreter hybrid runtime, and then natively supports dynamic loading of assemblies. Hot updates are fully supported from the bottom up. Games using HybridCLR technology can run efficiently not only on the Android platform, but also on IOS, Consoles, WebGL and other platforms supported by il2cpp.
HybridCLR not only supports the traditional fully interpreted execution mode, but also pioneered [Differential Hybrid Execution](https://hybridclr.doc.code-philosophy.com/en/docs/business/differentialhybridexecution) technique. That is, you can add, delete, or modify the AOT dll at will, and intelligently make the changed or newly added classes and functions run in interpreter mode, but the unchanged classes and functions run in AOT mode, so that the running performance of the hot-updated game logic basically reaches the original AOT level.
Due to HybridCLR's good support for the ECMA-335 specification and its high compatibility with the Unity development workflow, the Unity project can almost seamlessly obtain the ability to hot update C# code after accessing HybridCLR. Developers do not need to change their daily development habits and Require. For the first time, HybridCLR has reduced the engineering difficulty of the Unity platform's full-platform code hot update solution to almost zero.
Welcome to embrace modern native C# hot update technology! ! !
@ -25,66 +25,64 @@ Welcome to embrace modern native C# hot update technology! ! !
- [Quickstart](https://hybridclr.doc.code-philosophy.com/en/docs/beginner/quickstart)
- [Release Log](./RELEASELOG.md)
## Features
- Features complete. A nearly complete implementation of the [ECMA-335 specification](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/), with only a very small number of [unsupported features](https://hybridclr.doc.code-philosophy.com/en/docs/basic/notsupportedfeatures).
- Zero learning and use costs. HybridCLR enhances the pure AOT runtime into a complete runtime, making hot update code work seamlessly with AOT code. The script class and the AOT class are in the same runtime, and you can freely write codes such as inheritance, reflection, and multi-threading (volatile, ThreadStatic, Task, async). No need to write any special code, no code generation, almost unlimited.
- Efficient execution. Implemented an extremely efficient register interpreter, all indicators are significantly better than other hot update schemes. [Performance Test Report](https://hybridclr.doc.code-philosophy.com/en/docs/basic/performance)
- Memory efficient. The classes defined in the hot update script occupy the same memory space as ordinary c# classes, which is far superior to other hot update solutions. [Memory and GC](https://hybridclr.doc.code-philosophy.com/en/docs/basic/memory)
- Due to the perfect support for generics, libraries that are not compatible with il2cpp due to AOT generics issues can now run perfectly under il2cpp
- Support some features not supported by il2cpp, such as __makeref, __reftype, __refvalue directives
- [Differential Hybrid Execution](https://hybridclr.doc.code-philosophy.com/en/docs/business/differentialhybridexecution)
- A nearly complete implementation of the [ECMA-335 specification](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/), with only a very small number of [unsupported features](https ://hybridclr.doc.code-philosophy.com/docs/basic/notsupportedfeatures).
- Zero learning and usage costs. For most developers, there are almost no limits to writing code. Hot update code works seamlessly with AOT code, and you can write code such as inheritance, **generics**, and **reflection** at will. No need to write any additional special code, no code generation
- Fully supports multi-threading, including but not limited to volatile, ThreadStatic, async Task and other related functions and features. This is not supported by any other hot update solution
- Almost fully compatible with Unity workflow. Including but not limited to supporting hot update **MonoBehaviour**, ScriptableObject, **DOTS** technology, the hot update script mounted on the resource can be instantiated correctly, which is not supported by all other hot update solutions.
- Efficient execution. An extremely efficient register interpreter is implemented, and all indicators are significantly better than other hot update schemes. [Performance test report](https://hybridclr.doc.code-philosophy.com/docs/basic/performance)
- Memory efficient. The classes defined in the hot update script occupy the same memory space as ordinary C# classes, which is far superior to other hot update solutions. [Memory Usage Report](https://hybridclr.doc.code-philosophy.com/docs/basic/memory)
- Supports MonoPInvokeCallback, which can interact well with native code or other languages such as lua, javascript, and python
- Supports some features not supported by il2cpp, such as __makeref, __reftype, and __refvalue instructions
- Supports the original **Differential Hybrid Execution (DHE)** differential hybrid execution technology, that is, the AOT dll can be added, deleted or modified at will, and the unmodified functions will be intelligently run in AOT mode, and the changed or added functions will be run in interpreter mode. Run, so that the running performance of the hot updated game logic can basically reach the level of native AOT.
- Supports **Hot Reload** technology, which can 100% uninstall the assembly
- Supports modern dll encryption technology to effectively ensure code security
## Supported Unity Versions And Platforms
- Supports 2019.4.x, 2020.3.x, 2021.3.x, 2022.3.x, 2023.2.x、**6000.x.y** versions
- Supports all il2cpp supported platforms
- Supports Tuanjie Engine and Harmony Platform
## Working Principle
HybridCLR is inspired by mono's [mixed mode execution](https://www.mono-project.com/news/2017/11/13/mono-interpreter/) technology, and provides additional AOT runtimes such as unity's il2cpp The interpreter module is provided to transform them from pure AOT runtime to "AOT + Interpreter" hybrid operation mode.
HybridCLR is inspired by mono's [mixed mode execution](https://www.mono-project.com/news/2017/11/13/mono-interpreter/) technology and provides additional AOT runtimes such as unity's il2cpp Interpreter modules are provided to transform them from pure AOT runtime to "AOT + Interpreter" hybrid runtime.
![icon](https://github.com/focus-creative-games/hybridclr/raw/main/docs/images/architecture.png)
More specifically, HybridCLR does the following:
- Implemented an efficient metadata (dll) parsing library
- Modified the metadata management module to realize the dynamic registration of metadata
- The metadata management module has been transformed to realize dynamic registration of metadata.
- Implemented a compiler from IL instruction set to custom register instruction set
- Implemented an efficient register interpreter
- Provide a large number of instinct functions to improve the performance of the interpreter
## The Difference From Other C# Hot-Update Solution
HybridCLR is a native c# hot update solution. In layman's terms, il2cpp is equivalent to the aot module of mono, and HybridCLR is equivalent to the interpreter module of mono, and the combination of the two becomes a complete mono. HybridCLR makes il2cpp a full-featured runtime, natively (that is, through System.Reflection.Assembly.Load) supports dynamic loading of dlls, thereby supporting hot updates of the ios platform.
Just because HybridCLR is implemented at the native runtime level, the types of the hot update part and the AOT part of the main project are completely equivalent and seamlessly unified. You can call, inherit, reflect, and multi-thread at will, without generating code or writing adapters.
Other hot update solutions are independent vm, and the relationship with il2cpp is essentially equivalent to the relationship of embedding lua in mono. Therefore, the type system is not uniform. In order to allow the hot update type to inherit some AOT types, an adapter needs to be written, and the type in the interpreter cannot be recognized by the type system of the main project. Incomplete features, troublesome development, and low operating efficiency.
## Supported Versions And Platforms
- Support 2019.4.x, 2020.3.x, 2021.3.x, 2022.3.x full series of LTS versions. The `2023.2.0ax` version is also supported, but not released to the public.
- Supports all il2cpp supported platforms
- Provides a large number of additional instinct functions to improve interpreter performance
## Stability Status
HybridCLR has been widely verified as a very efficient and stable solution for hot update of Unity.
HybridCLR has been widely proven to be a very efficient and stable Unity hot update solution.
The official versions of **extremely stable** 1.x, 2.x, and 3.x are currently released, which are sufficient to meet the stability requirements of large and medium-sized commercial projects.
At present, at least thousands of commercial game projects have been integrated, and hundreds of them have been launched on both ends. The online projects include MMORPG, heavy card, heavy tower defense and other games. **Most top game companies** (such as Tencent and NetEase) are already using HybridCLR.
Currently, the **extremely stable** official versions of 1.x-5.x have been released, which are sufficient to meet the stability requirements of large and medium-sized commercial projects.
Currently, thousands of commercial game projects have been connected, and hundreds of them have been launched on both ends. The online projects include MMORPG, heavy card, heavy tower defense and other games. **The vast majority of leading game companies** (such as Tencent and NetEase) are already using HybridCLR.
You can read the [game projects in top game companies](https://hybridclr.doc.code-philosophy.com/en/docs/other/businesscase) those are using HybridCLR and has been launched.
You can view the [list of projects] (https://hybridclr.doc.code-philosophy.com/docs/other/businesscase) that use HybridCLR and have been launched in leading companies we know.
## Support And Contact
## Support & Contact
- Official 1 group: 651188171 (full)
- Novice QQ group 1: 428404198 (full)
- Novice QQ group 2: **680274677 (recommended)**
- discord channel [https://discord.gg/BATfNfJnm2](https://discord.gg/BATfNfJnm2)
- Official group 1: 651188171 (full)
- Novice group 1: 428404198 (full)
- Newbie Group 2: **680274677 (recommended)**
- discord channel https://discord.gg/BATfNfJnm2
- Business cooperation email: business#code-philosophy.com
- [Commercial Support](https://hybridclr.doc.code-philosophy.com/en/docs/business/intro)
- [Business support](https://hybridclr.doc.code-philosophy.com/docs/business/intro)
## About The Author
## About Author
**walon** : Founder of **Code Philosophy (code philosophy)**
**walon**: **Code Philosophy** founder
Graduated from the Department of Physics of Tsinghua University, won the CMO gold medal in 2006, a member of the National Mathematical Olympiad Training Team, and was recommended to Tsinghua University for basic courses. Focus on game technology, good at developing architecture and basic technical facilities.
Graduated from the Physics Department of Tsinghua University, won the CMO gold medal in 2006, was a member of the National Mathematical Olympiad training team, and was recommended to Tsinghua Basic Science Class. Focus on game technology, good at developing architecture and basic technical facilities.
## License

View File

@ -10,11 +10,11 @@
<br/>
<br/>
HybridCLR是一个**特性完整、零成本、高性能、低内存**的**近乎完美**的Unity全平台原生c#热更方案。
HybridCLR是一个**特性完整、零成本、高性能、低内存**的**近乎完美**的Unity全平台原生c#热更新解决方案。
HybridCLR扩充了il2cpp代码,使它由纯[AOT](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) runtime变成AOT+Interpreter 混合runtime进而原生支持动态加载assembly使得基于il2cpp backend打包的游戏不仅能在Android平台也能在IOS、Consoles等限制了JIT的平台上高效地以**AOT+interpreter**混合模式执行,从底层彻底支持了热更新
HybridCLR扩充了il2cpp运行时代码,使它由纯[AOT](https://en.wikipedia.org/wiki/Ahead-of-time_compilation) runtime变成AOT+Interpreter 混合runtime进而原生支持动态加载assembly从底层彻底支持了热更新。使用HybridCLR技术的游戏不仅能在Android平台也能在IOS、Consoles、WebGL等所有il2cpp支持的平台上高效运行
HybridCLR不仅支持传统的全解释执行模式还开创性地实现了 [Differential Hybrid Execution差分混合执行技术](https://hybridclr.doc.code-philosophy.com/docs/business/differentialhybridexecution) 差分混合执行技术。即可以对AOT dll任意增删改会智能地让变化或者新增的类和函数以interpreter模式运行但未改动的类和函数以AOT方式运行让热更新的游戏逻辑的运行性能基本达到原生AOT的水平。
由于HybridCLR对ECMA-335规范 的良好支持以及对Unity开发工作流的高度兼容Unity项目在接入HybridCLR后可以几乎无缝地获得C#代码热更新的能力开发者不需要改变日常开发习惯和要求。HybridCLR首次实现了将Unity平台的全平台代码热更新方案的工程难度降到几乎为零的水平。
欢迎拥抱现代原生C#热更新技术
@ -22,17 +22,28 @@ HybridCLR不仅支持传统的全解释执行模式还开创性地实现了 [
- [官方文档](https://hybridclr.doc.code-philosophy.com/docs/intro)
- [快速上手](https://hybridclr.doc.code-philosophy.com/docs/beginner/quickstart)
- [发布日志](./RELEASELOG.md)
- [商业项目案例](https://hybridclr.doc.code-philosophy.com/docs/other/businesscase)
## 特性
- 特性完整。 近乎完整实现了[ECMA-335规范](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/),只有极少量的[不支持的特性](https://hybridclr.doc.code-philosophy.com/docs/basic/notsupportedfeatures)。
- 零学习和使用成本。 HybridCLR将纯AOT runtime增强为完整的runtime使得热更新代码与AOT代码无缝工作。脚本类与AOT类在同一个运行时内可以随意写继承、反射、多线程(volatile、ThreadStatic、Task、async)之类的代码。不需要额外写任何特殊代码、没有代码生成,几乎没有限制。
- 近乎完整实现了[ECMA-335规范](https://www.ecma-international.org/publications-and-standards/standards/ecma-335/),只有极少量的[不支持的特性](https://hybridclr.doc.code-philosophy.com/docs/basic/notsupportedfeatures)。
- 零学习和使用成本。对绝大多数开发者来说写代码近乎没有限制。 热更新代码与AOT代码无缝工作可以随意写继承、**泛型**、**反射**之类的代码。不需要额外写任何特殊代码、没有代码生成
- 完全支持多线程,包含但不限于 volatile、ThreadStatic、async Task等相关功能和特性。这是其他所有热更新方案都不支持的
- 几乎完全兼容Unity的工作流。包括且不限于支持热更新**MonoBehaviour**、ScriptableObject、**DOTS**技术,资源上挂载的热更新脚本可以正确实例化,这是其他所有热更新方案都不支持的
- 执行高效。实现了一个极其高效的寄存器解释器,所有指标都大幅优于其他热更新方案。[性能测试报告](https://hybridclr.doc.code-philosophy.com/docs/basic/performance)
- 内存高效。 热更新脚本中定义的类跟普通c#类占用一样的内存空间,远优于其他热更新方案。[内存与GC](https://hybridclr.doc.code-philosophy.com/docs/basic/memory)
- 由于对泛型的完美支持使得因为AOT泛型问题跟il2cpp不兼容的库现在能够完美地在il2cpp下运行
- 内存高效。 热更新脚本中定义的类跟普通c#类占用一样的内存空间,远优于其他热更新方案。[内存占用报告](https://hybridclr.doc.code-philosophy.com/docs/basic/memory)
- 支持MonoPInvokeCallback可以与native代码或者其他语言如lua、javascript、python良好交互
- 支持一些il2cpp不支持的特性如__makeref、 __reftype、__refvalue指令
- [Differential Hybrid Execution差分混合执行技术](https://hybridclr.doc.code-philosophy.com/docs/business/differentialhybridexecution)
- 支持独创的 **Differential Hybrid Execution(DHE)** 差分混合执行技术即可以对AOT dll任意增删改会智能地让未改动的函数以AOT方式运行变化或者新增的函数以interpreter模式运行让热更新的游戏逻辑的运行性能基本达到原生AOT的水平
- 支持 **热重载** 技术可以100%卸载程序集
- 支持现代的dll加密技术有效保障代码安全
## 支持的版本与平台
- 支持2019.4.x、2020.3.x、2021.3.x、2022.3.x、2023.2.x、**6000.x.y**全系列LTS版本
- 支持所有il2cpp支持的平台
- 支持团结引擎和鸿蒙平台
## 工作原理
@ -48,29 +59,15 @@ HybridCLR从mono的 [mixed mode execution](https://www.mono-project.com/news/201
- 实现了一个高效的寄存器解释器
- 额外提供大量的instinct函数提升解释器性能
## 与其他流行的c#热更新方案的区别
HybridCLR是原生的c#热更新方案。通俗地说il2cpp相当于mono的aot模块HybridCLR相当于mono的interpreter模块两者合一成为完整mono。HybridCLR使得il2cpp变成一个全功能的runtime原生即通过System.Reflection.Assembly.Load支持动态加载dll从而支持ios平台的热更新。
正因为HybridCLR是原生runtime级别实现热更新部分的类型与主工程AOT部分类型是完全等价并且无缝统一的。可以随意调用、继承、反射、多线程不需要生成代码或者写适配器。
其他热更新方案则是独立vm与il2cpp的关系本质上相当于mono中嵌入lua的关系。因此类型系统不统一为了让热更新类型能够继承AOT部分类型需要写适配器并且解释器中的类型不能为主工程的类型系统所识别。特性不完整、开发麻烦、运行效率低下。
## 支持的版本与平台
- 支持2019.4.x、2020.3.x、2021.3.x、2022.3.x全系列LTS版本。`2023.2.0ax`版本也已支持,但未对外发布。
- 支持所有il2cpp支持的平台
## 稳定性状况
HybridCLR已经被广泛验证是非常高效、稳定的Unity热更新解决方案。
当前发布了**极其稳定**的1.x、2.x、3.x正式版本足以满足大中型商业项目的稳定性要求。
目前至少有上千个商业游戏项目完成接入其中有几百款已经双端上线上线的项目中包括MMORPG、重度卡牌、重度塔防之类的游戏。**绝大多数头部游戏公司**如腾讯、网易都已经在使用HybridCLR。
当前发布了**极其稳定**的1.x-5.x正式版本足以满足大中型商业项目的稳定性要求。
目前有数千个商业游戏项目完成接入其中有几百款已经双端上线上线的项目中包括MMORPG、重度卡牌、重度塔防之类的游戏。**绝大多数头部游戏公司**如腾讯、网易都已经在使用HybridCLR。
可查看我们已知的头部公司中使用HybridCLR并且已经上线的[项目列表](https://hybridclr.doc.code-philosophy.com/docs/other/businesscase)。
## 支持与联系
- 官方1群651188171