After looking at the reference and getting notes from my teammates, I decided to revise my fireworks a bit more. I made the fireworks bigger, last slightly longer, and incorporated some color variation into the fireworks. To create the slight color shift, I modified the default sprite material slightly with a dynamic color parameter set within the system.
Additionally, to make artist control of the firework placement easier, I added a construction script (left) to the firework-spawning blueprint. It uses the location of a billboard (hidden at runtime), which is user-defined within the level, to set the relative transform of the first firework system.
Once the level plays, the event graph (top) becomes active. Once the car enters the volume of the blueprint, it will trigger the Begin Overlap event, which starts a For Loop, which will fire off the firework system a user-specified number of times, with a certain amount of offset for each spawned system. In essence, this event graph is acting like a glorified Copy Transform SOP with fewer artist-exposed controls, with the billboard controlling the initial location:
The note I got on Monday was to look at reference and focus on timing. I ended up reworking the Niagara system a bit to adjust for what I saw in the reference.
To achieve my reworked firework system, I combined the first and second emitters into a single emitter, which was a single sprite with an animated texture of a firework trail.
This animated texture uses a noise which is panned and then added to the uv texture coordinates, which creates the animating effect. It is then multiplied by the particle color to allow the color to be controlled by the emitter. The texture is also multiplied by the opacity of the sprite (driven by the emitter) to allow it to fade upon death.
To create that nice slowing down effect on the lead particle, I ended up adjusting the velocity by multiplying it by a curve that ranged from 1 to 0. Local space was also turned on in each emitter to allow it to spawn in places other than the origin. Velocity and sprite size were changed for each emitter to fit the small size of the pinball machine.
To integrate the fireworks, I chose to create a blueprint that would trigger every time the car entered a specified (non-rendered) volume. For every time it enters the volume, it will trigger four fireworks to spawn at specified locations. My next step is to modify it to be a procedural system that allows the user to control the number of firework systems spawned and the distance between them.
After finally getting the car animation into a format compatible with Niagara (minus the tires due to a rigging issue), it was time for the car animation to drive the sparks. Parenting the spark system to the animated car doesn't work, because it would loop non-stop. Thus, I had to use Anim Notifies, which trigger an event to play at a certain point in an animation. Also, the spark settings were tweaked to reflect the size of the car (since I didn't work from an accurate car a few days ago).
How I got the anim notifies set up:
1. Open up the animation asset. Right click on the notify track that you want to add a notify to at the desired time, and select the type of anim notify you want to make. In this case, I wanted to spawn a niagara system at the time, so I selected "Play Particle Effect."
2. Rename your anim notify if necessary. Click on the anim notify to bring it up in the Details window. In Niagara System, select the system that you want to spawn. To attach it to the car, make sure that Attached is checked ON and Socket Name has the name of the geometry you want to spawn it from. This spawns from the center of the chosen geometry or bone, so Location Offset can be used to place it in the correct location.
A few settings were tweaked to get the sparks working correctly. Local space was turned ON to allow it to spawn in the anim notify instead of world (0,0,0). Spawn rate still needs tweaking. Right now it will spawn 111 (True Float) particles for every frame for 5 seconds (Boolean value A) since it was created, and spawn 0 (False Float) particles each frame after the 5 second mark. This slightly convoluted module is equivalent to the following in VEX:
One thing that I discovered was that sprite size set in Emitter Life Cycle is overwritten by the modules below it, the chief of these being Calculate Size by Mass. The Density and Proportion settings change how particles react on a physically accurate basis, with Mass Modulation being a useful multiplier on the size of the particle (to a certain extent), while the Sprite Size Modulation parameter was a scalar for artist control, which is the parameter I should have been changing instead of Sprite Size in Initialize Particle.
Car Alembic Troubleshooting (01/28/2020)
After trying a bajillion things that didn’t work:
-Parenting sparks to the car animation in a level: sparks stay at origin while car moves
-Drag alembic into a blueprint: crashes Unreal
-Animate the spark origin directly within Niagara: Niagara only allows static and skeletal mesh source locations
-Tried to access local position data of alembic within a geometry cache BP: functions to do that don't exist. All geometry cache-related BP functions all relate to time: https://docs.unrealengine.com/en-US/BlueprintAPI/Components/GeometryCache/index.html
I found that all paths led to what I expected. To access local geometry position data and parent things to them, the car geometry needed to have joints, and the geometry needed to be bound to the joints.
I modified the original rig slightly to add a joint and bound the geometry to it. This rig is referenced into each scene and the animation was applied onto the updated rig.
This import is a proof of concept: a lot still has to be done. The scale comes in wrong and the wheels will disappear and spazz around while the animation plays. Right now, the spark system is simply parented to the car in the scene. The spark system will eventually be driven by a combination of blueprints and anim notifs, which will allow it to start at an arbitrary point in the animation and decrease/increase the spark count as the car accelerates and deaccelerates. The spark system also needs to be adjusted for scale, as it was not made at the scale of the pinball machine.