------------------------------------------------------------------------- Note: this document is not entirely up-to-date. The AI hasn't changed much recently, since John has stopped working on it. The main change from the information below is that an "easy" skill level has been implemented, and made the default. Also, the AI now uses diplomats and spies, for defense only. --dwp New for 1.9.0: the AI will sometimes build spaceships, and sometimes create trade routes, although not very skillfully yet in either case. Old README.AI from John Stonebraker, from the 1.7.1 release: ------------------------------------------------------------------------- I haven't worked on the AI as much for the past three weeks as I did for the previous three months. I did substantially improve its ability to manage invasions and conquer cities, and prevent misbehaviors that I doubt anyone else would have realized were bugs. The AI seems capable of winning against experienced players now, although to my dismay it still hasn't beaten me. The AI is getting so complicated that I'm sure there are problems that I haven't encountered. If it does something stupid or questionable that isn't referred to as a Known Problem, send me mail mail describing the problem and attach a save file so I can take a look at it. If you have opinions on which of the below are most important, send me mail about it. I'm always happy to get user feedback. The AI difficulty levels aren't fully implemented. I've done all my work getting the default level to work right, and based on what I've heard, I defined that level as 'hard'. The only available alternative is 'normal', where the AI doesn't know where huts and military targets are before it sees them, and also must obey government max rates. It seems to behave sensibly in the few tests I've run in normal mode, and I haven't gotten any complaints that there are problems with it. There is no 'easy' mode yet, although I suspect there needs to be. John Stonebraker ppaqebb@surfshop.net [The AI has been left pretty much alone since John Stonebraker left the project; mainly because he didn't document his code and liked to choose variable names like "int a,b,c,d,e,f,g,h,i,j" (that is an actual example!). Any patches adding comments to the AI are welcome; especially I would like an explanation of the minimap in settlers.c and the use of the amortize function. -Thue] Known problems: [this looks partially out of date; I removed severel entries, more look suspicious but I am not sure. -Thue] ------------------------------------------------------------------------- AI doesn't understand when to become DEMOCRACY Cities don't realize units are on their way to defend it AI doesn't understand obsolescence related: AI likes to build Oracle more than Chapel AI doesn't know how to use planes and missiles AI doesn't understand how to favor trade when it needs luxury AI builds cities without regard to danger at that location city tile values are not cached; wastes CPU time Food tiles should be less wanted if city can't expand AI doesn't build infrastructure near where a city is about to be built ai_calc* routines are slow and perhaps shouldn't regard government AI won't build cross-country roads outside of city radii Non-military units need to stop going where they will be killed Locally_zero_minimap is not implemented when wilderness tiles change AI doesn't understand 13th city is unlucky Settlers won't treat about-to-be-built ferryboats as ferryboats If no path to chosen victim is found, new victim should be chosen Values for Mysticism, Electricity, and Theology need to be verified AI doesn't know how to make trade routes or when AI is vulnerable to well co-ordinated mass attacks AI doesn't acknowledge effects of MAGELLAN in some of its calculations Boats sometimes sail away from landlocked would-be passengers Ferryboats crossing at sea might lead to unwanted behavior Emergencies in two cities at once aren't handled properly AI sometimes will get locked into a zero science rate and stay there Explorers will not use ferryboats to get to new lands to explore Partially fixed problems: ------------------------------------------------------------------------- AI handicaps are minimally implemented AI manages workers one at a time, which is not as dumb as it used to be Transport paranoia code is mostly working but not 100% reliable Auto-settlers have a simplistic idea of enemy territory Idea space: ------------------------------------------------------------------------- Friendly cities can be used as beachheads It might be best to only sentry the #1 passenger and its bodyguard Unit_move_turns should be implemented more thoroughly Assess_danger should acknowledge positive feedback between multiple attackers Urgency and grave_danger should probably be ints showing magnitude of danger It would be nice for bodyguard and charge to meet en-route more elegantly It may be correct to starve workers instead of allowing disorder to continue Bodyguards could be used much more often AI should sell barracks (and other worthless buildings) voluntarily