BackwardsPlanning/Loop

Hi,

I ran into some questions about a backward planning loop while I was following this article.

1) I know it is bad practice to alter an array while looping over it, so I created a bool for the loop condition, and the array is only changed inside the loop. Is this better or did I just shift the problem? The loop seemed to work fine even when I looped over the array directly. The function is basically looking like this:

2) Is there a better way to solve this?

A loop over an array with an increasing number of entries seems to be a core part of backward planning. Capping the number of tasks created or making it an async function would improve performance, yet not change the overall flow.

3) How does the “maximum loop iteration count” work? Can I display it?

If I have too many objects for planning in my scene, the infinite loop detection will throw an error. However, if I have a lot of actors in the scene, fewer objects are necessary for the error to occur. This can be solved by increasing the maximum loop iteration count. However, it seems to indicate that all actors share a maximum loop iteration count per tick, rather than counting each called loop individually. Is this correct?

4) Is there a way to create an async Blueprint function?

I can find some nodes like Stop Async Function, but I don’t know how to create one. I have found tutorials on how to do this in C++, but I would prefer not to do that right now.

thanks for your time