A Better AI.

So far as Tofof's concerns of the AI paying too much for resources... I've kind of noticed this. I wouldn't underestimate the use they may be able to get of the resource now and it's kind of a tradition that the AI will make 1 for 1 trades in CIV. I'm probably not going to change it but I may look at reducing the maximum amount they'll pay.

I think resource trades can (and should) be optimized, if the relevant variables are accessible. I don't know how it is done currently, but I would think a good functional form would be:

value = (base for map size) * (linear function for # of cities) ...

The number of cities should be an easily accessible variable since it is needed for calculating maintenance

... * (factor for type of resource) ...


maybe Health = 1.0 ; Luxury = 1.5 ; Strategic = 3.0

... * (factor for doubling era)


Health (Granary) = 1.5 ; Luxury (Forge) =1.5 ; Luxury (Market) = 1.3; Luxury (Grocer, Theater) = 1.20 (happy > health) ; Health (Seafood) = 1.1 ( < Granary because less cities can build Harbors)

So Corn > Crabs > Cows due to likelihood of a city gaining two Health from one resource; Silks > Sugar > Corn because Happiness is more of a limitation in city size/productivity than Health in most cases.

The largest problem with this type of formula is that the human will have a difficult time trading resources pre-Currency, and AIs could have a difficult time trading resources at all (Do I use the 15 gpt to increase the science slider 10%, or do I use it to execute 3 resource trades with my neighbors?). One by-product of this system could be establishment of trading blocks within the AIs, as it should be easier to trade multiple resources in a single trade than to trade single resources in multiple trades.
 
Roland raises a good point. I rarely if ever try to buy resources off the AI with gold, as it is indeed prohibitively expensive even in vanilla civ. I would prefer that the AI realize that a crappy resource that most civs already have just isn't worth a lot in trade. Ideally, it'd be willing to trade bad resources away for cheap and be even more expensive on really critical ones, more like a human.

It seems that the AI doesn't really distinguish between a lot of its resources and so it can't recognize an unreasonable trade - either its own offer, or the human player's. Right now, that's exploitable - you can trade an AI something it doesn't really need and get something very nice in return, like a) lots of cash or b) a resource you critically need.

What Troy just suggested above is absolutely on the right track. I occasionally use the 'take over AI' feature to see just how badly the AI is manging its own economy, and they don't seem to look at what's the actual limiting factor on the growth of their cities, i.e. health vs happiness vs food production, when they're valuing trades.

As far as implemention goes, I'd suggest even a fourth category of resource types - 'economy' for Stone-Marble-(Coal?), valued around 2.0. (I think of coal as enabling railroads and powerplants, not ironclads). They're not as critical as the miltarily-used 'strategic' resources, to borrow from the civ3 definition, but in some situations they're more important than luxuries if you're not hitting happy caps across your empire.

The situation I was complaining about (fish to an inland civ) would probably be fixed by this. Instead of being willing to part with high-value (cash, strategic resources) resources, the AI would prefer a fairer trade (health for health when possible, etc). Blake mentioned earlier that 1:1 trades are traditional for Civ and I agree, but certainly we can help the AI do a better job of deciding if a given 1:1 trade is actually fair.

I don't know many human players who would be so desperate for +1 health that they'd trade away surplus stone/marble to someone who'd compete with them on wonders.
 
Oh, in response to someone that was asking about multiplayer - Months ago, when I was trying to do multiplayer games with modified files, I had a similar problems trying to get both computers to play together nicely. I ended up just making my own mod and setting it to autoload by default, rather than using the customassets folder. That's what I've done with this as well - I just dropped it into the mod's 'assets' folder and it worked perfectly.

(To anyone concerned that my other mods could be responsible for effects I'm seeing and/or commenting on, please don't be. Nearly all of the changes are interface improvements with no effect on gameplay whatsover. The only custom elements are a custom game speed that lies between normal and epic, some juggling of starting techs to be more historically accurate, and an extra couple warriors at the start to lessen the effect of an unlucky combat with a bear.)

Speaking of multiplayer, any thoughts on what seemed to be a bug that I complained about? Specifically, 'close borders spark tensions' is now being attributed to an entire team when only one nation on the team actually even shared a border. Previously, it applied only to the individual nations within the team.
 
Thanks for the reply's to my mulitplayer questions Istus and tofof. I'll give it a go over the weekend.
 
I don't know many human players who would be so desperate for +1 health that they'd trade away surplus stone/marble to someone who'd compete with them on wonders.

I will sometimes do this when it allows me to grow all my cities 1 size larger. Especially if I don't plan to build a wonder related to the resource. I'm not really wonder addicted. I even trade away my last copper if I'm desperate for a luxury resource or health resource. At the higher difficulty levels, you sometimes need the extra happiness or health resources so that your cities can get to a size where your empire becomes economically healthy. The starting health and happiness of your cities is pretty low and if you happen to start in an area without an abundance of resources, it can really be a problem.

(BTW, some might think that the above behaviour is quite stupid. But then again, I played my first game of Civ4 at emperor level on a large continents map and won. So I can't really be a stupid nitwit or the game is just stupid ;) )

Of course the AI has less of these problems because it doesn't have such low starting health and happiness values as humans have on high difficulty levels. However, the AI is also less capable in finding and hoarding certain resources that it needs. Maybe the AI should be programmed to trade for resources more effectively. It would be nice if the AI were capable to initiate a trade with gold per turn for a resource (if it doesn't have resources to trade for the resource). I have never seen an AI initiate such a trade proposal. Maybe the value of resources should be lowered a bit for this because otherwise the large players with lots of resources will benefit too much. And in general the human might exploit it, especially if he has a large empire.
If I see that I often have to pay 30+ gold per turn for a resource (huge maps, early middle ages), it could easily be exploited by the human player if the AI were also paying these amounts. But to keep things fair, the price of resources should be lowered for both the human and the AI.

If the AI were really capable to use gold per turn for buying resources, then also the other complaint that gold was becoming meaningless in trade would be negated.

To make this work, the AI should recognize which resources are needed (health or happiness) and the price of resources should be adjusted. Maybe the extraordinaryly high prices of strategic resources could also then become sensible. Otherwise a strategic resource would become priceless in comparison to a happiness or health resource. If it is possible to make the AI recognize which resources it needs, then this should surely be implemented. It would enable the AI to grow larger happy and healthy cities, thereby improving its economy(commerce and production). If it is impossible to make the AI recognize which resources it needs, then this should surely not be implemented.

What do you think?
 
I still see the AI build tons of siege weapons and not using them effectively.

But I already had Marines+tank+cavalry+Infantary owned by a stack of 23 Trebs(+ some longbows and 1 knight that only attacked to take the city) of the AI..They did that very competentely I would say.. :p

And other minor occasions as well..
 
How can I find out if the DLL is loaded or not when I'm in the game? I'm on a Mac now, not sure if this DLL will work or not....

Edit: found out elsewhere that it won't work, and that there's no SDK for the Mac civ4 yet (AFAIK)..
 
I will sometimes do this when it allows me to grow all my cities 1 size larger.
...
To make this work, the AI should recognize which resources are needed (health or happiness) and the price of resources should be adjusted.

Yes, this is exactly what I was trying to say. It's not useless if +1 health would enable better economies in all your cities, but that's not currently a selection criteria the AI seems to use.
 
I am quite liberal with my money. It's easy to get money back by lowering the science slider for a few turns, so if a good deal comes up, I have no problem emptying the vault to buy it. I suspect the AI will not deliberately generate money to have just in case, or even because he knows that a good tech will be on sale, or to upgrade units in a rush, or anything like that? And it probably won't lower the slider by one notch to get that extra gpt to buy a much needed resource either. Assuming I'm right, these are aspects of the AI that could definately do with improving (though probably not the easiest to get right either.)

Altering the warmongerrespect values will screw up AI decision making or not?
Some of the default iWarmongerRespect values are set to 0 anyway, so their algorithm must cater for 0 as a legitimate value. So no, it shouldn't screw up the algorithm. I suspect though that if they use that field at all in their new algorithms, then by setting all iWarmongerRespect values to 0, you might have an exaggerated effect than you originally intended. I'm just guessing here though.
 
Some of the default iWarmongerRespect values are set to 0 anyway, so their algorithm must cater for 0 as a legitimate value. So no, it shouldn't screw up the algorithm. I suspect though that if they use that field at all in their new algorithms, then by setting all iWarmongerRespect values to 0, you might have an exaggerated effect than you originally intended. I'm just guessing here though.

I think they don't because it's an attitude related setting not related to war directly but i hope Iustus will answer me :)
 
A topic perhaps to bear in mind - I don't know if the AI sees barbarians differently to any regular enemies, but is it feasible to stop them attacking Barbarian cities (accross my empire) when under attack themselves/ at war with another civ? I know taking obscure barbarian cities would be the last of my concerns when invaded..
 
Just played another game (Dec 12 build). "Builder" AIs are excessively easy to conquer. I repeat my call for some sort of panic mode where they build lots of units if they lose a city or believe they are about to.
 
Blake and Iustus.
Try checking the governor of the AI again. I played with the latest build and I discovered that sometimes the AI build things without any purpose. For example, He builds settlers in the industrial and modern era when the world is full and there isn't any place to settle. Also, the AI doesn't build the national and the world wonders in the most suitable cities. Just for example- he builds the Wall Street in a city that doesn't produce a serious amount of commerce, and the Oxford university in a bad science city.
 
Blake/Iustus, in case you don't have enough on your list, here's another.

City at the far end of my empire. Negotiations with Korea deteriorate before I can substantially fortify, and his UU comes up. Recipe for a sneak attack.

Anyway, he attacks. I bug out my war chariot, didn't think it worth losing in addition to the city.

Totally empty city. Wang bombards to knock down the defenses. In addition, he doesn't send in his troops after bombardment... they sit there. Check out the screen shot.

Wodan

ps Oh, and 12-09 build.
 

Attachments

  • dumb AI0000.JPG
    dumb AI0000.JPG
    214.3 KB · Views: 116
Follow up. I move in a half dozen war chariots to his most exposed city. It's almost as exposed as my city was.

Anyway, he leaves his stack sitting in the newly conquered city. I guess he's waiting for the riots to be supressed. Regardless, it would be a good idea to move out and go toward the "new" front, maybe leaving behind one unit for garrison.

Wodan
 

Attachments

  • more AI madness0000.JPG
    more AI madness0000.JPG
    250.6 KB · Views: 86
I just downloaded this mod, and I'm in the middle of my first game. I've just noticed a rather irritating bug, where it tells me about the transactions between AI, even if I haven't met them.

For example I've included a screen shot, you can see who I have met on the lower right hand side via score. However, on the upper left hand side you can see there is a list of transactions between AI that I have not yet met. I'm not sure if this has been reported before or not, but a quick run through of the thread revealed no results.

In any case, thanks for the mod I'm looking forward to finishing this game.
Civ4ScreenShot0000-1.jpg
 
Just started an easy game for religious domination fun. Large map, 18 civs Terra on Noble, 12-12 build. Normaly I play Monarch for challenge, but I just wanted to shoot for 100% religious spreading on this game, anyway... Everything seems fine except Wonders. The AI just doesn't build ancient wonders. I wasn't even going for them, just building them when there wasn't much else to do. And I built the Great Wall in 700 AD, and the Pyramids in 1170 AD. I know you said you toned down the Wonder production for the AI, but it seems it was toned down too much. So far the AI has only built 2 wonders University of Sankore and Sistine Chapel, and both of those from Great Engineers I think, everything else I've built, and rather lacksidazically. This just isn't right.
 
On that cultural victory strategy ... it pretty much kicked my ass today. I was sharing a medium-sized continent with Mansa Musa, and although he was a little under my curve, he started to develop tremendous culture in a few cities and basically started pushing me off the map. I'm used to him building spaceships! By the time I figured out what was going on, it was too late to do much about it, because I couldn't win a space race outright, and I didn't have time to wipe out his cities and then take it from there. Timbuktu hit legendary culture a little after 1950 and considering I couldn't get inside the 4-ring of at least two other cities, they couldn't be too far behind.

Pretty ... good ... I guess. Not so good for me. I suppose I have really have to take the peacemongers out if I can't box them in easily.

Other notes - in an earlier game, I got boxed into a valley without enough hills to produce anything except research. Unfortunately it was between Napoleon and Shaka and I was generally (involuntarily) at war with at least one of them, sometimes both. Napoleon eventually came at me with cavalry before I had it, at which point I gave up. But in the meanwhile, Shaka kept attacking me with stacks, some of which might have been big enough to take out a city, but he was attacking in the wrong order and/or without using the entire stack. I'd see four cats and four trebs in a stack, and only half of them would attack, and/or some of them would attack after most of the rest of the stack. I'm not sure what the deal is with that, but something is broken.

The AI seems to make very poor use of generals. Once every game or so an attached unit takes an unaccompanied suicide rush at me when it should be running for its nearest friendly stack instead. The AI does seem to build military academies, but it can't be doing the best that even a simple strategy would allow.

It's a tough AI. I don't claim to be a very good player but usually by about 1600 my games start to take a downward trend that didn't exist in Warlords before, and definitely didn't exist in vanilla. Unless you have a cultural victory going you can't just sit on your butt and build your way to a win.
 
Back
Top Bottom