I'm working on building a small-scale 4x game that is very heavy on the economic and expansion elements, and extremely light on the tactical layer. At its core, I'm trying to build the AI into a system that can start with a single unit, and eventually build up an entire network of buildings and units that are collaborating to expand further. The basic building blocks seem to be reasonably simple: the top-level AI keeps track of resources (gold/wood/whatever), currently-owned units and structures, and a list of potential tasks that its units can execute. I'm taking a page out of The Sims' book for this, insofar as tasks and their accompanying logic are contained within the objects that own them, and the units/decisionmaking AI simply evaluates each task with a utility function, decides what gets the highest score, and assigns that to an available unit. That gets me maybe 70% there, but I'm having a really hard time figuring out how to implement long-term planning. Like, right now every buildable structure gets a score based on what it does, weighted by what I have, so lumberjack huts get a very high score when my wood production is low, and a low score when wood production is higher than other resources. However, the system is incapable of identifying situations where several low-score moves in a row can have a high net benefit, and there are edge cases that are very hard to quantify, like recruiting new units (which is invaluable and super-good when there are enough resources to support the new guys, and terrible when resources are tight). So, is there another design pattern I should be researching here? Utility theory and really carefully balanced weighting algorithms kinda work, but they frequently result in weird and counterproductive behavior. Gameplay is asymmetrical (the player is essentially a single character trying to sabotage the AI's economy, not an equivalent empire), so it's critical that the AI's economic growth be purposeful and logical enough that the player can figure out what they're doing and sabotage their efforts tactically ('if I blow up this gold mine, they'll lose the ability to fund all their cool stuff') instead of strategically ('the base is over here, time to build 500 guys and stampede over it').