You might want to split your "action" code over several cycles, rather than trying to do it all in the same frame.
Not difficult to do. I used the same method for some path-finding AI, when I had *many* bots trying to recalculate paths over a large, changing map. The closest ones (to the terrain change) would be processed first, while those further away would be processed several cycles later - therefore spreading the load out and stopping stutter/hangs.
Not difficult to do. I used the same method for some path-finding AI, when I had *many* bots trying to recalculate paths over a large, changing map. The closest ones (to the terrain change) would be processed first, while those further away would be processed several cycles later - therefore spreading the load out and stopping stutter/hangs.