Unity ECS Bullet System Video Test 1

After another few weeks (and new changes to the ECS preview API), I finally got to a good point where I could upload a preview video of this converted BH system


It demonstrates test patterns, bullet movements, and target effect.

My next plan is to improve the spawning of the bullets.  ECS is great for managing entities that have already been instantiated and not so much when you spawn a couple of thousand new entities in a single frame.

In my OOP version, I had used object pooling to reduce the performance cost of “creating” bullets.  This means that all I had to do was “cheat” and not really instantiate bullets, but use previous and premade bullets and change their speeds and directions.  But in ECS, there is no concept of object pooling, so I had been creating entities literally at each execution and setting their values there.  As you can see, I suffer 5-7 frames everytime I spawn around 1600 entities, and this gets worse as I tried spawning 5000 in one frame.

One of the things I am hoping for later in the future from Unity is the ability to Burst Compile the Entity Manager.  As of right now, the burst compiler doesn’t work with it, and my system heavily employs the Entity Manager in its bullet patterns creations.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s