Opened 3 months ago

Closed 3 months ago

Last modified 3 months ago

#16966 closed defect (fixed)

NANCY: Poor performance spinning around a room

Reported by: tunnelsociety Owned by: Filippos Karapetis <bluegr@…>
Priority: normal Component: Engine: Nancy
Version: Keywords:
Cc: Game: Nancy Drew: Curse of Blackmoor Manor

Description

In any room where we can spin around to see the whole room (e.g. "Gameplay Overview"/tutorial), turning left from a certain point is fine at first, but as we continue left it gradually becomes slower, like a full second or more between turns, until a full rotation is completed -- then it is fast again, and again slows as we turn.
(Turning rightward, it is slow immediately, and gradually gets faster.)

Recording is attached to demonstrate the slowdown, compared to Shadow Ranch.

I continue to experience this when building with -O3, but it is improved from a second or more to somewhat less than a second. (Still very noticeable and somewhat frustrates gameplay: the cursor gets stuck in place during the interruptions, temporarily not responding to mouse movement after releasing the held button.

During the slowdowns, CPU usage briefly goes to ~100%.
I guess it has to do with [re]decoding and [re]seeking a video. I did a little profiling to produce the attached flame graphs. When I spin around in Nancy10 (Shadow Ranch) or earlier, I don't experience this, so I attach a graph for Shadow Ranch to compare.
These graphs are produced from many samples of me spinning around a room for thirty seconds.
(These SVG have some JavaScript and can be viewed interactively in a browser like Firefox: zoom in by clicking a function.)

Blackmoor's graph's leftmost side looks like all of Shadow Ranch's. But the large majority of Blackmoor's graph is Video::VideoDecoder::seekToFrame, which we don't really see in Shadow Ranch's.

ScummVM 2026.3.1git8143-g32091910a7b

Attachments (3)

sha-spin.svg​ (89.9 KB ) - added by tunnelsociety 3 months ago.
cur-spin.svg​ (127.6 KB ) - added by tunnelsociety 3 months ago.
recording.mp4​ (964.6 KB ) - added by tunnelsociety 3 months ago.

Download all attachments as: .zip

Change History (5)

by tunnelsociety, 3 months ago

Attachment: sha-spin.svg​ added

by tunnelsociety, 3 months ago

Attachment: cur-spin.svg​ added

by tunnelsociety, 3 months ago

Attachment: recording.mp4​ added

comment:1 by Filippos Karapetis <bluegr@…>, 3 months ago

Owner: set to Filippos Karapetis <bluegr@…>
Resolution: → fixed
Status: new → closed

In 4f18a681:

NANCY: NANCY10: Add a frame cache for Bink panorama videos

Improves performance when scrubbing left and right in scene panoramas.
Fix #16966

comment:2 by Filippos Karapetis <bluegr@…>, 3 months ago

In 5abc3008:

NANCY: NANCY10: Use a deferred loader for Bink panoramas

This follows the same pattern as the AVF deferred loader, and improves
the performance of the Bink panoramas in Nancy10 and newer games, in a
similar way as the AVF panoramas used in Nancy9 and older games.

Follow-up improvement for #16966

Note: See TracTickets for help on using tickets.