Test Bench

During development of VariaBULLET2D a series of tests were carried out to ensure a balance between ease-of-use, functionality and performance. A low-spec system was purposefully used to test general performance.

Below are the general findings of the tests along with the system specs. You can use this information in order to predict performance on low-spec systems as well as what modifications can be done to improve performance if required.

Note that the tests were carried out in actual builds – rather than when running live in the editor – as determining actual performance in the editor is not a reliable measure due to the overhead required.


Test System Specs

CPU: AMD FX6300 (Release Year: 2012)
GPU: NVIDIA 8800GT (Release Year: 2007)
OS: Windows 7 SP1
Unity Builds: v5.4.2 and v2019.1.13


Test Results

Below you will find the results of how many concurrent bullet objects were typically achievable before a drop in framerate (<60FPS) occurred, relative to the version of Unity and the built-in performance optimizations that were used.



Interpretation

The test clearly shows a significant performance boost simply by using a newer version of Unity (average 42% performance advantage). This is due to Unity’s optimizations in the underlying collision engine.

Object pooling is another clear benefit that should be used in almost all cases (average 39% performance advantage).

Throttling can produce an even more dramatic performance advantage well beyond 60%, while producing the trade-off of slowing the engine (a rate and amount of which is user defined and dependent on the amount of bullets on screen). However, this is often a desirable effect, and is used in a variety of retro titles including many games in the Bullet Hell genre.

By far the biggest performance boost was from simply removing the colliders from the shot prefabs. The aging test bench system was able to handle well beyond 3000 concurrent bullets simultaneously at 60FPS.

However, in bypassing the collider, you will need to implement your own collision detection that does not depend on the underlying physics engine.

Note: as of v1.03, there is a simple performance enhancement that produces all of the performance benefits of removing colliders while maintaining most of the user-friendly benefits of using colliders. For more info see the Collider Flux section at the bottom of the Bullet Shot section in the shot guide.


Conclusion

For the vast majority of cases, you should expect a solid 60FPS with well over 1000 concurrent bullets – even on a low-spec system – by simply enabling object pooling and using a newer version of Unity. This is typically more than enough bullets to completely fill the screen unless they are extremely small in size.

For instances that require thousands of concurrent bullets, consider using throttling and/or shot ColliderFlux/StaticColl options. For more info on performance enhancements, see the tips section below.