Would it be helpful if when the game is paused or the ai is not doing a lot or when it is early on in the game, that it planned the next commands or tasks that it would execute (where to build, etc.), and store it in the ram, then it checks if that command would still work when the time comes to execute, and if so, it does it. The idea is to take some strain of the cpu when you are in a more cpu heavy part of the game with lot of units/structures, by calculating certain things when you aren't doing much. Now, if it is storing it in the ram, and you need more ram for the current stuff, it could just delete the current instructions, or like memory swapping, save it to the disk. I don't even know if it would help, or if it would make it worse. (sorry if this doesn't make sense ) If you are confused, just say so, and I can try to explain it better