Darxim Darxim

Specific AI Adjustments

Specific AI Adjustments

Everyone complains about the AI, but there's not a lot of suggestions on very specific things to change, so I wanted to throw some things out there, hopefully make a repository for these things.  I don't have much to start with, unfortunately.  I'm still playing on Normal level difficulty, too, so I don't know if some decisions the AI makes are because of the lower difficulty level, so I would like people to confirm that they've seen these behaviors as well on the higher difficulty levels.

Note: I'd much rather see bugs and UI issues fixed before these are addressed.  Still, some of them might be easy fixes.

 

Tactical Combat:

- Spiders will web someone who just got webbed. I just saw a spider web my archer, and another spider went right after, and webbed the same guy.  They should check their target to see if it's already webbed before committing.  This can be applied to any non-stackable conditions.

- It seems like spiders prefer to web archers when they should be webbing meleers (is that a word?). 

- I've confirmed that this is difficulty-based.  I'm  playing a game on Ridiculous, and the enemy goes after the lower health units.  Enemy units will not go after one of my lower-health units if there's any other unit next to them.  This makes it very easy to retreat a unit that's low on health because I only have to move it 1 or 2 tiles, which makes both the individual battles and the overall game much easier than it should be.

 

Yeah, I really didn't have much to start with.  I was more hoping to get contributions with the above items as examples.

37,547 views 39 replies
Reply #26 Top

Quoting MarvinKosh, reply 26
So you could define rules in the XML like, for example, if the city has significant unrest, put Bell Tower or Cleric at the head of the build queue.  There's less priority to have those lumber mills if half of production is being wasted.
End of MarvinKosh's quote

You could but the code would have to be interpreted in the game itself.  That's why I like the idea of having Python (or Lua) in there.

But you totally get what I'm getting at based on what you wrote.  We want the AI to do things like bild a bell tower at the head of the build queue if unrest is beyond a certain point.  But it would be a lot of work to get that into the XML. The easier thing would be to have it in C++ (hard code it) where IF unrest is > X THEN look at improvements tagged as Unrest Reducers.  

But that sort of code hurts serious modding.

Reply #27 Top

I think you're right in that ultimately scripting (python etc) is the way to go.

 

I do love what you've been able to do with XML though.

Reply #28 Top

AI does build lumber yards though. 

End of quote

OK no prob.... strange I don't get how it is deciding to do this, but ok.  Will keep an eye out for them next game ;-)


Reply #29 Top

I don't know if I'm an "expert" player, but I can win comfortably on ridiculous.  



The AI overall seems much more improved on a strategic level in 1.20   I've seen the AI launch invasions from multiple points with well-balanced forces.  


The AI does still need some work in target prioritization- for example, in my most recent game I used a custom Trog faction, where my five major kill stacks were each comprised of a few warg-mounted ranged units, a damage sponge champ, and several juggernauts.  In roughly 90% of  tactical battles, the AI insisted on using its archers to fire at my warg-riding units, ignoring the juggernauts.  I think I understand why it did this- generally it's a valid strategy to have your ranged units kill the enemy's ranged units at the start of the battle so that you can freely shoot at any melee troops.  The issue here though was that my warg units had superior health, defense and dodge compared with the jugs- in the few battles where the AI did decide to focus-fire on a juggernaut instead, I usually lost a unit.  In all other battles, I only took a little damage which my stacks could quickly heal off.  


Another serious concern for the strategic AI is that it is frequently the victim of the terrible diplomacy AI.  I believe that the AI usually declares war without having first devised any sort of battle plan or strategic objectives, basing its declarations only relative power ratios.  This leads to AI declaring wars on multiple neighbors, over-extending itself, declaring wars it is not prepared to fight and crippling its expansion.  Often the AI are able to rapidly expand up to 7-9 cities on a standard or large map, keeping pace or surpassing the player, but then they stagnate as they fall into mindless, endless wars with each other (and eventually, inevitably the player).  

Reply #30 Top

Quoting Frogboy, reply 7
IF I could ignore modders and hard code things, I coudl make things a lot more lethal.  I'm starting to come around to the idea of hard coding more strategies since I don't foresee any total conversions happening.
End of Frogboy's quote

Could someone translate this in to English for me?

Is he saying that modders could code AI behavior for Tactical maps?

Thx.

S_S 

Reply #31 Top

Quoting Frogboy, reply 26

You could but the code would have to be interpreted in the game itself.  That's why I like the idea of having Python (or Lua) in there.

But you totally get what I'm getting at based on what you wrote.  We want the AI to do things like bild a bell tower at the head of the build queue if unrest is beyond a certain point.  But it would be a lot of work to get that into the XML. The easier thing would be to have it in C++ (hard code it) where IF unrest is > X THEN look at improvements tagged as Unrest Reducers.  

But that sort of code hurts serious modding.
End of Frogboy's quote

Okay, point well taken.  Guess I'll be trying to learn Python then. :)

Actually one of my favourite mods for Civ 4 was Better AI.  It's been a while since I played but I vaguely recall that there was an SDK for Civ 4 which allowed you to write a DLL that Civ 4 would use.  Anyway, probably a bit beyond your average modder, but I remember reading that there are pros and cons for using Python and C++ in mods.

Reply #32 Top


In my experience it's the tactical AI that really cripples computer players - I was walking around with a pet Ophidian last night and it's ridiculous the number of spells targetting him.. there seems to be no consideration of resistances, high dodge, etc, when picking targets.

 

Reply #33 Top

I agree that the AI NEEDS to look at if the target for spells/abilities are imune or resistant, then do NOT use spell/ability, example if this is a tac battle I had earlier today in my levino machine (w7x86 4gb intel integrated video) where I had put boosts/defensive spells on my units against a obsidian golem, my side was a sword hero, and a mirror elemental with my sov that was armed with a crude bow and attack boosting accessories (each arrow was getting between 4 & 12 damage on the golem, and after getting the golem down to half health(and still having 120 mana left) I used the play the battle out button and the DUMB idiotic AI kept casting firedart & fireball against the obsidian golem (that is IMMUNE  to magic) wasting all 120 mana THEN started using the bow.

harpo

 

Reply #34 Top

Some tactical suggestions

 

a) AI should try to kill high-powered units , then heroes, then militia in priority as a general rule (with exceptions)

 

b) archers should aim for unarmored targets, mages for armored targets

 

c) A high def mage with thunderstrike should use thunderstrike as an area attack, especially if they have counterattacks.

 

 

Reply #35 Top

Quoting abob101, reply 28
AI does build lumber yards though.

OK no prob.... strange I don't get how it is deciding to do this, but ok.  Will keep an eye out for them next game
End of abob101's quote

I think the problem is the AI might be ruining its own forests BEFORE knowing to place a lumber yard.
I think frog might consider buildings with similar contraints with a higher priority, so the AI doesn't ruin they're own cities from building something upon the forest before the lumberyard.
Either that or do as I always wanted, don't make the forest dissapear entirely after the first building, meaby even have special forest-type graphics for each building.

Sincerely
~ Kongdej

Reply #36 Top

With a game as complicated as this one, I imagine that the AI is a huge undertaking.  That's why I was looking for things like small logic checks like the ones I suggested.  You know, not debuffing something that already has that debuff.  Prioritizing an ability based on the available targets' ranged capabilities.  Picking targets that have low health (but are within range) versus targets that are simply closer.  That kind of thing.  I wanted to avoid the more vague kind of suggestions that I'm usually seeing.  I think that a few small changes here and there can go a long way.  

I really appreciate Frogboy's posts.  He takes time to actually come into the forums and address people's concerns, and he often does so by getting into specifics, even throwing up code into his posts and saying "This is what it looks like. Here's why this change wouldn't be simple."  Most other companies just have some guy who goes through and posts vague comments like "We're looking into that." or "We appreciate your feedback and will take it under consideration." like an autonomous bot.  Here, it not only feels like our comments are heard, but we know they are because of how they're being responded to.

Reply #37 Top

Yes agreed Darkim, good post.

One thing I noticed recently with regard to tactical, if you take your noob sov and a couple of meathshields like militia into combat with say a couple of wolves or other melee units.... the wolves will run up and attack your militia most times even if they could reach your Sov instead. 

If a human was controlling the wolves, I suspect a better tactic is to run up and take out the soft sov (assumng it's a newb sov with like no armor and level 1)... because a couple of wolves can kill the sov in 1 turn preventing him from casting spells and zapping them.

This is similar to the point you guys make about picking a target that is low health.  It's almost like there needs to be a bit of a check for each unit when choosing targets to say, ok... is there a unit within range that repesents a threat that I have a good chance of killing this turn... if so make that target a priority.  The best targets would be those that have the potential to cause a lot of damage (mages) that don't have high defence/hitpoints.  Ideally this would also look at the next couple of units in the initative order.... so if there is 2 wolves that are going to get to act before squishy mage... and if they're combined attack might be enough to kill him before he will get his next turn.... then go get the mage before he casts a nast spell to turn them into wolf meat.

Sorry i thought I was going to state something very specific when I started that example but it ended up being a bit vague again, doh.

 

Reply #38 Top

Hmm, I usually always space my troops out so there's a big zone of control in front of my sov.  I don't know if killing units that are creating a zone of control is part of the tactical AI.

Reply #39 Top

I wonder how many of the AI issues are perception problems.  It seems like, the lower the difficulty setting, the dumber the mistakes the AI makes.  I know it's programmed that way, but when people are playing on the lower difficulties, they'll pretty much just see it as a dumb and flawed AI.  For instance, I just started my first game on Ridiculous difficulty last night, and I noticed that the AI was going after my lower health units after they moved away, rather than sticking with nearby units like it does on lower difficulty.  You'll noticed I've crossed that item off my list (which was already a short list as it was).  

What I'm taking away from my new game so far is: The ability of the AI to make rational decisions is inversely proportional to the difficulty level.  Basically, the AI gets easier by getting dumber.  So even on Expert, you might still see the computer make a move that makes you say "Now that's just stupid."