Jump to content

Yet another question


rich12545

Recommended Posts

I'm wondering how the AI chooses what unit to produce. Is it through a queue and it goes with whatever is next? Or does it have a way to somewhat determine what unit would help its current situation? Does it plan unit production strategically for the future? I would think this kind of AI "thinking" would be difficult to program.

Link to comment
Share on other sites

I'm wondering how the AI chooses what unit to produce. Is it through a queue and it goes with whatever is next? Or does it have a way to somewhat determine what unit would help its current situation? Does it plan unit production strategically for the future? I would think this kind of AI "thinking" would be difficult to program.

Answering that takes a lot of work. The AI build system takes a whole bunch of factors into account. If the map is largely unowned, it tends to produce units that are good for capturing unowned cities and resources. If most of the map is mostly captured, he'll start leaning towards the production of combat units. If the AI is on a large uncaptured landmass, then it will tend towards ground units. If it's an island-hopping map, then he'll produce the ships, transports, and ground units needed for that scenario.

It also takes into account the types of units its enemies are using and leans towards producing units to counter those units. Each AI player also has a "personality" that skews build choices towards certain categories. For example, the AI might like one or more of these categories: submarines, small ships, large ships, city improvements, ground units, artillery, etc. How much the AI likes each of those categories is, itself, a variable ranging from 0.0 to 1.0 (it's not a simple "I like submarines" setting, but it's a whole range between "I don't like submarines" to "I love submarines"). Of course, the AI is smart enough to evaluate the value of units as well. So, if you created a rules-system where submarines are weak and a total waste of money, the AI will tend not to produce submarines even if his personality is "I love submarines".

(A few people have complained that the AI isn't using aircraft. I need to check on the exact reason why the AI isn't building and using aircraft, but one possibility is that the AI decided that aircraft aren't valuable enough in combat, so it's not building them. In other words: maybe I'm being outsmarted by the AI.)

Link to comment
Share on other sites

×
×
  • Create New...