This is a section of a custom event on an Actor Blueprint. The event is callable in Editor, and when I call it, it prints “Hello” to the screen. However, if I increase the Last Index value by one, to 11363, it no longer prints “Hello”. What is going on here?
Actually, yes! However, this limit is set to the default 1.000.000, so why is this triggered with a measly 11k iterations? Even if this is somehow accumulated by the nesting loop, the array that comes into the outer loop only has 20 items?
It takes everything into account in this tick. What else is going on before you enter the double loop? You should get a warning on the output log, btw.
The array has exactly 22 items, which works out such that 11362x22 is just below 250k, and 11363x22 is just above. Not a million, but exactly a quarter of a million… don’t know if this is significant.
I think it counts TIME during single tick not iterations or instructions, then they estimate instruction count in error log. Well if i coded that infinite loop detection i would do just that, not sure how exactly epic triggers infinite loop error.
You can solve this (go around error), by triggering event that processes stuff in batches, like single array per tick or per 0.25 sec. Do not use timers for this however. Use either delay(0.2) or on tick check if 0.2 sec passed before triggering next one.
If you double click a ForEach node, you will see that it contain even more nodes inside, so it can quickly add up.
A 11k for each loop actually represent more than 11k iterations in total combine(at a moment).
OK, thanks guys, I guess I have my answer. This was just some debugging I did to troubleshoot some other issue, so just bumping up the iteration limit solved my problems.