The DOTS Matrix
by Martin Sherman-Marks in Project Notes |
The Unity game engine is on the verge of a revolution, and that revolution... is DOTS.
Alas, I'm reliably informed that DOTS is not, in fact, short for "Princess Angelina Contessa Louisa Francesca Banana Fana Bobesca the Third" but rather for "Data-Oriented Technology Stack." As for what it means, though... it means that Unity is about to make a huge leap forward in performance. I won't dwell on the technical details - you can read all about them on Unity's page - but the most important element from a Charm Cities perspective is that DOTS allows Unity to take full advantage of multicore processors.
(Fair warning to people with a programming background: I'm writing this blog for a general audience and will be giving a very broad overview that is inaccurate in many of the particulars. Please direct all complaints to @infinite_scream on Twitter, who will respond promptly and appropriately.)
If you're reading this on a modern desktop, odds are good that the CPU inside your computer actually contains more than one processor - possibly even far more than one. This means that it's theoretically possible to design software that runs in parallel across multiple processor cores at the same time. Instead of running task A and then task B, you can run task A and task B. But as obvious as the benefit is, the programming challenges it creates are legendarily complex. Distributing workload across multiple processor cores adds a whole host of non-intuitive problems, leading to more bugs and raising barriers to entry for less experienced programmers.
DOTS is Unity's solution to this, and to a few other bottlenecks in game performance. Or, rather, DOTS is the philosophy underlying Unity's solution to this. It's actually a collection of new programming paradigms and tools that make multithreading just work by default. This is great for any game, but for Charm Cities it's enormous. Our performance bottleneck isn't going to be the graphics, as with something like a first-person shooter game, it's going to be the simulation engine itself. Player cities will be full of thousands of individual AI agents - the HONs - making their own unique decisions, and having all of those AIs sharing a single processor core is going to get pretty messy pretty fast. So, naturally, DOTS opened up new doors for how to dramatically increase performance in the simulation engine, and we were all really excited to see it get added to Unity 2020.
Just one minor problem... it didn't. It was a major feature of the Unity 2020 Roadmap, but key packages are still in preview and aren't considered ready yet. Users can use preview packages (although this was made substantially harder by changes to the package manager in Unity 2020), but it's understood that they will change. Documentation is sketchy at best, out-of-date at worst, and there's no real community of experienced users yet.
Because of this dilemma, we're going to keep focusing for a little while on planning, art assets, and other non-coding work while we wait and see where DOTS is headed. Personally, I also have a side project I'm working on with my kid, which I'll probably discuss here eventually. And it's still 2020, with all the :: gestures at universe :: that entails, so to be honest finding space for Charm Cities was already difficult.
Inconvenient timing notwithstanding, DOTS is going to be an amazing addition to the Unity ecosystem and to Charm Cities in particular. We're looking forward to it. Until then, as the Warners would say: goodnight, everybody!