Coming soon - Get a detailed view of why an account is flagged as spam!
view details
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:

  1. A BulletManager class acts both as a pool, and a factory for the variety of bullet behaviors.
  2. 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.
  3. 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?

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
29,703
Link Karma
15,788
Comment Karma
13,897
Profile updated: 1 week ago
Posts updated: 8 months ago

Subreddit

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