Live data from Hacker News

Why Cities: Skylines 2 performs poorly

blog.paavo.me

561–570 of 593 posts

Re: Why Cities: Skylines 2 performs poorly

#561
post #556

Earlier quoted context omitted.

Tbh, there are many ways to skin a cat, using ECS is not necessary to ship a performant game, not is it necessarily the modern thing to do. It's one of the many architectural patterns you can build a game on top of, and has many advantages as well as detractors. For example, Godot isn't really build around ECS, but the idea of servers which are mostly autonomous game subsystems that can process their area of expertis…

Sure, but surely a city simulation is the perfect textbook use case for a cache-friendly architecture like ECS?

Well, ECS only makes some operations cache friendly/parallelizable - namely linear iteration through the array of entities, where not all fields of each entity are used.

I'd imagine a city simulation involves a lot of graph lookup and traversal, spatial lookups and is generally a hairy and messy affair, not sure how easy it is to adapt that to ECS.

Then again, SimCity and Transport Tycoon simulated complex cities on, by today's standards, very frugal hardware, so city simulation might not even be such a CPU hog.

Re: Why Cities: Skylines 2 performs poorly

#562
I am surprised that the issues are so basic. When I heard, that Cities Skylines 2 had a bad performance I expected something like they were using the GPU for graphics as well as for the simulation, but didn't have a good scheduler or so (something new/unproven).

However, after reading this, it seems to be mostly a rendering issue with even basic stuff missing, like LOD models or occlusion culling?!? Feels like someone had to optimize the rendering engine after Unity didn't deliver, but skipped the '101 of how to optimize a renderer' in the first place.

Re: Why Cities: Skylines 2 performs poorly

#563
post #221
post #102

> This mesh of a pile of logs is similarly only used in the shadow rendering pass, and features over 100K vertices. But… why?

Because it is one of the 1,000,000 things to pay attention to in game development. Someone or some software probably just made a mistake in setting up its LOD. Or some dynamic LODding code didn't properly cull the LOD0 mesh. Or that code couldn't be finished in time. Or it was something else. It's completely normal in AAA games to have a few imperfect and in-optimal things. Budgets are always limiting, and developmen…

> It's a fun fact that this mesh is LOD0, and so is the teeth mesh. But that alone doesn't tank the performance of the game and is probably unlikely to be addressed in lieu of actual performance fixes. The fixation on these meshes in the thread is kind of excessive.

So I assume you have a better explanation of the excessively slow G-buffer and shadowmap passes?

Re: Why Cities: Skylines 2 performs poorly

#564
post #102

> This mesh of a pile of logs is similarly only used in the shadow rendering pass, and features over 100K vertices. But… why?

Well, because when you’re modeling a pile of logs, each additional log you add doubles the number of vertices. This is a well known property of log scaling.

If you make natural looking logs, it’s a factor of 2.7 or so.

Re: Why Cities: Skylines 2 performs poorly

#565

Earlier quoted context omitted.

Nobody sets out to make a bad game or "waste effort" on "useless" features. Things like this happen because the people giving you money have a hard deadline and you ship what you have. Or you decide to use a game engine that was more difficult to use than expected. It's insulting to say "well, just make the game better first, duh". I promise you, they know. But they have to balance a lot of things you don't see. If y…

I would believe this.... if 1. games made 15 or 20 years ago 2. and indie games made today would not be able to manage it. It's always the bigger studios who utterly mess up in making an actually playable game, which indicates that the problem is not something inherent but a simple product of laziness and greed. (Latest example: see Creative Assembly's meltdown)

That's just bias on your part.

You don't see the thousands of indie games that were never released because the creators screwed it up, or they ran out of money.

Or the indie studios who never made a second game because they didn't recoup their costs.

Indies that fail just fold and you never hear about them. AAA that fail release their games.

Re: Why Cities: Skylines 2 performs poorly

#566

Earlier quoted context omitted.

This for sure. City builders, and certain classes of RTS are really the last major forms of games that really are very poor fits for modern off the shelf engines. Honestly, trying to build one in either Unreal or Unity is going to be a painful experience with challenges likely surpassing having just built the engine you need in the first place. But Engine selection is really only a technical decision less then half t…

Frost giant is building stormgate, the spiritual successor of starcraft 2, with even better/smoother gameplay than sc2 with Unreal Engine 5, they picked what parts they reused such as the renderer and built the underlying stuff from scratch, but still

That seems like a slightly different scale of simulation, though... a SC-like RTS with a few hundred units at most, vs tens of thousands of citizens in Skylines?

I'd more compare it with something like Dyson Sphere Project, which can scale from a few factories & conveyor belts to many planets and thousands of things (resources, drones, belts, arms, whatever) on-screen at once. It's also made in Unity and has great performance and terrific graphics.

Re: Why Cities: Skylines 2 performs poorly

#567
post #542

Earlier quoted context omitted.

“If you’ve used more triangles than there are pixels on the screen, you’ve messed up.” I call this kind of thing the “kilobyte rule” because a similar common problem is shoving tens of megabytes of JSON down the wire to display about a kilobyte of text in a browser.

Well, not anymore, Epic's Nanite is basically a triangle per pixel rendering.

It’s actually very nearly optimal: using as many triangles as needed to display as much detail as possible while staying under the one triangle per pixel limit.

That’s the opposite of using 10K pixels to render two pixels on the screen.

Re: Why Cities: Skylines 2 performs poorly

#568
post #559

Earlier quoted context omitted.

I have yet to see, with the exception of the software world, engineering with such loose process.

It's common to start constructing buildings before the design is even complete. And there can be huge "tech debt" disasters in civil engineering. Berlin Airport is one famous example.

>It's common to start constructing buildings before the design is even complete.

Of which the Sydney Opera House is one of the better known examples.

Re: Why Cities: Skylines 2 performs poorly

#569
post #556

Earlier quoted context omitted.

Sure, but surely a city simulation is the perfect textbook use case for a cache-friendly architecture like ECS?

Well, ECS only makes some operations cache friendly/parallelizable - namely linear iteration through the array of entities, where not all fields of each entity are used. I'd imagine a city simulation involves a lot of graph lookup and traversal, spatial lookups and is generally a hairy and messy affair, not sure how easy it is to adapt that to ECS. Then again, SimCity and Transport Tycoon simulated complex cities on,…

Yeah, good point. I guess you'd have to rethink almost every algorithm from scratch. I'm not even sure what a cache-friendly A* would look like and that's basic.

Re: Why Cities: Skylines 2 performs poorly

#570
post #547
post #389

Earlier quoted context omitted.

What if we’re more charitable and consider that maybe the modelers assumed that they were doing the most detailed models and someone else would be processing them to produce derivatives for lower zoom levels? It’s rare that something like this happens because nobody knew it was a problem but rather that there is a management dysfunction around priorities and resources.

> rather that there is a management dysfunction around priorities and resources That’s never only a management dysfunction. You also need a large group lacking either common sense or a backbone (ask me how I know).

That sounds like a failure to set the right culture in the company, though? I’m not saying that nobody else is to blame in that situation but in general responsibility starts at the top where people are paid enormous sums precisely to handle problems like that.
Post reply on HN