Question about performance, meshes, draw calls in City Simulations

hey guys, i don’t know of someone noticed the release of cities skylines, when watching the trailer i asked my self, how is it possible to render so much meshes and animations in realtime without
getting performance problems… ??? After creating a test scene in UE4, i dropped 4000 Mehses, each 200 tris strong on the map, even when turning off cast shadows for all the meshes, the performance
was horrible, like 40 FBS on a 780ti card. So what is the trick games like sim city, cities skyline etc… use to render so many meshes and anmiations, textures… without getting huge performance problems ?

I guess the problem is about draw calls ? Cause this amount of tris should not really be problem ? And what is the solution to handle this kind of scenes ?

LOD meshes and simplified materials for objects far from camera.
Just like forests are properly rendered. From very far away they are just sprites, not meshes.

Some games go even further by rendering a lot of sprites into a single larger sprite panel, for far objects.

^^^ Yup. LOD stands for Level of Detail and as the person above me noted it is a trick of the engine that tells the (in this case shaders that you will never have to care about) that if something is close to the player it should be beautiful and higher poly, but if it’s far away there is no need to render such a high poly mesh so you should save that budget and spend it on framerate. In the span of something like you mentioned, SimCity, the savings is huge. If there are 200 (at let’s say 1000 polys per) buildings on the screen but 120 are in “the distance” and LOD’d to 20% some basic math says there are 80 buildings on my screen at 1000 which is 80,000, and 120 at 200 which is 24,000 = 104,000.

Without using LODs it would be 200,000 polys on screen. Pretty huge difference. Most people use a more sophisticated “cascading” chain of effect on their LODs where they render at a mile distance so I’ll say anything within 2 miles of the player is 100%, at 5 miles drop it to 50%, at 10 drop it to 25% and render anything beyond that at only 5%. It’s calmer on the users’ eyes and saves EVEN MORE of that precious precious budget I talked about above. Most players’ eyes are drawn to the models with the most detail, so doing this isn’t detrimental to play either. Plus it causes the cause and effect where you want to see better so you zoom in, it renders a higher LOD and the process continues.

Here, this is the doc on simple static mesh LOD’s if you want to play around with them on that mesh you’ve got going on there. It’s pretty cool and really handy to use. I imagine you’ll see some performance optimization. Good luck!
https://docs.unrealengine.com/latest/INT/Engine/Content/FBX/StaticMeshes/index.html#staticmeshlods

thanks for the answers but I’m not really sure if these is just about lods, i also made a test with lods “i know what lods are and how to import them” where the tris count is reduced to 40 tris one mesh. But there is really no differnece in the performance. On the other hand ataching all the meshes into one mesh, gives me 100% of performance back. it looks more like a draw call problem to me ???

A forrest is a much more simple, cause trees are hidding other trees, the distance view is not so high, so bascially trees in a forrest are blocking the view which also reduces the draw calls and tris amount. But for a city building simulation, you really don’t have this possibility, cause there is no way to block the view at least no way which makes sense.

Another Test, First image 4000 Meshes, each mesh has a tri count of 500, Second image 4000 Meshes, each mesh has a tri count of 10. There is like no differnece in performnace, so like i wrote it’s not about lods or the tri count.
Hmm i’m really curious what the solution is to handle huge amount of meshes ???

4000 Meshes, 500 tris each mesh.

4000 Meshes, 10 tris each mesh.

The solution is instancing.

Take the same mesh and add it into the array of an instanced static mesh component. See what FPS you get then. The cities stuff will simply use a lot of instancing. That and really aggressive setup to optimize batches and such (like using atlas textures).

The reason you see an FPS drop is that there’s plenty of overhead with lots of actors in a scene. The per-actor overhead is quite high, so things like using static meshes, instancing, LOD as others have said. Take a look at the twitch stream for the dungeon generator done in blueprints for an example of what I mean, he explains how to use instanced meshes to speed up performance.

Profiling a city sim is really insane, there’s just a lot going on, and there’s a lot that the player is staring at so there’s very little to hide. But instanced meshes do help and when the camera angle is right in a city sim the buildings work as foliage. I’m sure you’ve read this but the doc on instanced meshes is pretty robust for unreal. You just minimize draw calls so that if you have 500 buildings you aren’t making 500 draw calls for those 500 meshes at all points in time even if they are LOD’d down to 10 polys in the bg.

thanks for the answers! @ all

@zoombapup can you post the link cause i can’t find the strem you are talking about.

Here you go. It’s worth checking out the discussion as well because it got really good after the stream in that thread.

Many thanks Lindsay !