How to Optimize Bullet Performance?

Hello guys, I’m making a VR shooter game which you can spray a lot of bullets and got performance problem.

This game need the process of bullets flying, So i can’t use the “Trace Line” solution to simulate the bullets.

Currently, I’m using the common way to create bullets, Which is create an Actor everytime when you fire the weapon, This bullet actor have only a sphere collision component to do the hit test, A projectile movement component to make them move, and a static mesh component to show the bullet. All the bullets have only 1.5s lifetime before self destroy.

But when you gonna shoot 70 or even more bullet per seconds, The performance bottleneck are coming. Constantly create and destroy Bullet Actors will higher the Game thread by 2-3ms, Make a big CPU performance problem, And also every bullets need a drawcall which cause GPU performance problem. In a VR game, This is more leathal because you need to make sure all thread fit the 90 frame rate, which is make every thread lower than 11ms.

I’m trying anything to optimizing these bullets, Shorter Lifetime, More tick interval, etc, But nothing significantly useful.

Do we have some way to spray more god ■■■■ Bullets per seconds in UE4? Some other way of solutions? Ideas? Optimization experience? Like which part is most expensive during the creation of Actors and how to cut it down? or there is another cheap way to make the flying bullet stuff? Anything can help me & glad to discuss!

See if this topic helps: How to calculate next transform location based off distance?

2 Likes

Seems very helpful, Thanks!

1 Like