tyFlow Forum
Play is choppy but scrubbing is perfect - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: Bugs and Issues (https://forum.tyflow.com/forum-3.html)
+--- Thread: Play is choppy but scrubbing is perfect (/thread-3414.html)



Play is choppy but scrubbing is perfect - ldotchopz - 12-13-2022

When i have multiple tycaches i can scrub through them in realtime, but hitting the play button appears very choppy.

I find it drops from about 50fps to 9fps.

I also found objects using typarticle skin slow down playback even when hidden. i have to turn off the particle skin effect for normal playback.

max2023
latest tyflow


RE: Play is choppy but scrubbing is perfect - tyFlow - 12-13-2022

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).


RE: Play is choppy but scrubbing is perfect - ldotchopz - 12-14-2022

(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.

I will try and send it over at some point.


RE: Play is choppy but scrubbing is perfect - tyFlow - 12-14-2022

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.


RE: Play is choppy but scrubbing is perfect - ldotchopz - 12-14-2022

(12-14-2022, 01:23 PM)tyFlow Wrote:
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?


RE: Play is choppy but scrubbing is perfect - tyFlow - 12-15-2022

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?


RE: Play is choppy but scrubbing is perfect - ldotchopz - 12-15-2022

(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!

https://www.dropbox.com/s/ix4v33h895g77j8/2022-12-15%2011-44-10.mp4?dl=0


RE: Play is choppy but scrubbing is perfect - tyFlow - 12-15-2022

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.


RE: Play is choppy but scrubbing is perfect - ldotchopz - 12-15-2022

(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.

https://www.dropbox.com/s/t7v9ilnms33ua1h/2022-12-15%2014-00-31.mp4?dl=0


RE: Play is choppy but scrubbing is perfect - tyFlow - 12-15-2022

Ok, definitely seems like something is up! Thanks for running the script.

If you send me the files I'll see if I can reproduce the issue and figure out what's going on.


RE: Play is choppy but scrubbing is perfect - ldotchopz - 12-15-2022

(12-15-2022, 02:31 PM)tyFlow Wrote: Ok, definitely seems like something is up! Thanks for running the script.

If you send me the files I'll see if I can reproduce the issue and figure out what's going on.

Here you go, thanks!

https://www.dropbox.com/s/6iiirmnfzamvqt2/tyflow-play-test.zip?dl=0


RE: Play is choppy but scrubbing is perfect - tyFlow - 12-15-2022

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.


RE: Play is choppy but scrubbing is perfect - ldotchopz - 12-15-2022

(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.

Cheers!