Unity just dropped this jaw-dropping video demonstrating its Entity Component System, featuring "4.5 million Mesh renderers, 200,000 unique objects per building, 100,000 individual audio sources, 5000 dynamic vehicles", all running at 60 frames per second. More from the company blog:
Create massive game worlds with ECS: Our Entity Component System (ECS) team has teamed up with two artists from the FPS Sample team and in just two months they have produced a futuristic cityscape showcasing our current progress on the ECS foundation and Burst. The demo was built using 2018.3 with some modification and the plan is to ship this demo to the public with full source and assets sometime in 2019. It heavily relies on the new Nested Prefab workflow also available in 2018.3, as well as newly developed features that enhance the experience of working with very large sets of GameObjects. It demos asynchronous scene streaming, a new ECS culling system, C# audio system, and HLOD among many improvements to ECS tooling and debugging features.
That's a lot of 3D graphic geekspeak, so I turned to Adam Frisby, my local Unity 3D expert, to explain what this means for developers:
"Technically ECS is already available in current Unity releases -- its real benefit is in swarm management; there are occasional cases where you might want to have hundreds of thousands or millions of 'something' (be it enemies in a game, or buildings, or particle effects, etc). ECS lets you squeeze the last drop of performance out in managing them with minimal overhead."
However, don't always expect the kind of performance that you're seeing in this demo: "[T]hey've clearly pushed instancing to new levels to get 4.5 million objects in a single scene, even on mobile. However it is important to note that this is just rendering and audio - once you add physics back into the mix the overall practical limit might be lower."
Also, this cautionary point: "Most developers - particularly new ones - probably wouldn't, and shouldn't, be touching this. It's very much a specialized system intended for specific applications; it will increase your workflow requirements using it -- but if you're doing something specialized and need raw performance, it's great."
Adam's analysis of the back-end code changes, and why they're important:
"What is worth noting is that using the Burst compiler & Job system (part of the ECS feature group), Unity have managed to get C# code running faster than vanilla C++ which is effectively native code. (Check this out.)" And why that matters: "Traditionally in computer programming you have two camps -- the native camp (ASM/C/C++), which writes code that can translate more or less into what executes on the CPU. You also have the managed camp (Java/C#/etc), which writes code that is broadly speaking interpreted before being executed on the CPU. Native code is easier to crash, be subject to security issues, but typically runs 2-3x faster than managed code. Burst Compiled C# produces native output, but from within the framework of a managed application; giving you a best of both worlds scenario."
As you might have guessed, Adam is planning to implement ECS in his multiuser platform Sinespace (disclosure: an NWN sponsor) soon:
"[W]e're at the moment upgrading to Unity 2018.2 (the current latest non-beta release), and part of that has been investigating some of the new technologies they've released since our last update earlier in the year. The same technology that is letting them push 4.5 million objects, also lets us do many tasks much faster - which will boost loading times and framerates for everyone once we've fully integrated them... For us, the real benefit will be in things like vegetation - ECS should allow you to populate forests with rich layers of vegetation and realistic object counts."
Comments