npruehs / ue4-rts

Real-time strategy plugin and showcase for Unreal Engine 4.
MIT License
747 stars 151 forks source link

Vision volume causing massive frame drops. Deleting it and pressing play crashes the engine. #75

Closed Tdead1 closed 6 years ago

Tdead1 commented 6 years ago

Leaving the vision volume in the base sample level causes frame times to shoot up to ~40ms. The way around it is to change the size per tile variable to higher (64 gives ~60fps) but that messes up the vision volume.

Removing it from the level crashes the engine. We are using version 4.19.2 of Unreal. Might have to do with the upgrade?

npruehs commented 6 years ago

Hey @Tdead1 ,

I can observe the same on my side, using Unreal 4.18.3. From the top of my head, I know that we've done some performance optimization on that in our current title, but that was after 1000s of actors to the level. I can't remember anything else specific that we've done here, but it's been quite a while.

I need to dig deeper and profile into what exactly is causing the issue here.

Sorry I don't have better news right now for you.

npruehs commented 6 years ago

Okay, I remember that's the issue here: Drawing the fog of war on the minimap is implemented terribly inefficient here. Let me see if I can merge our changes to improve on that.

npruehs commented 6 years ago

There you go. Just pull from develop again.

You'll need to set the FogOfWarMaterial of your RTSMinimapWidget to M_RTSFogOfWarMinimap, and you should be fine now.

Tdead1 commented 6 years ago

Ah, great, I'll ask my team to try it now. Thanks a bunch!

Tdead1 commented 6 years ago

Just want to confirm that it works now. Thanks again!

npruehs commented 6 years ago

Thanks for the feedback! :)