Skip to content

Commit

Permalink
更新dots和团结引擎相关文档
Browse files Browse the repository at this point in the history
  • Loading branch information
pirunxi committed Dec 18, 2023
1 parent 0e82161 commit bd5fb47
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/basic/notsupportedfeatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:::

- 暂时不支持在热更新脚本中定义extern函数,但可以调用AOT中extern函数。
- 完全支持2022的dots技术,但无法利用burst加速。如果burst部分在AOT,则仍然原生方式执行;如果burst部分在热更部分,则虽然是Jobs并发执行,但以解释方式执行。
- 支持2022的dots技术,需要小幅修改dots代码以支持动态注册component和system类型(**需要购买商业化版本获得实现细节**),而且无法利用burst加速。如果burst部分在AOT,则仍然原生方式执行;如果burst部分在热更部分,则虽然是Jobs并发执行,但以解释方式执行。
- 不支持`System.Runtime.InteropServices.Marshal``Marshal.StructureToPtr`之类序列化结构的函数,但普通Marshal函数如`Marshal.PtrToStringAnsi`都是能正常工作的。
- 不支持[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.xxx)]。纯粹是时机问题,Unity收集这些函数的时机很早,此时热更新dll还没加载。一个推荐的办法是你使用反射收集这些函数,在合适的时机主动调用它们。
- 不支持对解释代码部分进行C#级别调试,因为没暂时没时间写调试器
Expand Down
2 changes: 1 addition & 1 deletion docs/business/differentialhybridexecution.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Differential Hybrid Execution
# 差分混合执行

HybridCLR开创性地实现了 Differential Hybrid Execution(DHE) 差分混合执行技术。即可以对AOT dll任意增删改,会智能地让变化或者新增的类和函数以interpreter模式运行,但未改动的类和函数以AOT方式运行,让热更新的游戏逻辑的运行性能基本达到原生AOT的水平。

Expand Down
2 changes: 2 additions & 0 deletions docs/business/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
|Unity 2020-2022 LTS|||||
|Unity 2019 LTS|从3.x版本起不再支持||||
|[完全泛型共享](./fullgenericsharing)|||||
|[Unity DOTS技术](./supportdots)|||||
|团结引擎和鸿蒙平台(进行中)|||||
|[元数据优化](./metadataoptimization.md)|||||
|[标准指令优化](./basiccodeoptimization)|||||
|[标准代码加固](./basicencryption)|||||
Expand Down
8 changes: 8 additions & 0 deletions docs/business/supportdots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 支持Unity DOTS技术

当前DOTS在系统启动时即已初始化所有Component、System等核心类型,导致解释程序集中使用自定义的Component等类型会出现错误。
需要对DOTS源码进行修改才能支持热更新类型。

商业化版本提供了解决方案,可以在热更新模块中正常使用DOTS技术。不过要注意,由于对Component的操作变成了解释执行而无法使用burst技术,导致性能大幅下降,
最终效果相当于只利用了jobs的多线程来加速执行。

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ There are currently three commercial versions. The specific features are compare
|Unity 2020-2022 LTS|||||
|Unity 2019 LTS|No longer supported since 3.x||||
|[Full Generic Sharing](./fullgenericsharing)|||||
|[Unity DOTS Technology](./supportdots)|||||
|Tuanjie(Unity China) Engine and HarmonyOS Platform (in progress)|||||
|[Metadata Optimization](./metadataoptimization.md)|||||
|[Standard command optimization](./basiccodeoptimization)|||||
|[Standard code reinforcement](./basicencryption)|||||
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Support Unity DOTS technology

Currently, DOTS has initialized all core types such as Component and System when the system starts, resulting in errors when using custom Component and other types in the interpreter assembly.
The DOTS source code needs to be modified to support the hot update type.

The commercial version provides a solution to use DOTS technology normally in hot update modules. However, it should be noted that since the operation of Component becomes interpreted and executed, burst technology cannot be used, resulting in a significant performance drop.
The final effect is equivalent to using only the multi-threading of jobs to speed up execution.
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const sidebars = {
'business/intro',
'business/differentialhybridexecution',
'business/fullgenericsharing',
'business/supportdots',
'business/metadataoptimization',
'business/basiccodeoptimization',
'business/basicencryption',
Expand Down

0 comments on commit bd5fb47

Please sign in to comment.