Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
I don't know what you mean by enable JIT with other dlls. All c# code is jited by mono.
Burst uses LLVM. If you look at LLVM release page on github [github.com], the binary release is 800mb. I don't know where you are expecting this compiler to come from and compile your code.
The main reason I don't like the [BurstCompile] attribute is it makes your guide misleading. By adding it you are leading people to think this code will be compiled by Burst and is performant. But it's not, it is still run by the CLR. Even though you can loop through component data and modify them there is still a negative performance impact.
There is no difference with/without the [BurstCompile] attribute.
(code: adding a simple line `for (var i=100000000;i-->0;){}`, the frame rate is ~10 FPS no matter whether the attribute is set.)
But I cannot ensure whether we could enable JIT with some other dlls.
Thus I'll keep them.
"I choose to believe my code works." No coder should ever say that.
I cannot tell whether you're correct, since I have no knowledge about unity.burst until I started writting mods for this game.
The performance issue might be, JIT always slower than AOT. Even with some JIT support, the generated code might be slower.
Anyway, maybe you're correct, but I just cannot ensure that.
Currently, the [BurstCompile] seems like another God. You could believe it works, or not. In all cases, adding the [BurstCompile] won't be slower than without it.
I choose to believe its existance. And maybe someone could find out how to enable JIT(even AOT) for mods. In that case, keeping such attribute should be a better choice.
0x00007FF838628AE8 (UnityPlayer) (function-name not available)
ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF8382A6F6F)
0x00007FF8382A6F6F (UnityPlayer) (function-name not available)
0x000001E9F779AF83 (Mono JIT Code) (wrapper managed-to-native) Unity.Jobs.LowLevel.Unsafe.JobsUtility:ScheduleParallelFor_Injected (Unity.Jobs.LowLevel.Unsafe.JobsUtility/JobScheduleParameters&,int,int,Unity.Jobs.JobHandle&)
[/code]
It happens in the schedule call because of some memory access violation. I don't know what's causing the memory violation. However I can schedule empty jobs with IJobParallelFor which also uses ScheduleParallelFor_Injected.
For the jobs themselves I use IJobEntityBatch example from unity docs [docs.unity3d.com]
The crash that happens when you call ScheduleParallel is not from Burst code. It's from unity player. The crash log is at C:\Users\username\AppData\Local\Temp\Door 407\Diplomacy is Not an Option\Crashes.
游戏没有可用的API文档
如果你熟悉linux的话你可以参照gitee源码的前100行(编译用的sh脚本)自己编译
如果你不熟linux,可以打开windows的wsl,然后在wsl里面装dotnet sdk,之后用命令
./"Diplomacy is Not an Option.cs" d
编译dll(这需要把"Diplomacy is Not an Option.cs"和"utils.cs"下载到steamapps文件夹里,然后cd 到steamapps目录)
至于Mod成品dll在哪儿以及该怎么使用,我不想教
毕竟这里是写mod的指南,不是给mod打广告的指南
Burst同时具有AOT和JIT两种模式,虽然mod并不能以AOT模式运行,但Mod的确可以跑在JIT模式下。