Thread Tools
Old July 12, 2002, 05:59   #1
dexters
Apolyton Storywriters' Guild
King
 
dexters's Avatar
 
Local Time: 04:10
Local Date: November 1, 2010
Join Date: Nov 2001
Location: Vancouver, Canada
Posts: 1,141
On How to Improve Civ III's AI
The content of this post was made initially as a response to another. I liked what I written, and thought I should being it up again.

Please not I am not dissatisfied with the game's AI, I think however, it still lacks some human qualities, and while we can't expect AI to match human intelligence, I think there are certain routines which could be implemented to make the AI more challenging, and it would not have to do with the AI cheating or getting bonuses. Read on.

----------------------------------------------------
While a option to considerably alter AI may be out of our reach, I hope we can see a more modest AI editing, if not from the fans, at least from Firaxis.

For the record, I find the AI to be quite competent and satisfactory, although as mentioned above, AI's should be capable of multiple invasion strategies.

In most games, if attached on land, AI merely moves it forces over land, and occasionally drops the the surprise attack (usually a small force) behind your lines.
Of course, the AI is known to sign ROPS and attack you where you think you're safe. Good thing.

In Island wars, where enemy AI is on a different island/continent, AI appears to land in random points, usually 1 force landing in one location, while another force lands in another area in a surprise landing.

What could be improved is a set variation on this strategy.

For island wars, AI may or maynot land in two areas. They may land a combined army in one spot. Or they may land in two or three. We don't know, and we're sort of faced with what the germans faced trying to defend the beaches of France. While the number of alternatives are estimatable, defending against all probabilities could be costly, and thus adds challenge.

As far as I've observed, most wars usually have the odd unit destroying an improvement here or there, or maybe a road to a resource. They may send artillery and ships to passively bombard, but there is no active strategy on an invasion force whose sole purpose is to make the player commit forces to fight the invasion.

The AI should be randomized so that they may attack you with the intent of causing maximum damage to your infrastructure, which means, a force going on a rampage destroying improvements. Currently, the AI landings, often defeat themselves by attacking well fortified cities -- and their lust for workers, often lead then into deadly traps. This makes it rather easy for players to either bait the AI, or sit out the assault, and in both cases, the player is in control, they wear down the AI army then send their own "main force" to mop up. If the AI is programmed to sometimes attack with the intent of destroying imporvements, and they refuse to take cities and instead sit around cities destroying improvements and starving the population, the player have no choice but to attack, not only making the game more challenging, with the player attacking fortified and fresh units, it makes for a more intricate war.

Even more interesting is to have an invasion with both strategies going. One invasion attacking cities, another invasion force destroying improvements. And in both cases, AI should have some sort of a switch that allows them to adap and change their strategy on the fly. A rampaging army destroying improvements may try to take weakly defended cities once the player has send his reserve defensive units out of the cities to fight the invasion. Or the army originally set to attack cities may switch to destroying the improvements around the city first, in a siege, then switch back to attacking the city.

Any thoughts on this? Soren, is this possible / reasonable modificaiton for a patch ? :P
dexters is offline  
Old July 12, 2002, 07:32   #2
The Viceroy
Prince
 
The Viceroy's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Nov 2000
Location: Colombo
Posts: 310
I have found the AI often will send a long line of units to attack (on land) .. as though, it sends them off to the destination as and when they are built .. rather than waiting for a mass group and then sending the whole lot off on an attack. I had a situation where a single city came under attack by German swordsmen, but one at a time, and a few turns space between. Each time my defender recovered in time for the next attacker.. and by the time he was defeated, I had more defenders ..

Had the Germans invaded with 10-20 swordsman at once, I would have stood no chance whatsoever with my single defender .. thats what I do to the AI ..

I have seen AI's in the past which use a power map to determine how big a force is required in order to obtain an objective. Each grid position is given a power rating, dependent on what unit is there. When calculating the defensive ability, not only is the city square taken into account, but also surrounding squares + power that could be moved to that location in time for the battle.

The AI can then create an attacking force, even use smaller forces to hold off power being moved from one section to another ..

I like the idea of a dual force, one for pillaging and one for attacking, this could be used to not just reduce the resource of the defending nation, but as a distraction away from the main attack .. lets face it, there's nothing more infuriating than an AI destroying your beloved hard work/workers ..
__________________
"Wherever wood floats, you will find the British" . Napoleon
The Viceroy is offline  
Old July 12, 2002, 12:18   #3
Arizona_Steve
Settler
 
Local Time: 21:10
Local Date: October 31, 2010
Join Date: Apr 2002
Location: Englewood, Colorado
Posts: 3
(1) Fully document the AI API function calls, parameters and return codes.

(2) Create a dummy DLL containing all AI API function calls, each of which returns TRUE to the caller eg.

bool SettlerBuildCity (parameters) {
return TRUE;
}

(3) If new AI code is written for a given function, set the return value for the altered function to FALSE.

(3) In the Civ3.exe code load the AI DLL above, then for each AI call, call the function in the AI API DLL. if it returns TRUE (ie there is no override), then call the existing AI code in the Civ3.exe.

Such a framework would allow the programmers among us to selectively reprogram part (or all) of the AI code, with minimal effort on the part of the Firaxis programmers. It also has the advantage that Firaxis do not have to release any of their source code.

A long shot, I agree, but a possibility nonetheless.
Arizona_Steve is offline  
Old July 12, 2002, 12:31   #4
Lucilla
Mac
Princess
 
Lucilla's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Apr 2002
Location: Edinburgh, Scotland
Posts: 541
You really think that Firaxis is going to write API documentation for the public? Think again! The Civ3 AI is not supposed to be a component to be used by third parties to enable them to build their own application around it.
Lucilla is offline  
Old July 12, 2002, 12:37   #5
Arizona_Steve
Settler
 
Local Time: 21:10
Local Date: October 31, 2010
Join Date: Apr 2002
Location: Englewood, Colorado
Posts: 3
Agreed. That's the killer. Being a programmer myself, documentation has always been the part I hate. Having said that, ID Software (Quake) and Epic Megagames (Unreal) did go so far as to release their AI source code to the public domain, and left it to the programming community to figure it out. Saves documenting it.

But as I said, it's a long shot, and I don't expect it to happen with Civ.
Arizona_Steve is offline  
Old July 12, 2002, 12:43   #6
Lucilla
Mac
Princess
 
Lucilla's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Apr 2002
Location: Edinburgh, Scotland
Posts: 541
I didn't want to imply that Firaxis doesn't have API documentation. I don't know about that. I wanted to say that it's highly unlikely that they would release it to the public (assuming it is documented).
Lucilla is offline  
Old July 12, 2002, 19:59   #7
Beard Rinker
Settler
 
Local Time: 20:10
Local Date: October 31, 2010
Join Date: Jan 2002
Location: Victoria BC, Canada
Posts: 2
An interesting idea, pillaging attack force, however this may or may not be effective in practice. With the industrious trait or a large work force, improvements can be rebuilt quickly. A couple of bombardment units could soften up the attack force and they could be destroyed with minimal casualties.

I think the best way to improve the AI would be to observe the tactics used by the best players and implement those. Right now the best players use tactics that work best against the AI, not necessarily against human opponents. Once Play the World comes out there should be some viable strategies developed that could be copied by the AI.
Beard Rinker is offline  
Old July 12, 2002, 21:28   #8
Coracle
Prince
 
Coracle's Avatar
 
Local Time: 23:10
Local Date: October 31, 2010
Join Date: Feb 2002
Posts: 915
Quote:
Originally posted by Beard Rinker
. . . Once Play the World comes out there should be some viable strategies developed that could be copied by the AI.
Pillaging instead of that Culture Flipping nonsense would be an improvement.

As for the AI, are you assuming it will be improved with PTW? As far as I can see, PTW will just be superficial window dressing - at thirty dollars a pop.
Coracle is offline  
Old July 12, 2002, 22:08   #9
Beard Rinker
Settler
 
Local Time: 20:10
Local Date: October 31, 2010
Join Date: Jan 2002
Location: Victoria BC, Canada
Posts: 2
Quote:
Originally posted by Coracle

As for the AI, are you assuming it will be improved with PTW? As far as I can see, PTW will just be superficial window dressing - at thirty dollars a pop.
No I don't expect the AI to be any better with Play the World. What will be different is players will be playing head to head. This will be a good testing ground for different types of strategies and ones will develop that are not simply exploits of an AI blind spot. These strategies can then be used by Fireaxis to improve the AI.
Beard Rinker is offline  
Old July 12, 2002, 22:15   #10
dexters
Apolyton Storywriters' Guild
King
 
dexters's Avatar
 
Local Time: 04:10
Local Date: November 1, 2010
Join Date: Nov 2001
Location: Vancouver, Canada
Posts: 1,141
Quote:
Originally posted by Beard Rinker
An interesting idea, pillaging attack force, however this may or may not be effective in practice. With the industrious trait or a large work force, improvements can be rebuilt quickly. A couple of bombardment units could soften up the attack force and they could be destroyed with minimal casualties.

I think the best way to improve the AI would be to observe the tactics used by the best players and implement those. Right now the best players use tactics that work best against the AI, not necessarily against human opponents. Once Play the World comes out there should be some viable strategies developed that could be copied by the AI.
It will be far more effective than wasting an entire invasion force on a well defended city.

The idea is to cause damage, industrious or not, it takes time to rebuild. This can especially be devastating in the mid game where workers spent on rebuilding improvements means some tile has to wait longer to get roads. This = less commerce, and less science.
dexters is offline  
Old July 13, 2002, 06:53   #11
DAVOUT
PtWDG RoleplayCivilization III Democracy GameInterSite Democracy Game: Apolyton Team
King
 
DAVOUT's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Jun 2002
Location: AUERSTADT
Posts: 1,757
I am under the impression that the AI uses the stacks as they have been build (following the program which says : build that unit until I tell you to change or until I have a target) ; after the stack has left the building location, I have not observed any concentration of units (to meet a threat) or a stack divided to create several threats. Some of the posts above confirm this impression. This is obviously a major tactical weakness.
The solution implies some programing (before any move toward a target 1/ is there any unit behind me going to the same target 2/ if the strenth of my stack exceeds enormously the strenth of my target, is there another interesting target ?). The computing time of such should not be overestimated because there are not so many stacks moving toward a target at any given time.
__________________
Statistical anomaly.
The only thing necessary for the triumph of evil is for good men to do nothing.
DAVOUT is offline  
Old July 13, 2002, 08:44   #12
dexters
Apolyton Storywriters' Guild
King
 
dexters's Avatar
 
Local Time: 04:10
Local Date: November 1, 2010
Join Date: Nov 2001
Location: Vancouver, Canada
Posts: 1,141
I think what I'm advocating is even simpler. It's simply modifying existing AI targets, which has been proven time and again to be easy to defeat.

The pillage invasion, while fully predictable, is more difficult to defend against given the AI will be using its troops to pillage, not wearing themselves down by attacking fortified cities.

In general, my suggestion is asking for more variety, randomization, and general macro level switches that allows the army on the field to adapt reasonably to the changing situation. So, while the individual units may be as dumb as before, the leader module should be assesing how best to attack, and sending commands down directly to each units as to which position to take.

This does not require an overly complex threat assesment. For example, the AI could cheat a little by requesting enemy unit concetrations on a specific domain and range of tiles. If the return response is say 100, it is then input into a flexible formula that takes into account variables such us technological advancement, # of units, and then the AI can say, switch to taking cities, or stay on pillage, or form up.

This would imply the AI would continue to display clumsiness, but it would be far more challening than the AI that bee-lines for your workers, or send 3 swordsman to suicide into your cities. Those same three swordsman could probably do you more damage by pillage your roads and irrigation before your troops wipe them out.

And that is one of the key ideas. It is too easy to passively defend by fortifying key cities, and then moving in a few units to mop up the weakned attackers. a pilalge force, or a combined force would force the player to committ forces to fight toe to toe with the AI, with units at full HP on both sides. This would make defense as challenging as offense, when of course, the player is facing well fortified, full HP AI units.

Last edited by dexters; July 13, 2002 at 08:49.
dexters is offline  
Old July 13, 2002, 09:10   #13
DAVOUT
PtWDG RoleplayCivilization III Democracy GameInterSite Democracy Game: Apolyton Team
King
 
DAVOUT's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Jun 2002
Location: AUERSTADT
Posts: 1,757
Dexters,

I assumed, but I may be wrong, that the choice of a target is much more difficult to program that the behaviour of the units when they move. I understood, from other threads, that AI units have already be seen pillaging, although I have not yet observed that in my games ; it means that the pillaging is already a valid target but with a low priority (lower in any case than attacking a town with adverse odds). In that case, changing the priority could be simpler than establishing new tactical targets.
__________________
Statistical anomaly.
The only thing necessary for the triumph of evil is for good men to do nothing.
DAVOUT is offline  
Old July 13, 2002, 12:15   #14
W4r_Machine
Warlord
 
W4r_Machine's Avatar
 
Local Time: 22:10
Local Date: October 31, 2010
Join Date: Jun 2002
Location: of Nothing! Canada, where the sun freezes
Posts: 140
Does the AI get smarter as you increase the level?(Chieftain-Deity) OR The AI just get a ton of bonuses?(Monarch-Deity)

I played 4 games on Emperor level and found that the units are considerably bigger in numbers when attacking and pillage when they can.

I never saw one unit go on a suicide mission 'cept the firt turn of war, but even then there's # stacks waiting in the wing. It lacks tactics, but it sure makes up in numbers.

However, as noted, the AI should utilize the transport vessels much better. 3 galleons with 1 unit inside isn't really an invasion force.
__________________
Janitor, janitor
scrub in vein
for the $h1t house poet
have struck again
W4r_Machine is offline  
Old July 13, 2002, 12:31   #15
Lucilla
Mac
Princess
 
Lucilla's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Apr 2002
Location: Edinburgh, Scotland
Posts: 541
Quote:
Originally posted by W4r_Machine
Does the AI get smarter as you increase the level?(Chieftain-Deity) OR The AI just get a ton of bonuses?(Monarch-Deity)
No, I don't think it gets smarter, because how would you define "smart" in AI terms? My experience is, that the tactics don't change, but the AI gets more aggressive and has more advantages (cheaper units, tech lead etc.). The only thing that might make it look smart, is that it prefers trading with other AIs instead of trading with the human player.
Lucilla is offline  
Old July 13, 2002, 12:36   #16
W4r_Machine
Warlord
 
W4r_Machine's Avatar
 
Local Time: 22:10
Local Date: October 31, 2010
Join Date: Jun 2002
Location: of Nothing! Canada, where the sun freezes
Posts: 140
Thanks Lucilla,

Keyword: AI is more Agressive (Ithought as much, so I guess that's a form of intelligence)
__________________
Janitor, janitor
scrub in vein
for the $h1t house poet
have struck again
W4r_Machine is offline  
Old July 13, 2002, 12:39   #17
FrantzX
InterSite Democracy Game: Apolyton TeamC3C IDG: Apolyton Team
Warlord
 
FrantzX's Avatar
 
Local Time: 23:10
Local Date: October 31, 2010
Join Date: May 1999
Posts: 175
Last night, I checked all the 'build often' settings except for settlers and workers for all civilizations. I think this has helped, but I have only played one game with these new rules.
FrantzX is offline  
Old July 13, 2002, 12:40   #18
Lucilla
Mac
Princess
 
Lucilla's Avatar
 
Local Time: 05:10
Local Date: November 1, 2010
Join Date: Apr 2002
Location: Edinburgh, Scotland
Posts: 541
The reason for the AI to become more aggressive might also be, that it fights weakest oponents first, which on higher levels is usually the human.
Lucilla is offline  
Old July 13, 2002, 12:47   #19
W4r_Machine
Warlord
 
W4r_Machine's Avatar
 
Local Time: 22:10
Local Date: October 31, 2010
Join Date: Jun 2002
Location: of Nothing! Canada, where the sun freezes
Posts: 140
Quote:
Originally posted by Lucilla
The reason for the AI to become more aggressive might also be, that it fights weakest oponents first, which on higher levels is usually the human.
Yep, that was definately the case in my games. I'm usually the b1tch in the corner up until knights arrive. Then I do my aggresive campaign, then AI alies with all the AI and I die.
__________________
Janitor, janitor
scrub in vein
for the $h1t house poet
have struck again
W4r_Machine is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 00:10.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team