I completed the first part of the enhancements to the path engine for Pursuit of Power 2. The code is now ready to be separated into one (or more) threads. This will allow the most CPU intensive portion to be off-loaded to at least one other thread. The main thread will be able to run without reducing as many render frames to compensate for the path requests. Furthermore, I was able to improve the accuracy of the path finding so troops will no longer move diagonally at times. The main change involves assigning different path cost for diagonal moves. I didn’t do this before because I wanted to reduce the amount of operations for the path engine. Now that I have separated the path engine into two components, I can handle this extra path cost since it is constrained to the component that processes less of an area.
My next step is to actually place the most CPU intensive component on its own thread. The new path manager will handle path requests in a way that encapsulates some of the logic for troops. I will also be able to increase the level of detail when computing targets for the computer AI since that code will be on a separate thread. Finally, I will add code to perform path-finding for the zealots. This will enable the real gameplay for zealots, where banners can be placed to initiate the marching. I am really looking forward to getting the new gameplay features working within the game!