At present, the AI attempts to carry out checks for one weapon per game tick. That means in a single game tick, every grenade attack available to the AI must be checked before the game can load a new frame. This results in substantial lag.
A superior way to do this would be to use a generator to continuously yield attack possibilities, while also interrupting the AI when a certain percentage of a tick's duration has been surpassed. The AI should then continue searching possibilities in the next game tick.
At present, the AI attempts to carry out checks for one weapon per game tick. That means in a single game tick, every grenade attack available to the AI must be checked before the game can load a new frame. This results in substantial lag.
A superior way to do this would be to use a generator to continuously yield attack possibilities, while also interrupting the AI when a certain percentage of a tick's duration has been surpassed. The AI should then continue searching possibilities in the next game tick.