Hello, could you tell me how to optimize my game effectively? I’ve created a game for my engineering project in college, and I need to optimize it further. I have no idea how top games run so smoothly on my computer haha. I have all the textures set to the lowest possible quality, tried to use as few models as possible, adjusted the vegetation to an appropriate distance, and the game still runs at 30 fps. I’ve watched tutorials on YouTube, but they all seem to focus on textures. Of course, I have most of my graphics settings set to the lowest as well.
Optimization is an area of specialization, all on its own. There’s no way anyone will be able to teach you how to do it here.
Plenty of vids on youtube, and Epic training material about it also.
But, I will tell you a shortcut, that’s easy to do, and works. First thing is turn off auto-save.
-
If your level was empty, it would run fine, right? Try that. Delete almost everything and try it. If it runs ok, then it is something in your level, otherwise, it’s probably something you’ve put on tick.
-
Now start again, but only remove about half the stuff. Does it run ok? If yes, then you removed what was causing the problem. If no, then it must be what is still here.
-
Keep going like that until you hunt down what is causing your main problem.
Although it’s true, the more things you have in the scene, the slower it’s going to run, there probably is one or two big problem asset types. This method, will help you find them.
When I have an empty map, I get a very high FPS. During testing, I noticed that the biggest performance hit comes from the trees. I downloaded them from a Quixel project called 'European Trees, with all textures set to 128x128. I’ve enabled Nanite support and set ‘keep triangle percent’ to 0.3, but I’m not sure what else I can do. I’ve also checked the lightmap density, and everything seems fine. Do you know of any good videos or documentation that could help me?
If you’re using Megascans trees, that’s probably part of the problem. They’re really made for accuracy, rather than performance. Try to have only a few different foliage types, and work with them, rather than using lots of different things.
This scene uses one rock and one tree, you can do it
Nanite won’t help really. Also, lightmap density does nothing, unless you’re building static light.
You could use much more low poly trees, that still look ok. There’s a good reason why you see a lot of rocks in games, they are much easier to draw
The issue with trees is that I’m working on my engineering project with Unreal, Blender, Quixel Mixer, and Quixel Bridge. It’s challenging to find trees that won’t infringe on copyright, and I also have two separate maps in the game. On the second map, there are no trees, but I still face the same FPS problem. In the editor, I have 60 FPS, but when I launch the game, they drop to around 30 FPS. I’ll have to dig deeper on YouTube, and thanks for the link; I’ll check it out.
I can see that BasePass and Lights take up the most resources, so maybe we should focus on optimizing these two things or I have too many triangles drawn?.
Neither of these say very much, I’m afraid.
Welcome to optimization
You can use console command ‘stat unit’ to find the bottleneck, see which thread takes the highest time.
It’s probably not too much of a delay in the editor, but when I launch the game, I have this
what can i do ?
So your GPU is too loaded.
When you have the cubes there, they are covering half the scene, that’s why it’s faster
It’s not going to help the performance, but if you want to stop the player walking in certain places, you can use blocking volumes
There are multiple things that can be taken into consideration when optimizing a project. First is to just keep your focus on Frame Render Time rather than framerate itself. You can use commands such as Stat unit, stat fps, stat gpu, stat game and profilegpu to get an idea on what is causing the possible bottleneck.
But in some cases, the things that pop up in those commands are too vague to understand and documentation does not help as much. What you can do is to break down your level into smaller parts, and test with turning off (visibility) of some objects and then seeing if it improves the frame rate. Try to make use of Material Instances rather than using materials. Try to make use of Instanced static meshes if you can, download and use Nanite static meshes from Quixel only, if you use Quixel. Rest of the content on it is not made to be performant.
Other things you can look into is lighting, set the attenuation radius properly and try not to overlap. Try fiddling with Indirect light scatter, reflection capture and so. Try exploring settings in Post Process Volume and tweak things in there whether you want to use RT or SS or so on.
Lastly, when you package the game you will have to put in some console commands to set your engine scalability levels using Game User Settings. Make sure to look into that as well.
You can also check this UE documentation.
GPU Profiling | Unreal Engine 4.27 Documentation
you tried MipMaps?