Play is choppy but scrubbing is perfect
#1
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
  Reply
#2
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).
  Reply
#3
(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.


Attached Files
.mp4   mushroom-physics-02.mp4 (Size: 2.73 MB / Downloads: 64)
  Reply
#4
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.
  Reply
#5
(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?
  Reply
#6
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?
  Reply
#7
(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/ix4v33h895g77j...0.mp4?dl=0
  Reply
#8
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.
  Reply
#9
(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/t7v9ilnms33ua1...1.mp4?dl=0
  Reply
#10
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.
  Reply
#11
(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/6iiirmnfzamvqt...t.zip?dl=0
  Reply
#12
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.
  Reply
#13
(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!
  Reply


Forum Jump: