Here's an example of an independent GeomCache prop from Ryse that loads and unloads as the player moves closer or further:
Control via Flowgraph
Coordinating game logic with GeomCaches requires a couple of extra steps to work efficiently.
In the following example picture of a looping animation of a GeomCache, the “resting or start” frame of the animation is at frame zero.
After a game event triggers a GeomCache to stop playing, (proximity trigger, gametoken modified, mission complete etc...(debug inputkey in this case))… we hook into certain inputs on the GeomCache Flowgraph node to handle how the entity stops playing correctly.
We call through flowgraph the SetTime input, this resets the timeline of the animation back to frame zero (using the Math:SetNumber node). But since this GeomCache is set to play a looping animation, setting the time back to this “resting” frame is not enough, as the loop will continue on from frame zero.
|To actually stop this animation completely on the GeomCache, use the SetTime as above, and also a frame later (using the Time:FrameDelay node) we call the Stop input. This will reset the animation and then stop the animation from playing further.|
|Calling the SetTime and Stop together at the same time will pause the animation exactly where it is in its timeline, not where you want it to be (aka frame Zero). Use the Time:FrameDelay node to space out the two commands (SetTime and Stop in sequence).|
Since complex GeomCaches are too large to be fully pre-loaded, their animation data is streamed in a few seconds before being played.