That is the very definition of AI with levels. Either you have the AI Cheat at the higher levels, or you have the player cheat at lower levels (by making the AI intentionally make bad choices). Writing an AI is a delicate thing, you have to leave enough room for "mistakes" as you can or you wind up with a numerically flawless gameplay which nobody can beat. AI doesn't have a learning curve, nor can it adapt. You give it a formula and it will make all decisions based on that. You COULD make it scale difficulty levels by nesting IF statements to have a settler level AI only consider the "Black and White Picture" (does this building cost more hammers than the other building? If yes, then build it first because more hammers MUST mean better), while a Diety AI will consider a broad range of "grey" (Do I need to reduce my maintenance more than I need to increase my food storage, or would it be better to enable new troops due to intentions of starting a war to gain Iron so that I can upgrade my existing troops due to fear of a war from another faction?) Writing such ultra-nested conditionals though can get very complex, and would NOT allow you to expose any control over various AI levels to XML because it would be a rather delicate process to set it all up.