Download

Performances / Optimization in Unreal Engine 4 games (Discussion)

Hi everyone !

Since I have been learning UE4 for a while now, I cannot help but to really analyse games that have been developed and shipped with this amazing engine.

As a former console gamer (a long time ago) who shifted to PC mainly because framerate / performances were really awful on the former, I’m really cautious about making a game as smooth as possible in term of fps. For those who played games such as Mass Effect 3 on PS3, you will know what I mean (for the others, you are lucky ;p)

Now, what I wanted to discuss about is that I noticed recently many badly optimized games coming out on PC on UE4. I can think of games such as The Outer Worlds, The Beast Inside, Blair Witch, Chernobylite, Remnant: From The Ashes,

The thing is I know also really amazing games in term of performance, graphics and level size such as The Vanishing of Ethan Carter, Overkill’s The Walking Dead (RIP). Even Batman Arkham Knight (Unreal Engine 3) has a huge amount of details, a quite big map, awesome graphics and run smoothly (at least nowadays, maybe it was not the same when it came out).

Now, I’m not here to critize the game themselves, I’m just really curious about what is your take on improving performance on your projects / games. What are the things that most people forget about or any small advice you can have.

I personaly already know few things about the rendering distance (for foliage and mesh), draw calls depending on where you look at (and if meshes are hidden behind others), shader complexity, shadow amount (things like removing shadows from the small foliage).

I think on my side, one of the main thing I noticed in the above mentioned-game that are not good with framerate is that the rendering distance for meshes (not for foliage) is often too high. For example, I remember checking in The Beast Inside, Blair Witch and The Outer World if small or medium size items/objects where rendered from far away and that is often mostly the case (even if at this distance, they could as well as hidden).

Feel free to discuss and debate :). And forgive me for any orthograph/grammar mistakes, English is not my mother tongue.

Have a good day,

Sanglier Man (Cheers from France :slight_smile: )

Games with bad performance usually have 3D models with bad tessellation, too many materials, too many textures on each material, textures way too high resolution, bad LODs causing pixel overdraw, unclean mocap animations, network code running every tick, blueprints cluttered with hundreds of nodes, way too many PhysX queries per frame, real-time complex audio effects, thousands of Actors per frame, etc etc…

For example,
I’ve seen a project where they had over 20,000 Actors rendering at any given time, it is a 2D project being built on Unreal, they could’ve baked majority of those actors as a single large background texture.
Game asset artists really really love to waste performance.

I would like to just add to what [USER=“434”]BrUnO XaVIeR[/USER] wrote, there is also a lot console commands that you can use to turn off many functions on the rendrering pipeline that the engine doesn’t need for your game. This way you can get quite the performance gain. And the most important thing is profiling - to find if you have CPU or GPU bound performance loss. In the moment you master the profiling tools you will optimize quite well your projects.

The problem is to make it a habit to think constantly about optimizations in the beginning of any project. If you dont do that, it will take more time to optimize and often this means loss of money, or loos of client since noone wants to pay too much you know. Even if its not a game project but a visualization project or a virtual production, a little bit optimizations will help you a lot down on the road. I mean it takes a lot time to get know what every thing in the profiling tools mean and how to fix it. But you are lucky that many peoples have asked about those things, so google will be your best friend most of the time. :slight_smile:

I can give you a 5 line play by play of my personal problems with optimizing.

  1. the landscape material.
    Eats performance. The more you make it look good, the lower the performance.

  2. tris on screen with alpha (the grass).
    At 4k the procedural way showcased in the Kite demo (if you run the kite demo in 4k at max specs on a 1080ti) you get around 20nto 27 FPS. (And their project is highly optimized, even if not the holy grail).

  3. Bad LODs.
    I ended up making most LODs manually. For the last step I’m using Imposters (and they actually arent very far away either).

  4. bad materials
    Mostly I’m dealing with water, and Gertner functions cost what they cost. Shore waves cost even more. (On both cpu and gpu in my case). Add to this the fact that it’s a transparency and if you place 16k tris on screen plus the water material you are already running sub 30fpa at 1080 or less.
    Add to this any material you may have been testing with in which you perform absolute world position checks, or layering, or even vertex paint, and you also get much less.

  5. textures too large.
    Though it’s hard to track, there is a difference between using a 2k texture and a 4k texture when it comes to render time (ms). You can often gain performance by lowering texture sizes without necessarily compromising the overall quality.
    And there are optimization views that help with that specifically.

All that said, I’m still unable to reach 60fps at 4k. At least, without switching to forward shading. In forward shadingn the render performance is much, much better…