Hi!



I've observed the AI building very sub-optimal buildings but not having some of the most efficient ones on the other hand.



I have some suggestions on how to improve the AI.



First thing: The AI just seems to use the Governors. This is what I found out when I got an AI-System via a trade for a cease-fire. The Governor was still set on.



In order to evaluate what building to build the AI should simulate the effects of building it and then evaluate everything by diverse factors.

At the beginning I would value food, industry, dust and sciene about the same. Food should lose relative value the closer the population is to the systems maximum.

That value then is devided by the production cost and in the end you have a list in which order to build stuff.



I will use an actual system of my current game as example of how I think this could work:



I will also suggest reasonable values for items that do not produce fids but do something else.

(I have the german version so the names of the buildings might be translated incorrectly)



Epigenetic Seeds: +7 food (there is an artic world with 7 people on it) -3 dust = value of 4. but since the system is at 10/14 i devalue it by multiplying 4 with 4/14 = 1 1/7 now divided by the production cost: 1/175 = 0.0057

Adaptive Taxation: +20 (2*pop of 10) -7 = 13 ... 13/320 = 0.0406

Adaptive Industrial-Systems: 43 food => ind -11 = 32 ... but since this stops pop-growth the missing pop of 4 times there production has to be substracted. In the case of this system this is (232 * 4/10) 92 4/5 and thus we get a negative value of -60 4/5 here wich tells us do not build this at all! If the pop would be 14/14 it would be 32 / 3600 = 0.0088

Luxuries in Overflow: This is a special case. It makes -20% Rush-Build cost for 5. Imho this is a 1 per empire building. It should be valued really high if you don't have it yet but worthless if you already have one. Reason is you can buy ships in whatever system has this and will never need a second one. And for buying buildings I don't think it's worth it at all as they are rather expensive. But of course one might somehow create a formula based on remaining buildings to be built and excess-cash. But imho this shall be a current cash surplus*0.2 / 400(it's build-cost) if you don't have it and a 0 if you already have one. In my case that's 3578 * 1/5 / 400 = 1.789

Income-Zen: +20 (2*pop of 10) - 11 = 9 9 + X * current cash surplus *0.3 where X is 1 when you don't have it yet somewhere and 0 when you already have it = so for already have it it's 9/3400 = 0.0026 if not: ( 9 + 3578*3/10) / 3400 = 0.3183

Laboratories with Gravity-Shielding: (142*2/10 - 7)/1250 = 0.0171

Stock Exchange of the Stone-Carver-Guild: Since I'm playing Carvers who cannot trade at all this is a 0 for me. Otherwise it would be (whatever trade gain it would result in -3) / 200 (also I think those buildings should be hidden from the selection when playing carvers as you won't build them anyways)

Space-Elevator: Same as above

Endothermic Buildings: 0 since there's no small or tiny planets here. Otherwise it could be calculated similar to the value that is substracted from the value of Adaptive Industrial-Systems. So if I would gain 3 max-pop from it it would be worth (69+3/5)/150 but this could be multiplied with pop/maxpop to devalue it while you are away from the cap so in this case * 10/14 = 0.3314

Unity Shielding: Before evaluating buildings that improve ships at first there needs to be a value for building ships as well since they compete with the buildings in order for being built. Military-Strength/X/Industry-Cost for example. X being a value to be tweaked by testing. It maybe should also depend on diplomatic stati. Lower if at war, medium if at cold war, higher when there's no war.



However, I think the basic idea of this is clear. There need to be well-thought-out algorithms that determine if, when and at what order the various buildings are being built. Whatever is in place now is not really good. For example the AI in many cases did not build the Magnetic-field-generator or Planetary Institute. Using my formulas these would be 37/200 (=0.185) and 22/80 (=0.275) which tells me pretty much they are must get asap-buildings.



PS: If you are wondering why I go into details that much, that's because I'm a programmer myself and thus won't just suggest "improve building AI" but suggest how exactly it could be done.



Edit: The values I got (the small ones) could also be multiplied by the number of remaining turns. If the resulting value is below 1 the AI should not build it at all since this means the building won't even pay for itself before the game is over.