Job Control/Scheduling

Although we use a different representation for the hearthling ai than you discuss here, most of the principles you mention are present in one form or another when evaluating what a hearthling should do. (Internally we use a tree with priorities at the nodes and prune subtree’s whose priorities cannot pre-empt higher valued nodes. Each hearthling action is composed of sub-actions that are only evaluated if the prerequisites of the prior nodes have been met.)

One exception is that we have not scaled out threading (which could help pathfinding quite a bit), and that we use LUA coroutines for cooperative multitasking which only runs on a single core.

There is still a lot of optimization work to be done, and as we add more features, we need to take a performance pass every few alphas to measure and optimize the behavior. First we optimize the algorithms, then the lower-level implementation, and then finally the memory allocation and cache-line behavior. Doing this takes time and we try to strike a balance between features, content, stability, and performance.

6 Likes