A technical evaluation of the graphics rendering in Cities: Skylines 2 has recognized the rationale why the efficiency is simply so poor. Put merely, the sport is making an attempt to attract the cityscapes utilizing a stunning variety of polygons, with few programs in place to cut back the quantity when it is not wanted. It is not one thing that ought to be occurring in a contemporary sport however the latest breakdown additionally suggests adjustments inside Unity are partly in charge, too.
Earlier than the sport even got here out, developer Colossal Order issued a warning to potential clients that the efficiency of Cities: Skylines 2 had “not achieved the benchmark we focused.”
And when town administration sequel lastly appeared, it turned out the dev wasn’t kidding and the one approach to get any semblance of a good body price was to whack a lot of the graphics settings right down to low or utterly off. The primary patch for the sport helped issues a bit however the reality stays that, as a simulation-management sport, it actually should not be as GPU-dependent as it’s.
I discovered the total reply to that puzzle over the weekend, by way of a brief Reddit put up. It accommodates two issues: A hyperlink to a technical evaluation of the sport, involving a spot of decompiling and rendering software program instruments, and a very good dialogue of the findings. The breakdown was carried out by software program developer Paavo Huhtala, who explored the sport’s internal workings with a high quality toothcomb.
It is a lengthy and dense learn, particularly if you do not know a lot about rendering, however the major difficulty is that the cityscapes are being drawn utilizing means too many polygons. And I imply by a number of orders of magnitude too many. How do 25,000 vertices (corners of a triangle) sound for a easy clothesline mannequin?
When you want a degree of reference, take the clothes fashions utilized in Cyberpunk 2077. A few of them use an infinite variety of polygons and I’ve seen one with as many as 29,500. However that is triangles and these will share corners, as they’re ‘stitched’ collectively. The precise variety of vertices for that jacket could possibly be as little as 8,000.
There’s a lot occurring within the Cities: Skylines 2 engine is making almost 7,000 draw calls and over 50,000 API calls (requests made by the sport, by way of DirectX) in a single body. Now these figures by themselves, and set in no context do not imply very a lot, however they’re each huge usually and indicative of the sport asking far an excessive amount of of the GPU.
For instance, taking a random scene in Cyberpunk 2077’s cityscape exhibits fewer than 10,000 API calls are required to render the body. Now, one cannot immediately evaluate these two video games as they’re so very completely different, and city-sim video games are more likely to be making extra calls than any shooter, because the world adjustments a lot and fills up with numerous interacting fashions. Besides, 50,000 is…effectively, a lot!
Usually that many calls would make a sport extremely CPU-bound, however not so with Cities: Skylines 2. That is as a result of there are but extra issues that simply completely grind down the GPU. Lots of the excessive polygon fashions used haven’t any so-called LOD (degree of element) variations.
These are simplified variations of the unique objects, constructed from fewer triangles, and get used when the merchandise is way from the digicam. In different phrases, there isn’t any level in preserving all the intricate particulars when you’ll be able to’t see them.
Do not forget that 29,500 polygon jacket I discussed earlier? It is by no means actually used within the precise sport, as LOD variations of this scale that quantity proper down. When it is being considered from far-off, the merchandise of clothes simply will get represented by a handful of triangles, and you may’t inform as a result of it is nothing various pixels on the monitor.
The builders overtly admitted this was inflicting efficiency points and that it could be resolved in time. Apparently, the choice to make use of excessive polygon depend fashions will “turn out to be related in the way forward for the mission,” no matter which means.
For the body evaluation, Huhtala famous that 36 million triangles needed to be processed for a number of rendering passes. Whereas quite a lot of these aren’t seen on display, it is nonetheless an excessively excessive quantity and would solely get bigger as town expands in the course of the gameplay.
It will get worse, although. It appears that evidently Cities: Skylines 2 would not seem to cull objects that are not seen notably effectively and mixed with the tactic used for creating shadows (4 separate rendering passes only for shadows), an enormous period of time is wasted on processing knowledge that is utterly pointless. Almost three quarters of all of the draw calls and half the body time within the evaluation had been for simply doing the shadows!
Because of this the sport performs so a lot better whenever you set the element ranges to low, disable shadows, and the rest that depends on geometry. So it could seem that the builders simply made an actual mess of issues and that they need to be held totally liable for all of it, should not they? Effectively, maybe not.
Huhtala’s evaluation goes additional than simply inspecting a body of rendering. Utilizing a decompiling software to peek inside how the sport was utilising Unity (the engine package deal used to create the sport) highlights numerous issues that had been considerably outdoors of the builders’ palms.
Cities: Skylines 2 seems to make heavy use of two main options of Unity: DOTS and HDRP. The previous is a fancy however highly effective assortment of software program packages that, in principle, allow video games to be vastly intricate and wealthy in object interplay; the latter is the engine’s excessive definition rendering pipeline and is required if you wish to make use of all the newest graphics wizardry in your sport.
You do not really want to know what they do, although, as that is probably not the difficulty. Colossal Order started work on Skylines 2 means again in 2018, fairly some time earlier than DOTS reached a public launch. Even HDRP wasn’t totally prepared then or actually nothing like its present standing. Huhtala suggests the devs needed to write out quite a lot of code themselves, just because Unity both did not have what was wanted or the standing of the brand new software program options required important handcrafted options at the moment.
My very own take is it seems to be just like the developer was very unlucky with the timing of how issues had been altering below the hood of Unity however nonetheless made the choice to go down that route, regardless of understanding that it must do a good quantity of coding work to navigate by means of the system adjustments.
Maybe Colossal Order had hoped Unity would have pushed by means of all of the adjustments shortly, giving it enough time to familiarize yourself with all of it correctly. Nonetheless, it could appear it simply needed to ‘make do’ with what it had and ended up making some poor selections for the rendering methods.
However no matter this, the top result’s the sport runs actually badly, having been made by a workforce that selected a growth path that concerned utilizing software program that wasn’t totally prepared. Or on the very least, the builders would not have a lot expertise with it, as a result of it was so new.
On the subject of creating video games throughout a number of platforms and genres, Unity is usually the engine of selection for lots of of hundreds of tasks. However that does not imply it is easy to make use of and, if something, it is a fairly advanced system because it presently stands. The maker of Unity highlights that in the event you’ve been creating video games for a very long time, switching to DOTS is an enormous change.
Cities: Skylines 2 could turn out to be the sport it was supposed to be and this can all be forgotten about in time. However proper now, it stands as a reminder that making enormous, advanced video games is laborious and might go badly unsuitable in the event you make the unsuitable choices early on.