Hard to guess without a file but it's likely due to the fact that real-time playback can land on subframes while playing, so tyCache (and tyParticleSkin, depending on your setup) has to do a lot of extra work to interpolate between the neartest whole frames on those subframes (load twice as much data + run the interpolation functions).
(12-13-2022, 08:57 PM)tyFlow Wrote: Hard to guess without a file but it's likely due to the fact that real-time playback can land on subframes while playing, so tyCache (and tyParticleSkin, depending on your setup) has to do a lot of extra work to interpolate between the neartest whole frames on those subframes (load twice as much data + run the interpolation functions).
Would tycache still need to evaluate subframes?
I can't really send the file as it has 3 tycaches with it. but it's relatively low poly, simple setup. i find this happens most of the time, things seem to play better with the actual sim rather than the caches. I have a pretty fast ssd, around 7000mb read and write speeds, 3090gpu and a 32 core threadripper.
12-14-2022, 01:23 PM (This post was last modified: 12-14-2022, 01:25 PM by tyFlow.)
Quote:Would tycache still need to evaluate subframes?
Yes, because it interpolates subframe data so that you get smooth motion between whole frames. That interpolation requires some extra processing.
This is all just me guessing since I don't have the cache to test...but you can test yourself if subframe eval is the issue by disabling 'real-time' in the time configuration dialog and hitting play again to see if it's still choppy.
Quote:Would tycache still need to evaluate subframes?
Yes, because it interpolates subframe data so that you get smooth motion between whole frames. That interpolation requires some extra processing.
This is all just me guessing since I don't have the cache to test...but you can test yourself if subframe eval is the issue by disabling 'real-time' in the time configuration dialog and hitting play again to see if it's still choppy.
Thanks! It plays slower, but not choppy, so i guess it's calculating sub frames? I thought that tycache removes subframes since it's saving a file per frame. essentially baking an animation to the timeline so it doesn't need to calculate these things?
12-15-2022, 12:49 AM (This post was last modified: 12-15-2022, 12:49 AM by tyFlow.)
If you disable realtime and it's still slow then it's something else, since subframes aren't calculated on whole frames. The subframe thing was just my guess since I haven't seen your scene or cache.
12-15-2022, 11:50 AM (This post was last modified: 12-15-2022, 11:55 AM by ldotchopz.
Edit Reason: couldn't upload file
)
(12-15-2022, 12:49 AM)tyFlow Wrote: If you disable realtime and it's still slow then it's something else, since subframes aren't calculated on whole frames. The subframe thing was just my guess since I haven't seen your scene or cache.
Are you sure scrubbing is really faster?
I have uploaded a video to show scrubbing vs playback in both realtime and not. It is definitely smooth while scrubbing, yet choppy when playing.
If you would like to examine the files based on this i will collect them for you!
12-15-2022, 01:32 PM (This post was last modified: 12-15-2022, 01:34 PM by tyFlow.)
Sure, I can look at the files.
Looking at your video, I'm not necessarily convinced playback is actually slower, because as you scrub you're skipping frames that playback is not skipping over. And it's updating fast enough in both scenarios that it playing at 15fps and you scrubbing around at 15fps will look different just because you're not scrubbing over the exact list of sequential frames and enough are being skipped that it feels faster.
A real test would be running this MAXScript, which simulates scrubbing but doesn't miss any frames:
Code:
for j in 0 to 100 do
(
slidertime = j
)
If that script doesn't execute any faster than regular playback, then it means scrubbing is actually happening at the same speed. If that script does seem to execute faster than playback, then it would appear you've come across some kind of bug.
(12-15-2022, 01:32 PM)tyFlow Wrote: Sure, I can look at the files.
Looking at your video, I'm not necessarily convinced playback is actually slower, because as you scrub you're skipping frames that playback is not skipping over. And it's updating fast enough in both scenarios that it playing at 15fps and you scrubbing around at 15fps will look different just because you're not scrubbing over the exact list of sequential frames and enough are being skipped that it feels faster.
A real test would be running this MAXScript, which simulates scrubbing but doesn't miss any frames:
Code:
for j in 0 to 100 do
(
slidertime = j
)
If that script doesn't execute any faster than regular playback, then it means scrubbing is actually happening at the same speed. If that script does seem to execute faster than playback, then it would appear you've come across some kind of bug.
Thanks for this.
The script plays it quite smoohtly too. Hitting 18 fps, where as playing in realtime is roughly 7 fps and without realtime enabled is roughly 10 fps.
12-15-2022, 08:48 PM (This post was last modified: 12-15-2022, 08:51 PM by tyFlow.)
So I looked at the file...
The 'real-time' slowdown is definitely is due to my suspicions....the extra time required to interpolate particles at subframes is contributing to the slowdown. I did notice an area where a minor optimization could be added to my code, to help speed up interpolating caches that contain only a small number of particles (which does apply in this case). But the optimization only saves a few milliseconds - it ultimately may not be noticeable in a lot of cases.
As for the script vs non-realtime playback...they're virtually identical on my machine....with the only difference being the non-realtime playback having an extremely minor stutter occasionally...but that stutter persists even if I delete all objects from the scene. Could be caused by any number of things...like extra callbacks happening within Max during playback that don't happen during the script execution. Hard to debug something like that since it doesn't seem related to tyFlow...especially when I'm getting like 200fps playback on my machine in both tests and the stutter is virtually imperceptible.
On extra thing you can do if realtime playback is important to your setup, is enable "round to nearest frame" in all tyCache 'Timing' rollouts. That will disable any subframe evaluations and should speed up playback when 'realtime' is enabled.
(12-15-2022, 08:48 PM)tyFlow Wrote: So I looked at the file...
The 'real-time' slowdown is definitely is due to my suspicions....the extra time required to interpolate particles at subframes is contributing to the slowdown. I did notice an area where a minor optimization could be added to my code, to help speed up interpolating caches that contain only a small number of particles (which does apply in this case). But the optimization only saves a few milliseconds - it ultimately may not be noticeable in a lot of cases.
As for the script vs non-realtime playback...they're virtually identical on my machine....with the only difference being the non-realtime playback having an extremely minor stutter occasionally...but that stutter persists even if I delete all objects from the scene. Could be caused by any number of things...like extra callbacks happening within Max during playback that don't happen during the script execution. Hard to debug something like that since it doesn't seem related to tyFlow...especially when I'm getting like 200fps playback on my machine in both tests and the stutter is virtually imperceptible.
On extra thing you can do if realtime playback is important to your setup, is enable "round to nearest frame" in all tyCache 'Timing' rollouts. That will disable any subframe evaluations and should speed up playback when 'realtime' is enabled.
I hate that things can vary from 3ds to 3ds lol. Thanks for checking it, that round to nearest does speed things up to a better pace, i didn't know that exsisted actually.