(Constructive!!!) AI Suggestion Box

GI Josh

Chieftain
Joined
May 23, 2002
Messages
67
Overall I think the AI in Civ3 is quite good. My purpose with this thread is for suggestions to improve on the AI. Yes, the AI "cheats", i.e. it has advantages the human player does not. On the other hand, we have an advantage the ai does not, i.e. an organic brain. I do think there are discrete, concrete ways in which the AI can be improved.

My first suggestion is a scripting language. This would allow the development of set small-scale strategies under certain triggered conditions. In this way, we players could build a "toolkit" of AI responses. There should also be a weigh to weight the significance of certain strategies so that we could have the AI choose in a weighted random way between several strategies. This would be most effective for easily defined circumstances, such as the opening round of a war. For example, I often start a war with a big arty push. One script would be for the ai to take a stack of arty with a few defenders to a RRed tile w/i its own borders that's w/i range of a city that it's already to decided to start a war with. In the opening round, ai uses say 2/3 of its available arty on the city, then attacks with fast movers (tanks or cav) to take the city in one turn. Certain scripts could also have the computer use arty w/ RR better on defense.

With a scripting language (apparently other strategy games have had them), the ai would constantly be improved by our collective wisdom. Distinctive civs could have distinctive scripts. An AI will never come close to a human player (sorry Zouave), but it can be improved in discrete situations.

IMHO, the AI does quite well pre-RR when virtually everyone, human and computer, uses the large stack attack. The AI does not use the terrain quite as well and needs to orient more on defensive terrain and strategic resources, but overall does quite well. Once RR and modern warfare debut, conducting a war becomes orders of magnitude more complex (and interesting). Small scripts for easily defined situations, such as opening attacks, would allow the AI to do more than the slow-moving-easily-destroyed-by-arty-on-RR-stacked-attack.
 
GI josh, you do not know just what you demand! It is nearly impossible to program an AI that can make real plans (i.e. unlike in Civ3 where the AI makes decisions at the spot, then simply moves every unit accordingly).

When you see the AI mave troops up to the border, then declare war and attack, this isn't a plan, the decision was 'go to war' and is made, just the declaration waits unitl the first fight. That is why the AI is incapable of massing troops properly, why they often attack with 4 Swordsmen, then 4 more the next turn - instead of waiting one turn and have a far higher chance of success by attacking with 8 in one turn.

So how should the AI use scripted strategies? it would have to make plans first, then implement these separate bits.

I do not think we will see this in the near future, a 'decide on the spot'-AI is just too strong atm to merit programming of a really smart one. It just isn't commercially viable! :(
 
I think the AI uses terrain "ok", what I don't understand is when I have a stack of tanks next to a city ready to take it after I bombard it with Arty WHY AI does not move it's battleships and planes out of there to a safer haven, that can not be too hard of a programming job. Also if the AI cheats like everyone says it does and it already knows where all my units are, why can't it feign an attack in one place and launch a surprise attack somewhere else... All that would take is a few "if" statements in the code.... Boolean logic anyone???

:p
 
Originally posted by sabo10
I think the AI uses terrain "ok", what I don't understand is when I have a stack of tanks next to a city ready to take it after I bombard it with Arty WHY AI does not move it's battleships and planes out of there to a safer haven,
:p

that would mean the AI doesn't decide what to do with each unit separately. Remember Civ2? Where the AI would move 50 units in your territory, then attack you with No. 51???? Why not use all 51 for attack? because it decided to attack after 1 to 50 were moved :(

Now, it's a little better, becasue of the order in which units come active. but still, the AI attacks and attacks my town, then bombards it! :confused: why not bombard the units? because that requires a plan!!!!!

I guess the AI is a LOT simpler than we think, it is just 'dressed up' nicely. No problem here, I know from a friend how difficult it is to program a PC to plan - he couldn't get a program to outsmart a colobus monkey, just out calculate like a chess program.....

so no 'if'-things here, that woulöd - I think - require MAJOR changes in the AI
 
I've posted countless times of the STUPID things the AI does. I realize it can't match me for pure strategic thinking - but it CAN do things humans can NOT do: use the power of the PC to calculate possibilities and other future options, something like as in chess (I realize there are some differences).

Few people complained about the Civ 2 AI, even though we posted some of the dumb things it would do, such as build battleships in lakes. We LIKED the Civ 2 AI; it was kind of endearing. It didn't cheat, and it did NOT get in-your-face all the time like this irritating AI. BTW, the Civ 3 AI also has built battleships (or ironclads) in lakes; I've seen both the rival civ and my AI governor do it. Why is that, Firaxis?? No warship should be built in a fourteen tile lake.

What stupid things does the AI do? How much time do you have?

Military wandering after undefended workers or bombardment units like moths to a flame. I then ambush them.

Settler/foot solder combos meandering arrogantly into my territory EVEN WHEN AT WAR WITH ME to get to the open tile. So I destroy them and get two free workers. It got boring fast after I did it three times in a row. :sleep:

Those pathetic coastal raids the AI makes when at war. It drops off a few military far behind my lines, with no support or followup. I make short work of them.

The AI always being lured into killing fields of plains or grassland where I attack the invader before he attacks me. I once saw a huge stack of German sworsdmen, spearmen and archers coming. Since the AI never really launches significant invasions in more than one location I merely concentrated on it and then attacked down from my hills. Final result: 18 destroyed German units; I lost four.

The AI is incapable of using artillery offensively.

The stupid things the AI does in Trade and Diplomacy is also unacceptable. We cut a tech deal, but I decide to be nice and throw in free six resources as a bonus - the braindead AI insults me and cancels the deal owing to my rep, which is also a crock as we often get blamed for things we never did.

Those are just a few examples of sloppy rushed programming - not the fact the I can out think the AI strategically. If you don't think the game was rushed remember in December we all knew the beta game was LOADED with bugs and even typos!

Scripting language, as you describe it, sounds great. Hopefully some other company than Firaxis will utilize the like of it for Civ 4. Firaxis is too satisfied with sales to do anything.

Firaxis. Hey guys, you fooled me once.
 
Lt. M - My point is not for the ai to construct "plans" from whole cloth. Whatever the algorithm for deciding to go to war, once the decision is made there could be scripted "invasion" tools. For example, the ai decides to go to war, however it does it now. It could then go to the scripts and see if any apply. A script for arty attack on border cities w/i arty range followed by a tank blitz would be one such script. I'm not a programmer, perhaps I'm asking for the moon. I understand that warfare in Civ3 is complex, and extremely complex once RRs, arty, air, etc. are available. That's why my thought is to have easily defined situations with scripts. Programmers amongst us, is this possible or should I quite drinking in the afternoon?
 
GI, it is a very good idea, but it would require the AI to be able to activate units for the purpose, or at leastkeep that purpose 'in mind' - can't be done with the current AI afaik :(

sorry, I asked a programmer friend and he said the way the game looks the AI 'has to' move each unit right away, and there is no provision whatsoever to use scripts. Would be very nice though :D maybe in Civ4?????
 
No one will ever convince me that's it's "just too big of a job" or it's "impossible for a computer to 'plan'" Anyone who has ever played Chessmaster2000 on the high levels can attest to that...

:rolleyes:
 
Speaking of a bad stupid AI, see the post in the Settler Diarrhea thread.

I am SO tired of that settler/spearman combo wandering into my territory, ignoring TWO demands to leave, and on the third demand teleporting itself magically to the OTHER side of my civ to open tiles it should even know exists. :mad:

I'm sure it would take minimal effort by Firaxis to write whatever it needs to to require a settler to GET OUT on the first demand. Don't expect Firaxis to care; they are too busy boasting about their sales.
 
Originally posted by Lt. 'Killer' M.

sorry, I asked a programmer friend and he said the way the game looks the AI 'has to' move each unit right away, and there is no provision whatsoever to use scripts. Would be very nice though :D maybe in Civ4?????

I don't think many of us expect scripting in any Civ3 or Civ3PTW patch.

And I think many players really like the AI to have advantages, because they have learned to play a limited kind of game that will beat the AI on deity. Then these players can feel a sense of accomplishment in beating a stupid, but powerful, AI. Although I can beat the game at deity, it's not as satisfying as it would be to beat an AI that played well. I guess I would characterize deity as "tedious" rather than "challenging."

I want Civ4 to have a stronger AI, and I will pay $10 more per box for it. But let's be realistic. If Firaxis (or whoever) tries to make the AI stronger, that will also increase:

  • The risk of bugs
  • The risk of slower performance
  • The risk of using more system resources, like memory
  • The amount of person-hours required, and consequently the risk of a later release date.

I have to give Firaxis credit for exposing, and making configurable, many AI advantages. Thanks, guys, for a good failth effort! (Even though you will see more complaints than praise in this forum, many of us liked the 1.21f efforts to expose the AI advantages.)

The introduction of scripts, and a continuing effort to expose and make configurable, AI advantages, could be a very good thing for Civ4, though. We might be working on scripts instead of struggling with AI cheats. Then the best scripts could be made available on the next patch, and the effort to improve the AI's play might really take off! In addition, this could be a stroke of genius for Firaxis/Infogames because it would involve the customers and make them feel like part of the development effort. If this results in increased sales, maybe that would offset the risks.

Firaxis, please consider GI Josh's idea.

Very good idea, GI Josh! :goodjob:
 
Some good ideas - I'm sure we would all like the AI to act smarter - my concern would be the trade off in time per turn - already by the late game turns can get very slow - adding scripting or more complex calculations for the AI could make things even slower.

There will always be a trade off between making an AI that acts intellegent or one that has in-built advantages (cheets by any other name) or that works at a reasonable pace or that doesn't cost mega-money in development costs making the game way too expensive.

I still play civ2 and find the AI in civ3 is better at least it doesn't start building units and count down a sneak attack (what is so sneaky - you can predict it to within a turn) like civ2. Sure it isn't perfect and we all have moans about certain things it does but I think the balance is just about right.
 
Originally posted by Hawkster

my concern would be the trade off in time per turn - already by the late game turns can get very slow - adding scripting or more complex calculations for the AI could make things even slower.


I was thinking that scripts would be optional, so if the game is slower with scripts, you wouldn't have to use them.
 
Originally posted by sabo10
No one will ever convince me that's it's "just too big of a job" or it's "impossible for a computer to 'plan'" Anyone who has ever played Chessmaster2000 on the high levels can attest to that...

:rolleyes:

chessprograms simply do all possible moves, then selct the one leading to the best outcome. Very easy to beat.
Next step: the chess programs does all possible moves, then all your possiblers, then it's possibles - a little touhger. And so one. Once it starts to think 6 tunrs ahead, it gets real bad - but also takes an awfull lot of memory and calculating power.

There is NO planning involved whatsoever!
 
As a programmer, I can say that I think making the AI scriptable is a feasible and very good idea. However, unless the AI has been built with that in mind, I doubt it would be a trivial task to make it scriptable. In fact, it would probably be far from trivial.

What I would like to see most is the AI made into a simple DLL with a well-defined and documented interface. This way, users could totally rewrite the DLL, providing their own version of the AI. But I doubt any game company would ever do that. It's the sort of thing an open-source project might do though.

I suspect that the AI probably reevaluates the actions of every unit every turn, which I assume is what people mean when they say it doesn't have plans. I.e. if the AI builds a settler in a certain city, a function something like settler::move() is probably called. This function will work out a nice place to build a city, and it will move towards it as far as it can go in the current turn. However, next turn rather than it "remembering" that it's heading to square x, settler::move() will be called all over again, and it will do a complete reevaluation of where it wants to get to. In all likelihood, the state of the game won't have changed much, and it will decide that square x is the best place to go, especially since it's now closer to it than it was last turn, so it will take another step towards square x; and so on.

In other words, the AI is probably stateless, or near stateless. Because of this, one can play hilarious tricks on it, blockading it for a couple of turns, it moving away from the blockade, then opening up the blockade again, the settler making a beeline for the blockade, and just before the settler arrives, the blockade is shut again. Making the AI stateful would help solve problems like this, but would not be easy. As an example, most firewalls are stateless, and because of this, even though an IP has sent 10,000 dubious packets previously, packet 10,001 will be considered without remembering these 10,000 bad looking packets. Firewall software is generally much simpler than the AI to a game like Civilization, yet it's hard enough programming a stateful firewall.

However, there's plenty of low-hanging fruit to be gotten at first in my humble opinion. The AI is basically flawed in a number of ways at the moment, for instance its complete lack of building barracks. Also, as far as good city placement and worker actions, I would have thought an AI should be able to compete with a human. An AI should be able to predict things in exact turns; how many turns the city is really going to build that worker in, considering that it's going to grow in 2 turns. It should be able to optimize between irrigating and mining, and it should be able to work out the best city sites. Also, an AI should be able to make sure cities *never* fall into civil disorder, since civil disorder can be seen the turn before, it would just scan all its cities for cities about to fall into it, and take corrective action. Sure, humans would be able to see some strategic things that the AI couldn't see, but the AIs tactical city management could be pretty flawless, matchable only by a human that scans their cities endlessly, and uses a calculator in conjunction with playing the game.

However, I am pretty sure the CivIII AI doesn't do any of this kind of stuff. I think I even saw a Firaxian say in a chat that he thought humans could always beat AIs if they micromanage things enough, for instance the science slider, to make sure they spend the minimum possible gold on research. However, I find this strange. Surely if there is anything an AI could do well, it is precisely this sort of thing - micromanaging to an insane degree. It is in long-term strategy that humans should be superior.
 
Zouave said:
Speaking of a bad stupid AI, see the post in the Settler Diarrhea thread.

I am SO tired of that settler/spearman combo wandering into my territory, ignoring TWO demands to leave, and on the third demand teleporting itself magically to the OTHER side of my civ to open tiles it should even know exists. :mad:

I'm sure it would take minimal effort by Firaxis to write whatever it needs to to require a settler to GET OUT on the first demand. Don't expect Firaxis to care; they are too busy boasting about their sales.

YES ZOUAVE I DEFINENTLY AGREE WITH YOU!!!

I have that EXACT same problem. If I were to list AI improvments (too huge to post) one of the top ten would be to "stop this settler diarrhea crap by programming the AI to concentrate on something besides settlers."
 
Originally posted by WarlordMatt


YES ZOUAVE I DEFINENTLY AGREE WITH YOU!!!

I have that EXACT same problem. If I were to list AI improvments (too huge to post) one of the top ten would be to "stop this settler diarrhea crap by programming the AI to concentrate on something besides settlers."

Keep in mind that if "settler diarrhea" bothers you, it is probably a good strategy, if only to keep you frustrated and distracted.
 
What if the AI didn't build so many settlers? Then the AI cities would start getting bigger than size 1, and the human player would have very tempting targets in those size 2, 3, etc. cities. As it is, during the 1st phase of the game, if I, the human player, attack cities and win, the size 1 cities disappear -poof- and I still have to build settlers after killing all those !@#% spearmen. You see, the AI is trying to win, not make me happy. :)

by Zachriel Keep in mind that if "settler diarrhea" bothers you, it is probably a good strategy, if only to keep you frustrated and distracted.

But after a while, the AI's stupidity starts to tell.....
 
Originally posted by Sirp


I would have thought an AI should be able to compete with a human. An AI should be able to predict things in exact turns; how many turns the city is really going to build that worker in, considering that it's going to grow in 2 turns

However, I am pretty sure the CivIII AI doesn't do any of this kind of stuff


Sorry, Sirp, but the AI does in fact time the production of settlers very precisely. If you get an embassy and loook at AI cities you can see "growth in 2 turns" with "settler... Complete in 2 turns" very consistently. There are some categories of micromanagement the AI is very competent at.

Why not hire a guy from a good military sim game to help with AI military strategy? (Or maybe they did and his subsystem didn't fit the schedule or something).

I agree that just building barracks, marketplaces, libraries, etc. would be a plus...
 
sumthinelse: perhaps I didn't explain myself clearly enough. I know that the AI can plan units that take up population and shields (i.e. settlers and workers) right, but this is pretty trivial.

What I mean is this: early on, when the AI has say, two cities, and it is working out what to build next, it is choosing our of a settler and a worker. It should be able to say "now if I go for a settler, it will be complete in x turns, will be able to get over to that square in y turns, and build a city; in 20 turns time, the productivity of the settler will be xyz. If I go for a worker, it will be complete in n turns, will be able to build that road there, mine there, and will increase production for the city which will then be able to build a settler in m turns" and thus weigh up the different options. I don't think it does anything like this at the moment...
 
Back
Top Bottom