Blueprint now giving infinite loop error in 4.3, but it's a lie

Hi dudes,

I wrote a faily large blueprint in 4.0 and copied it forward to 4.1, made additions, then 4.2, more additions, and now 4.3. The entire time, this blueprint has worked without errors.

But now that it’s in 4.3, the game won’t run due to an “infinite loop detected” in my function called SetTransforms. Here are screenshots of the function, as well as the execution path to get there. I think you will agree with me that there is no infinite loop.

Here are my suspicions about what’s happening. My game is full of hundreds of objects, and each is an instance of a blueprint using this BASE_TransitionObject blueprint as a parent class. So when the game starts, each object goes through this initiation procedure. Yes, I could probably put some of this in the construction script, and I will indeed do that. But regardless, the engine now detects an infinite loop when everything worked fine before.

Branch: Binary build from launcher.

Build version: 4.3.0

DXDiag attached [dxdiag.txt][2]

Thanks for your help!
Stu

I forgot to mention that the array Pieces Children is made from the children of one of the scene components. Using a Print, I’ve proven that they range from 0-26, depending on the object. Measurably not infinite.

I’ve also moved everything in the Initialize function into the construction script, and the problem persists. So my theory was wrong.

So this actually just means that any one of your blueprints detected it was going to perform over 1 million instructions. Note that it is instructions not loops that are counted. So every single operation you perform inside of a loop will reduce the number of iterations that can run without hitting that limit.

As I recall, a simple forloop that just executes does around 4 instructions, so right off the bat you are limited to 250k loops. Some nodes require several instructions. For example doing stuff with arrays like breaking and lerping all add instructions. It is possible 4.3 made one of your nodes cost 1 more or some other almost trivial under the hood change that could have pushed you over the limit.

How many things are there of “pieces” driving the foreachloop? Seems like it would still have to be quite a few to trigger this. If you can build with visual studio, all you have to do is increase the 1000000 limit found in scriptcore.cpp and recompile.

Thanks for the explanation, Ryan! Wow, working on the weekend? Epic customer service :slight_smile:

Eventually I got this to stop happening. I had 2 distinct foreach loops coming off of that array. I combined the instructions into a single foreach loop, and the error went away.