Can someone help me analyze this blueprint flow and determine why 4th spawns are getting queued? “Max Enemy Per Type” is set to “3” and the flow reflects that when I run the level but 4th spawns are getting queued and spawn right after the 3rd one dies, if an extra minute has elapsed with 3 enemies already spawned.
I was told that I might need to change “count increments” before spawn checks to prevent “race conditions”.
I don’t know how the flow would change other than “Branch(0) > SET Current Quarter Count” etc.
I think it would be better to save the “now” time for each class of actor. So variables QuaterTime, HalfTime and HourTime. For the condition in the branches you then subtract the times (e.g. Now - QuaterTime) and compare if it is bigger or equal than a time like.
Note:
There are 2 types of subtraction nodes that take DateTime structure as input. One with DateTime structure output and another with Timespan structure output. Timespan can use the regular compare nodes while DateTime needs a special one that looks identical. (stupid I know)
tip:
on the boolean AND node you can press the plus symbol to add inputs. Right click on the inputs the get a “remove pin” option in the context menu.
What is happening in your function example:
Let us for example look at the LastQuaterSpawn. But the values of the Now DateTime structure are rotating values (e.g. seconds 0-59). Your condition only gets true when Now has a greater value than your saved LastQuaterSpawn. So once you have by chance saved the highest possible value, it will never become true again.
By the way that modulo value%1 will always be 0. Only value%2 can have 0 or 1