by torginus · 4y ago · 0 comments
Unity has it's own dependency management, project system, runtime, idea of threading/parallelism, concurrency, networking etc.
Usually when one gets involved in some language ecosystem, the language is the small part, getting to know the libraries, and the idiomatic way of getting things done tends to be the emphasis. Here the ecosystems (Unity's and .NET's ) tend to be quite different.
https://docs.unity3d.com/Packages/com.unity.burst@0.2/manual...
Their first idea was, instead of updating Mono, what if they compiled .NET IL to C++, resulting in the monstrosity that was IL2CPP. If you are interested in what sort of C++ code it generated, here's a link:
https://www.jacksondunstan.com/articles/4654
It's full of goto-s, helper method calls, and passing around these weird helper objects to every method.
They triumphantly announced their perf gains - compared to their own old impl, which I remember being slower than Python at times.
Then came Burst/ECS, like you mentioned, the former of which is working pretty well, but requires you to rewrite your C# code, with Unity-licenced dependencies, so even if you wrote a kickass dynamic tessellation library, it could be only used in Unity, because of said deps. The latter is still in forever Unity innovation limbo.
Meanwhile in Unreal-land, they used pretty much standard C++, for a decade, no arcane space-magic ECS found here - and the code has been pretty much stable for that time.
Heh.
None of those of those decisions seem strange once you view them through the lens of some game devs full of hubris :-)
Also the serialization system in Unity tends to interact weirdly with more complex .NET object hierarchies, so expect strange things to happen.