Hi, it’s Kevin Wu
Just posting another progress video for the BH system.
Since the last video, there are a few more changes (although not demonstrated in this particular video):
- -Improved Editor UI/functionality (now, it uses a Reorderable List for a user friendly interface)
- -More patterns (Cylinder shaped, Cube/Rectangle, Star Shaped, Icosphere, Random Emitter)
- -Experimental Procedural Patterns (As in, instead of emitting one full pattern in a single frame, the entity emits the pattern over a certain amount of seconds)
I’m still working on the experimental procedural patterns. An example of what I mean by this can by seen here:
(timestamp at 1:30 if the video plays at the beginning).
At the time of this particular prototype (Dec. 2017), I was generating star shaped patterns through Unity’s Coroutines. This let me “wait” between each spawn of a bullet, and it looked pretty good.
In Unity’s ECS API (or at least in the Job System), there is no concept of “waiting” in a job. You send data to a job, and it executes and processes the data in conjunction with other jobs. I can’t stop it nor stagger its execution.
To get around this, I appended two private variables to each BP entity to keep track of the spawning intervals and made a new function for each Bullet Pattern to spawn X amount of bullets only based on that current interval.
I guess that sounds kind of confusing, but basically, I stagger the spawning of bullets outside the jobs, and in a job, I spawn only 1 or two bullets. This does mean that it takes many jobs to complete even one pattern over time. In return, though, I get massive performance increase because I’m not spawning like 4000 bullets in a single frame.