The AI needs a lesson in effective application of force

Way back in Civ. III I had a pretty bad incident. There were two continents. I, the Babylonians and Viking (?) were the big three with two smaller nations. The Vikings and I were alone on our continent. I was on good terms with the Babylonians and was planning a HUGE attack. We each had 30-40 cities. Well, I pulled most my troops to the Viking border. I declared war. I was winning, even though I had badly miscalculated their strength. Then the Babylonians launch a huge attack on my coast cities. My huge, wonderful, wonder filled cities... So I set my men up on defensive on the Viking border and charge to defend my cities. Then the Vikings showed their true strength and launched a huge invasion. I decided to resolutely draft everyone I could and defend my center. I couldn't and lost. And that was on a pitifully low level. :(
 
Its not even like theres a huge amount they need to change to make the AI more effective. They just need some code telling them to rally their troops.

At the moment, the AI will decide which units they're going to send to war, and then send them straight to the battle the moment that war is declared. There will be some stacks inside their production cities that'll move together, but the rest just come in dribs and drabs.

THe AI just needs some basic scripts telling them how to rally their troops. Something that tells them to accumulate a stack of a few attackers, a couple of siege weapons, and a defender or two, and that they're only ready to enter enemy territory when the stack is complete.
 
Why is it that the AI always builds so much cavalry, anyway? Not just cavalry, either, but all of the mounted units. If it has to pick one unit to mass, those are probably the worst...
 
Excuse me for my ignorance but wasn't SDK released earlier, IIRC Firaxis said that you could "mod" AI using SDK, so can we do it now?
 
Yes, but you need to know what you are doing, and it's quite a time consuming process, as it's quite hard to tell if you are actually improving the AI or not.
 
Playing on Monarch recently in the modern age, im at war with Peter. After blunting (only just) his initial attacking forces, my spys reveal huge stacks of artillery and other good military forces in his interior cities. If he had taken this artillery together with one mechanized infantry each from his interior cities, he could have totally wiped me out. I guess this excessive defence is in order to prevent cheap sneak "grab and razes" behind enemy lines with **** forces. But i play with "no razing" anyway.
 
if the ai waged war effectively on diety, how hard would it be to play?
 
The Great Apple said:
Yes, but you need to know what you are doing, and it's quite a time consuming process, as it's quite hard to tell if you are actually improving the AI or not.

I understand... Are there any documents/papers on the subject? I would like to read up a bit :) Only AI though :)
 
Last night, I had this senerio:

I am France (Napolean) and I am preparing for war with Saladin to my northeast. My empire is spread out from coast to coast, but not very thick. Most cities border both Arabia and Japan or the coast.

I don't have archery, and don't have iron or horses. I do have copper and catapults. So I take my spear, axe, and catapult army into Arabian lands to declare war - I had plenty of troops.

BEFORE MY NEXT TURN, Tokugawa declares war on me from my Southwest. Now I am fighting a 2 front war - a long 2 fronts.

I had to pull some troops back and whip a few troops in my cities close to Japan because they were underdefended. Saladin landed 2 galleys worth of troops on my southern border. I played defense for 20 turns until I could get peace.

I was able to save all my cities - but not before almost every square outside of Paris was pillaged. I had to make a bad trade to get archery + a few other low techs just so I could have archers to defend my cities. It didn't take long for Tokugawa and Saladin to knock out my 3 copper mines.

Tokugawa saw his chance and took it. And almost did me in. If he had catapults, he would have whipped me I feel sure.
 
One game I had both Tokugawa and Caesar demand tribute from me. I was on a large panagea map, Prince, and neither one bordered me. I didn't give them anything, of course. Many turns later, Tokugawa declared war on me, and landed 4 units or so outside one of my cities with a couple of galleys. No problem, I think. I began rushing units there for support. Next turn, Caesar declared war, and about 4 units showed up. (He had come through the territory of my dear friend, Louis.) They were on the opposite sides of my territory.

I think, holy crap, I should have been building more military! Naturally, I started thinking about who would be a good war ally. Louis was the only real possibility. I thought, I will get Louis to declare on Caesar, and then no more of Caesar's units will even get to me - Louis will have to fight them. I patted myself on the back, and gave Louis a tech or two. Louis declared war on Caesar, and then 6 more of Caesar's units appeared inside my borders instantaneously. Voila! I had done what Caesar was incapable of doing - I had concentrated his forces for him!

It was early game, and I had neglected my military. Three or so of the units were praetorians, and they were 4 squares from my capital (defended by an axeman and and archer, and my support on its way to deal with Tokugawa). I was well and truly hosed. I was too mad at myself to even attempt to play it. I doubt it would have done me any good.
 
Melhisedek said:
I understand... Are there any documents/papers on the subject? I would like to read up a bit :) Only AI though :)
AI programming, or AI testing? I can't think of any specifcally for testing, but there are loads of pages on the web about general programming.

If you're interested specifically in the Civ 4 AI, all the code for it is in the SDK. You don't need a good knowledge of C++ (or even an average one - most can be figured out by a bit of commen sence... most) to be able to read the code and see how the AI is working.
 
Sorry I should've mentioned I needed Civ4 AI documentation, my bad :/ Had a war with Cathie going on ;)
Was always kinda interested in how AI works guess this can be my chance to finally see it in action :)

Well on to installing SDK and seeing if I can understand anything (average C++ knowledge here) Did Firaxis release some reference guide or Help files along to go with it?
 
Codeman said:
if the ai waged war effectively on diety, how hard would it be to play?
IMHO deity level should be all but impossible to play.

The problem is that humans min/max better than the AI. Probably always will. We can ask (and we do!) for better and better AI improvements, but the humans will always find ways to capitalize on the current situation. Some of this could properly be called "loopholes" or "cheats". Some, simply the human recognizing how to get better gameplay tactics and strategy.

Anyway, I won't cry any crocodile tears if it gets harder to play at deity level. In fact, with Warlords, if everybody doesn't have to drop down a level, I'll be disappointed with the expansion.

Wodan
 
The Great Apple said:
Average should be a breeze. It's pretty poorly documented unfortunetly, and the unit AI is probably the trickiest bit.

So there is some documentation? I didn't find any with the file, nor in the release thread :( Am I looking in the wrong places? And yeah it is "kinda" simple :crazyeye: I thought it was way harder than this
 
Occasionally you'll bump into a comment and some of the functions have headers which give a bit of info about them. Not very many though.

By "pretty poorly" I really meant "not". ;)

The trouble with making an AI such as this is not coding it in the first place, but makeing sure it does the most of the right things at the right times.
 
Is it possible to actually watch the AI make their moves as they are actually making them like you can with Civ 3? Last time I checked (2 months ago, before the SDK came out), you could not. I know there's a code you type in the console (debug mode) but that doesn't let me see the AI make their moves.

I was wondering if it's possible to do that now that the SDK has been out for a while.
 
@sheerin Interesting and entertaining read. :goodjob:

I don't believe that I've ever been surprised by AI tactics; not because I'm a genius, but because the AI seem to do about the same thing it' been doing since 1995: landing a few troops somewhere to annoy me, hordes aimlessly flooding over the border, a couple of horsemen hurry around to pillage. :(
 
Back
Top Bottom