hi
how can I do a recursive algorithm that has a delay in it ?
- functions don’t allow delay
- macros don’t allow recurrence
- events stop each other
thanks in advance
hi
how can I do a recursive algorithm that has a delay in it ?
thanks in advance
Do you mean recursive?
You can do it with events, but you need to manage the stack yourself.
What are you trying to do?
yes recursive, sorry (corrected the topic)
I’m trying to run several events at once (not sure it makes sense)
and some occurrences of these events would be able to call the same event from themselves. (just like calling a function from itself).
I don’t have any variable, to prevent any error.
and the event contains a delay.
Does it work?
nope. but I worked around it the good old way : compute, then animate (when possible). fortunately it was possible here.
computing with functions, so recursion is possible, store all the data in a custom struct array, then animate.
That won’t work for situations such as this
My goal is to allow the function to call itself because that’s what MiniMax does…but the issue is that without a delay it bogs things down…which you don’t want…surely there is a way to have an algorithm like this run to it’s max without completely freezing the application…I mean if the Javascript versions of this algorithm can run it without hitching the PC when your running on an i9-12900k processor…then surely there should be a way to do the same from blueprints?
Javascript isn’t bound to ticks/framerates.
Next frame cannot start until all processes executing have finished.
Well with this I have a very simplistic scene and when the AI moves first it has to look through all possible moves on a 3x3 grid and it freezes the program for 10-30 seconds. That was the reason I was trying to limit its speed…but this doesn’t run on the EventTick, so limiting the tick rate won’t solve my issue…I’m going to try and implement pruning into the algorithm to see if that will help with performance. I don’t know what else to do