Packaged game runs a lot slower than editor view, with enormous draw times.

Hi there,
i was running my game in the editor and i had about 60 fps, but once i packaged it i dropped to 8 / 10 fps.
i looked a bit through the forum and used “stat unit” command, showing that i have enormous “draw” times. All stats:
Frame - 123 ms
Game - 8 ms
Draw - 123 ms (idk how but its the same as frame time always)
RHIT - 14 ms
GPU Time - 23 ms
DynRes - Unsupported
Draws - 2210
Prims - 1111.5 K (jumps randomly to 3000K for a second)

I’m (trying to be) an indie developer and i don’t know what Draw time is; could someone please explain it to me and what increases it so i can try and solve this issue?

Additional information:

  • 60 fps in editor, no lag
  • Packaged as Development (and of course Cooked as Development)
  • Using DLSS (tried both performance and quality mode)
  • My game has a very large landscape with some very high-poly meshes, all of which have LODs, all lights are static, trees and grass have LODs, grass stops existing completely after a fixed distance.
  • Running on Win 10, Ryzen 5 2600, RTX 3060, 32GB ram.

Thanks for your time,
Tom.

Hi Tom, I’d have a go with Insights

Another thing you can do ( you have to write a bit of extra code for ), is setup a widget to allow you to progressively remove things from the world until the frame time returns to normal.

Thanks! This looks like an excellent tool!
I am now building it because i use a Unreal Engine source build but i’ll update this thread as soon as i can so this information can be useful for others as well.

1 Like

Looks like the big thing here is

GatherRayTracingWorldInstances_DynamicElements

which takes 126.4 ms.

Any idea what that is?

1 Like

No :slight_smile:

But it sounds like you have a lot of instancing going on? ( could be totally wrong )

If i click on my grass it says “Instanced Foliage Actor” so i suppose you’re correct?

1 Like

Try packaging without the grass. What do you get?

i’m doing it right now and i’ll let you know, but in the meantime assuming that’s the cause (already big performance improvment in editor) do you know the right way to do foliage? Like how do you do it so that you don’t lag?

1 Like

This is probably the biggest question for game engines, ever :slight_smile:

You have to tackle the thing from ALL angles, including

. Low poly model ( you can get away with < 100 tris )
. Very quickly ( max 3 LODS ) LOD to a plane with a self shadowing imposter
. That LOD should be set to not generate shadows, of course
. Place the meshes so there is no overlap ( or very carefully controlled overlap )
. Use per instance fade amount in the material
. Shorter grass is better
. Rather than placing any meshes at any great distance, use a landscape material that ‘looks’ like it has meshes on it ( you can make this by snapping a screenshot with a cinematic grass scenario ).
. etc etc etc

That’s off the top of my head :rofl:

1 Like

I tried to set all foliage actors as “editor-only”, but i didn’t re-package and upload a new server build (to my server hosting service) so when i loaded-in the map the grass still appeard (but strangely the trees didn’t), and performance improved, so my guess is i have to re-do foliage for this map.

Another thing while i’m here, i run 2 client concurrently on the same machine for server-testing purposes. Is the performance halved or just somewhat reduced?

1 Like

You’re probably using Lumean Hardware raytracing which has a limit of 100k instances and it’s taking a long time to figure out what instance to do it’s passes on. Just a speculation though. Could try reverting to software lumen if that’s the case and see if it improves.

thanks i’ll look into that

That, I’m not sure about :slight_smile:

Could you execute the stat scenerendering command and share the result.

One thing you can do is go to the foliage section, select all your foliage types and set Visible in ray tracing to false.

You can also if you don’t care about ray tracing, simply go to DefaultEngine.ini and set r.RayTracing=False

Quick recap for anyone else stumbling here, foliage was causing my performance issues. Use The Unreal Insights tool to see what is making you lag. In my case the problem was with Ray Tracing (see full thread) so i removed it on the grass and this completely solved the performance issues. Disabling shadows also helps a lot, but if you want Ray Tracing in your game (like i do) disable it on the grass since it does literally nothing anyways.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.