AIs and the Art of War

I think all animals shuld be able to cross border but not to attack cities.

Wild animals avoid big people stacks like villages or towns but it dosent mean that the do not cross inhabitaed border area at all.

This change will make animals more dangerous and give new depth to early gameplay. SO please do this tag.

The plan is to make some animals capable but also perhaps even incapable of attacking at all due to their nature. Sure, defend but intrude harmlessly otherwise. Dangerous animals would be able to earn a promotion that would allow them to cross into borders.

The programming for the breach of borders ability is in place so its a matter of developing more meaningful animal AI and getting the animal combat classes assigned out properly so the promos that enable this sort of breaching may be properly enabled to only the animal types we want to be capable of this.
 
The plan is to make some animals capable but also perhaps even incapable of attacking at all due to their nature. Sure, defend but intrude harmlessly otherwise. Dangerous animals would be able to earn a promotion that would allow them to cross into borders.

The programming for the breach of borders ability is in place so its a matter of developing more meaningful animal AI and getting the animal combat classes assigned out properly so the promos that enable this sort of breaching may be properly enabled to only the animal types we want to be capable of this.

Will also require us to modify the safety seeking AI, especially of hunters, which currently assumes that ducking back inside borders is an iron clad defense against animals.
 
Will also require us to modify the safety seeking AI, especially of hunters, which currently assumes that ducking back inside borders is an iron clad defense against animals.

I like those words: "Ducking back inside."
 
Will also require us to modify the safety seeking AI, especially of hunters, which currently assumes that ducking back inside borders is an iron clad defense against animals.

I believe when I made those tags you had me remove any consideration of animals being ignorable if you're within borders IF the visibly threatening animal had this 'quality'. I would be willing to wager that what I did to make this happen would be inherited by whatever unit AI features would make such an assumption unless said assumption did not somehow call to whether the potential threat was actually an animal or not.

In summary, I believe you made sure that I took care of this consideration already.
 
In my current game with latest SVN I noticed that AIs do not build dogs, even after discovering agriculture . My rogues are free to wander around enemy territory, kill wounded units or working gatherers(they are almost always unprotected), pillage improvements and receive free money and experience in process(Should camo units receive experience from pillaging at all? It's too easy). Even after I pillage AI improvements and kill its workers for couple of hundreds turns it does not counteract such hostility in any way. Done that many times to many different AI civs and never got caught. And while I have seen enemy rogues now and then after canine domestication they never destroyed my improvements or killed my units before I was able to see them.

Also in the beginning of the game I always able to to build spiked clubmen way before the AI players do(on immortal difficulty so it should be able to beat me at that race). So, while AI cities are safe thanks to tribal guardian, improvements are at my mercy. STR3 vs STR2 is huge and all that AI can do is hide behind guardian while its precious improvement are destroyed.

I think AI should prioritize defense of improvements by researching spiked clubmen early and by building their own guarding rogues and dogs later(at least when it was already attacked by camo units before).

Is that known issue? Does it happens in every game or I was just lucky? I think about playing with some house rules now, maybe no pillaging before AI gets spiked clubmen and no hostile rogue actions at all if it is really that bad.

Oh, and by the way AI is very lazy at rebuilding destroyed improvements. That's for the best, I would destroy them anyway, but I doubt that AI foresee it. Maybe it simply does not recognize that there is need for improvement building after it already build them one time.
 
In my current game with latest SVN I noticed that AIs do not build dogs, even after discovering agriculture . My rogues are free to wander around enemy territory, kill wounded units or working gatherers(they are almost always unprotected), pillage improvements and receive free money and experience in process(Should camo units receive experience from pillaging at all? It's too easy). Even after I pillage AI improvements and kill its workers for couple of hundreds turns it does not counteract such hostility in any way. Done that many times to many different AI civs and never got caught. And while I have seen enemy rogues now and then after canine domestication they never destroyed my improvements or killed my units before I was able to see them.

Also in the beginning of the game I always able to to build spiked clubmen way before the AI players do(on immortal difficulty so it should be able to beat me at that race). So, while AI cities are safe thanks to tribal guardian, improvements are at my mercy. STR3 vs STR2 is huge and all that AI can do is hide behind guardian while its precious improvement are destroyed.

I think AI should prioritize defense of improvements by researching spiked clubmen early and by building their own guarding rogues and dogs later(at least when it was already attacked by camo units before).

Is that known issue? Does it happens in every game or I was just lucky? I think about playing with some house rules now, maybe no pillaging before AI gets spiked clubmen and no hostile rogue actions at all if it is really that bad.

Oh, and by the way AI is very lazy at rebuilding destroyed improvements. That's for the best, I would destroy them anyway, but I doubt that AI foresee it. Maybe it simply does not recognize that there is need for improvement building after it already build them one time.

You're right that unknown attacks don't cause the AI to suspect invisible units per se (and build explicitly to counteract them), but they DO cause the AI's sense of it being a 'dangerous area' to rise, which (after a few such incidents) should cause it to escort its workers nearby.

I agree that it's probably a fertile area for improvement to explicitly associate attacks where it cannot see the cause with the need for see-invis units.

The spiked clubmen thing is harder to diagnose - if you have logging on and retain the BBAI logs you can see the tech paths followed, and to some extent why. There are probably good reasons the AI tends to value certain other paths more, and also I think something fairly easy that can be done about it.

Specifically the perceived value of a tech is a weighted sum of values of the things it enables (including downstream techs recursively, amortized by path length). The contibutors to those sums are unit values for enabled uni types, building values, civic values, ... This summing (weighted or otherwise) inherently requires the evaluation functions for different entity types (units and buildings say) to be comparable (that is to say a good building must outweigh a mediocre unit, so they cannot have totally independent scales). This is actually quite tricky to do, and the routines that are used in this way try to normalize to what they consider an equivalent gold value (which also makes them usable in trade negotiations) as a sort of 'common currency'. This establishment of a sort of gold standard precludes the valuations varying according to strategic context, so a unit strength increase of 2 to 3 is seen as an increase of 1, not a multiplier of 50%. Hence spiked clubmen probably don't look any better than (say) a lumber camp.

I think there are a couple of ways this could be addressed:
  1. Apply a contextual modifier to the sum weights based on the ratio to 'best in entity category' currently available. Thus the sub-calculation for buildings and units would be (new best building value)/(best current building value)*<enabled building value> + (new best unit value)/(existign best unit value)*<enabled unit value>
  2. Add strategic context values to the entity class weights. Currently there is a crude weighting for raw gold and raw research which pushes the value of more gold down (relative to reserach) as your treasury gets more healthy - this could be extended to other entity classes (like units), so for example if you see a neighbour with more powerful units types than you, then you increase the weight on units
 
Looks like excellent ideas.

Considering rogues - maybe AI should always give bigger priority for building dogs, not only when it was already attacked by camo, but, uhm, just in case. I am trying to garrison every city with one dog unit, maybe it is not so bad thought for AI too?

By the way, how good is AI with great commanders? Great commanders receive experience very fast even with dynamic xp(dynamic xp does not affect them at all, am I right?) and become powerful very quickly. When this option is enabled does it give too big disadvantage to AI?
 
Looks like excellent ideas.

Considering rogues - maybe AI should always give bigger priority for building dogs, not only when it was already attacked by camo, but, uhm, just in case. I am trying to garrison every city with one dog unit, maybe it is not so bad thought for AI too?

By the way, how good is AI with great commanders? Great commanders receive experience very fast even with dynamic xp(dynamic xp does not affect them at all, am I right?) and become powerful very quickly. When this option is enabled does it give too big disadvantage to AI?

Better than it was in AND. Not as good as it could be.

Specifically it will:
  • When not engaged in a strategic war, try to level its GGs up by stacking them with a hunter and a military escort to ty to exp up off animals
  • When building city attack stacks will attempt proactively to pull in a GG.
 
Considering rogues - maybe AI should always give bigger priority for building dogs, not only when it was already attacked by camo, but, uhm, just in case. I am trying to garrison every city with one dog unit, maybe it is not so bad thought for AI too?

Thiefs, Rogues, are very important at least the way "I" play, i promote them as fast as i can then when the "Great Assassin" is available, well to me its the best unit in C2C, up until the Sniper. Assassin's str 8 might fool you, when promoted "correctly" it can take out a str 26 with no problem.:eek::p
 
Better than it was in AND. Not as good as it could be.

Specifically it will:
  • When not engaged in a strategic war, try to level its GGs up by stacking them with a hunter and a military escort to ty to exp up off animals
  • When building city attack stacks will attempt proactively to pull in a GG.

I switched to computer players to see how experienced their commanders are. They are level 3 in average while my commander is level 7. I suggest that commanders should get xp slower, at least when 'dynamic xp' option is on. Or maybe even scale commander xp with difficulty level.

That way player will be given less advantage over AI
 
Thiefs, Rogues, are very important at least the way "I" play, i promote them as fast as i can then when the "Great Assassin" is available, well to me its the best unit in C2C, up until the Sniper. Assassin's str 8 might fool you, when promoted "correctly" it can take out a str 26 with no problem.:eek::p


Yes, they are important. That's why AI should try to build units that can see them more often.
 
Turns out there is even no need to build spiked clubmen to destroy AI improvements. I start on immortal and with clubman available from the first turn able to destroy neighboring AIs improvs. Only defense they have around cities is throwers and of course they do not risk to fight. I suppose AIs start with wanderer instead of clubman. May be add clubman to their starting units?
 
I play with Version 6085 and i note, that the AI only settle on its own continent... The AI not settle on other continents or isles.
The AI have wars with other AI, but do not invade them... although they have the opportunity. I have reached the industrial era, the best AIs are in the Renessaince. They can buld ships, which can travel over oceans, but no Settler is seen...
At war, i have only seen Logan destroying greek Ships, but no transports with invasion troops was coming (although he have Transports).

I have upload a savegame:
https://rapidshare.com/files/3160102813/Ollo.7z
 
I also noticed the lack of Island settling.

About naval invasions: I find that the AI in my current game aggresively uses the navy to raid my fishing boats and hunt down my troop transports. Haven´t seen a naval invasion yet, but then again my enemy lacks the troops for that anyway.

But I noticed a tendency for them to declare pointless wars. The AIs in my game have a lot of wars with people they can´t reach at all, because neutral nations are in the way without letting them pass. And since noone got ships that can move on ocean tiles there is no way to get around by see.
Even worse, due to some naval scouts coming into each others sight range on some point where the continents are close and contact trading most civs got diplomatic relations with people on the other continent. But you can´t reach them without crossing ocean. Declaring war to them is about as effective as us declaring war on..Sirius ( assuming someone lived there). But the AI does it
 
But I noticed a tendency for them to declare pointless wars. The AIs in my game have a lot of wars with people they can´t reach at all, because neutral nations are in the way without letting them pass. And since noone got ships that can move on ocean tiles there is no way to get around by see.
Even worse, due to some naval scouts coming into each others sight range on some point where the continents are close and contact trading most civs got diplomatic relations with people on the other continent. But you can´t reach them without crossing ocean. Declaring war to them is about as effective as us declaring war on..Sirius ( assuming someone lived there). But the AI does it

'Pointless' wars are also 'safe' ones! I think these are inherited from Civ4/BTS, because diplomacy is still a rather 'blunt instrument'. If you declare war whenever you are asked, perhaps you really can maintain a positive relationship with close rivals (until stabbing time, of course).

I don't know why civs always beg you (and each other) to declare war. Rather than phony war with no contact, why don't they just beg you to stop trading with their enemy? After all, that's all you're doing in practice anyway.

As to whether it is 'realistic', we have the term today 'sabre-rattling', describing the state of threatening war without anyone actually attacking. I think this is what the in-game phony wars represent, and it certainly happened even back to ancient times (and likely earlier still). In the modern era we have 'the Cold War', embargos and 'sanctions'. Trade embargos also go way back, and can be quite warlike ie. depriving a civ of 'basic' supplies is not far from besieging it. There is also a historicity about 'trade wars' ie. using tariffs and subsidies, often prohibitive ones.
 
'Pointless' wars are also 'safe' ones! I think these are inherited from Civ4/BTS, because diplomacy is still a rather 'blunt instrument'. If you declare war whenever you are asked, perhaps you really can maintain a positive relationship with close rivals (until stabbing time, of course).

I don't know why civs always beg you (and each other) to declare war. Rather than phony war with no contact, why don't they just beg you to stop trading with their enemy? After all, that's all you're doing in practice anyway.

As to whether it is 'realistic', we have the term today 'sabre-rattling', describing the state of threatening war without anyone actually attacking. I think this is what the in-game phony wars represent, and it certainly happened even back to ancient times (and likely earlier still). In the modern era we have 'the Cold War', embargos and 'sanctions'. Trade embargos also go way back, and can be quite warlike ie. depriving a civ of 'basic' supplies is not far from besieging it. There is also a historicity about 'trade wars' ie. using tariffs and subsidies, often prohibitive ones.

It's an AI weakness. It often means they fall behind because they are not taking advantage of trading opportunities they should, due to ill-advised pseudo-wars. I intend to do something about it when I get round to it, but I don't know when that will be.
 
I did a bit of debugging to see if I could see any obvious reason why the AI was never generating attacks from overseas. I found a clear bug, that basically prevented the AI from finding any targets for its troop transports (so they just sat in their home ports, fully laden with expectant troops!). I will be pushing a fix for this later today.

It won't magically make the AI a brilliant overseas war strategist, but it should see it start to make the attempt again. Let me know any impact you see in your games...
 
Great to hear about this, Koshling! Now my starting as Japan will be even harder on deity :)))

Something completely different: The AIs gatherers don't go away if you get close to them, it seems they continue working on the improvement and don't realize an enemy just stepped besides them. Playing with "start as minors" could it be they don't realize I am dangerous for them as I never declared war or why don't they flee to secure plots (back into town or into the wild - o even better - getting cover by troops, if possible))
 
Great to hear about this, Koshling! Now my starting as Japan will be even harder on deity :)))

Something completely different: The AIs gatherers don't go away if you get close to them, it seems they continue working on the improvement and don't realize an enemy just stepped besides them. Playing with "start as minors" could it be they don't realize I am dangerous for them as I never declared war or why don't they flee to secure plots (back into town or into the wild - o even better - getting cover by troops, if possible))

Sounds like a bug to me - can you post me a save where this pattern happens please.

Edit - BTW - the naval fix is unlikely to make Japan/England on GEM much different. Independently of this the AI doesn't generally (currently) launch attacks to enemies across the sea if it is at war with someone on the same landmass. Given how big Eurasia is on GEM the chances of an AI not being at war with SOMEONE else on the same landmass is pretty small I suspect.
 
I did a bit of debugging to see if I could see any obvious reason why the AI was never generating attacks from overseas. I found a clear bug, that basically prevented the AI from finding any targets for its troop transports (so they just sat in their home ports, fully laden with expectant troops!). I will be pushing a fix for this later today.

It won't magically make the AI a brilliant overseas war strategist, but it should see it start to make the attempt again. Let me know any impact you see in your games...

Unfortunately, waking up this dormant AI makes things run a lot slower. I'm trying to do some basic optimization before I push anything, but there is certainly going to be some degradation in performance, since it basically wasn't considering large parts of its navy before!
 
Top Bottom