1
Optimizing Danmaku Style Games
Post Body
Hello all!
I'm currently working on a dev-kit for 2D Danmaku (Bullet Hell) style games, and I'm running into a brick wall on making sure firing and moving bullets is a lightweight operation.
My current solution is like this:
- A BulletManager class acts both as a pool, and a factory for the variety of bullet behaviors.
- Bullets are individually represented by a Projectile class, which isn't a script attached to the bullet object, but rather is a normal C# object managed exclusively by the BulletManager. A lightweight GameObject with only a SpriteRenderer is generated via "new GameObject()" and "AddComponent" to avoid the computational cost of Instantiate.
- Movement is managed via subclasses of Projectile, like LinearProjectile which just moves it in a straight line via direct manipulation of the GameObject's Transform.
I can only get about 10,000 bullets on the screen before the frame rate drops.
I don't have Unity Pro, so I don't have a profiler to use.
Any suggestions on how to further optimize?
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 9 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Unity3D/com...