How to sync VFX graph update delta time with ECS fixed delta time?

I’m working on a project using DOTS, and I’m using a single VFX graph instance to draw all of the bullet positions to save on CPU. I’m passing a position, rotation, and speed to the VFX graph on spawn, and I send an event from a fixed time ECS system to update the VFX graph. I’ve made sure that “Fixed Delta Time” is checked on the VFX graph asset, and I’ve synchronized the timestep in the VFX project settings with the DOTS fixed timestep (60 FPS or .01666~).

This works great and the bullets are perfectly in sync as long as the framerate is stable. It appears, however, that the VFX graph does not always use that timestep when the event is called from the DOTS system if the framerate is unstable, and if a DOTS fixed update takes longer than its 16ms then the VFX graph doesn’t care and will simulate whatever the actual difference was.

That may not be correct, but if I drop the VFX max timestep to .0166~ then it gets significantly better, but still desyncs noticeably when the framerate gets unstable.

Is there a good way to synchronize VFX graphs to the DOTS fixed timestep so that they will always be in sync? Thanks in advance!

I’m not that familiar with ECS but, have you tried enabling Exact Fixed Time in your Visual Effect Asset?

I have, and it was somewhere in between the original solution and setting the max timestep to be 16.6ms. Right now it’s not a huge issue because it’s only a problem at absurd fire rates that I will likely cap (e.g. 1 million RPM), but I was hoping to see if someone knew of an easy fix.

If it does end up being a problem later down the line, I realized that I should be able to pass the delta time from DOTS to the VFX graph and calculate the particle’s new position manually using the passed in fixed delta time instead of relying on the VFX graph’s built-in velocity calculations using whatever delta time it is that it’s using. If I end up taking that route I’ll update the post with the results.

That all being said, I appreciate the response!

Thanks for the input, this is something we didn’t really consider before. I’m glad that it is not a big issue.

We will keep it in mind for future updates.