Infinite loop detected in a timeline

PaPaParker9
Fri, 16 Feb 2024 17:41:15 +0000
Programming & Scripting

in UE 5.3.2 (on either windows 10 or 11) i wrote a ‘marble run’ VR application. That is, the user creates a track and a marble rolls down the track. If I create a PCVR app, I need considerable GPU power for UE physics to work correctly. If I use the metaXR plugin (instead of openXR) so I can place it on a Meta VR device (either quest 2 or 3), the hardware does not do UE physics well (i.e. the marble can fall through the track often).

Fine, instead of using UE physics, I create a spline component for each track segment and use a timeline to move the marble along the spline. The timeline length is 1 second and so I vary the Play Rate according to speed/spline distance during timeline update. Also during the timeline Update, I implement physics (use mechanical energy conservation to find the new marble speed). If the new speed isn’t allowed, then I back up the marble to its last valid position, reverse its direction and tell the timeline to Reverse. It is also possible that the marble will fall off the track. I can also detect that in which case I tell the timeline to Stop and let UE physics take over. When the marble is on a spline and running in the timeline, collisions and physics are off. Only when it leaves a track are collisions and physics turned back on (and there the marble watches if it Hits a new track and if so, starts the new timeline).

The problem is even if the marble doesn’t fall off or reverses direction, I randomly get ‘infinite loop detected’ in the Editor when the marble is being animated by the timeline. If I package the PCVR app, I can get a hard crash. The call stack isn’t very helpful, just points to the timeline’s update function.

The thing is, there is no loop in the timeline update function. I do do quite a bit of calculation during the Update in the timeline (i.e. figuring out if it reversed, fell off and some drag so that mechanic energy isn’t conserved so that the marble will stop rolling if it’s trapped in a section of the track, update Play Rate, update location of marble, update rotation of marble, etc.). Is this the problem? Too much stuff during an Update function which throws this ‘infinite loop detected’? Or do I actually have some loop hidden in there somewhere? I’ve run in the debugger and it doesn’t appear I have an infinite loop being triggered.

all of this work is done in the marble’s blueprint.

Suggestions, hints and ideas most welcomed.

6 posts - 3 participants