not quite randomly. when a unit is built it gets assigned a AI-strategy. city defender, attacker, etc. so at the time. while some units are probably attack-only (swordsmen, all horse-based units), some are used for both (archers, axes, longbows, etc.). depending on what the built unit was intended for, an pikeman might get a city raider for isntance.
1) --> certainly! but there probably is no flag/function called boolean couldBeAttackedAnyMomentNow()
and don't forget that with your idea he might upgrade better for defences, but not with foresight. if we see the AI approaching with 4 knights, we'll have some elephants, spears and pikes to defend and we'll ignore upgrading the axemen. can the AI do that too?
and don't forget that with your idea he might upgrade better for defences, but not with foresight. if we see the AI approaching with 4 knights, we'll have some elephants, spears and pikes to defend and we'll ignore upgrading the axemen. can the AI do that too?
2) --> hardcoding is dangerous. 75% is a nice lead, but if you face cavalry vs. cavalry, giving combat I makes quite a big deal (10% more --> 68% chance of winning).
as for the downside example with the archer: the algorithm ofcourse would consider the archer NOT a threat and wouldn't bother promoting.
Also if your unit is in a stack then things get even more complicated. How many other units are there that protect that unit? It depends on the attacker as there are many different vs xyz promotions. Then the order in which the units fight and the odds of the attackers matter. This is very complicated.
Also most of the time a cavalery unit will be above 75% vs an archer so the promotion wont be triggered. Only strongly wounded units will fall for this trick.
let's see what blake comes up with. so far it's been great
Founding on a luxury or food resource does not prevent the civ from obtaining the happiness or health it provides once the appropriate technology has been discovered (calender in this case).
I sure hope that the AI will be a challenge on prince.
Comment