AI: Testing Difficulty Levels

Fallen Enchantress has several different levels of difficulty. The AI doesn’t “cheat” in the sense that it plays by a different set of rules. The difficulty rules have to do with what resources the players get.  At Normal, the AI is the same as the human player which is, arguably not fair to the AI (since humans tend to load saved games and have, one presumes, gotten familiar with quests, mob milling and other strategies. 

I tend to think “Challenging” is the fairest to the AI since all the AI really gets there is a little HP boost.

Anyway, today I’m testing out a series of 1 on 1 battles to see how easily I can cream the AI at different levels.  To make it fun for me, I usually try to minimize the number of turns it takes to crush it. 

My strategy:

Find a champion to join me, go monster hunting to raise level. Find AI and kill him.

Game 17: Normal AI 1 on 1, small map.

It is, admittedly, hard for the AI to deal with rushes. Not to mention, it’s hard strategically to decide when to attack an enemy city versus defending one of your own.  Each play through I end up adding new parameters to the various AI functions to have it spit out, I hope, more intelligent responses.

Game 17 is the result of many many hours of this kind of iteration.  I typically beat the AI within 50 turns (depending on starting locations – the AI had graduated to random maps at this point).

Result:

Victory in 36 turns.

(2 hours of coding later)

Game 18: Normal AI…

image

This one took a lot longer to win because the AI managed to snag two champions early and bottled me up. So I had to build up more first.

It did still expose some dumb AI decision making in the sense that it over defended it city area at the cost of expanding its empire.

image

So this would be the first real test of the tactical combat improvements.

So my strategy here was to stand back and cast haste on my units. Have my archers weaken them and then mop up.

Relias wasn’t in this battle (the enemy sovereign) which would be his doom. Without any champions in the city, it was easy. After that, whack.

In Fallen Enchantress, there aren’t many champions (I had none, just my sovereign in that game). But let me show you how powerful they are:

My sovereign is an army unto himself.

 

More coding…

(game 19 aborted)

Game 20: Normal AI

image

This game I got a particularly good spot.  4 grain, 4 materials. That’s really hitting the jackpot (a normal good city would be like 3 grain, 2 materials).

Victory in 65 turns.

…Iteration

(it’s a real challenge to tell the AI when it should expand and when it should hunker down without it requiring tons of work and CPU time).

Game 21: Normal AI

image

Not quite as nice as my last game but still decent.

The problem, once again, is that it is very difficult for a 1 on 1 contest to end any other way when I’m intentionally mounting up for an attack.

However, the thing is, the game design should be such that it’s relatively easy, early on, to keep players from just doing this.

I think one problem is my use of an early game weapon enchantment (burning blade) that simply grants a numerical bonus to attack rather than a %.

On the other hand, what’s stopping the AI from using it?

coding coding coding…

Really REALLY need put some time into having the Spell data hooked up to the AI better. They’re all set at 5.

Game 24: Normal AI

image

Victory in 70 turns.

Strategic spell coding…

25 aborted…

Game 26: Normal AI

image

In this game, it took me 40 turns before I found the other player.

Victory in 46 turns. I think there’s a bug with faction prestige for AI players.

Coding…

Game 27: Normal AI

Win after 90 turns

AI still casting stupid strategic spells.

Sigh.

coding

Game 28: Normal AI

image

Not a bad starting location except I’m right next to Wildlands.

Getting better.

Took 30 turns to find AI. AI had 2 cities and was effectively using them against me when I did my sneak attack.

Took 100 turns to win.

Fixed some bugs in the way spells are evaluated and distances evaluated.

 

[To be ccontinued…8:30pm]

Game 29: Normal AI

image

Up against a mountain. But good resources.

This time, when I encounter Altar, very early on, they’re slightly ahead of me (power rating 6 to 5).

image

This time, they can’t be just knocked over.

My concern now is that rushed for Civics to get Rush build and they spent their money.

I can’t take them though. So no riding rough shod this time. The question is, will they be able to expand faster than me?

The other thing the AI is struggling with is how much to be worried about monsters. On the one hand, you don’t want the monsters to take out the AI players enmasse but on the other, you need the AI to take some risk.

image

This time, my attempt to rush them has cost me the lead. Altar (AI) has taken an early lead.

And worse, my champion died in battle (they can die, it’s just extremely rare).

image

GRRR!

Monsters took out one of my towns.

 

Dangerous borders

image

OK. This isn’t good for me.  I’ve never seen this before. I normally kill the AI before he gets horses.

My capital just got taken by monsters.

Getting placed near wildlands means more goodies but you gotta defend them better too. I didn’t.

This just get worse..

image

Son of a bitch…

image

And so where my capital is they sent in pioneers to take it.

I’ll take it back.

And I did.

Barely.

Relias (AI) vs. Me.

1 on 1.

Tactical.

image

I win.

He hasn’t picked up as many good weapons as I have.

And he hasn’t shopped enough.

So he’s definitely not anywhere near perfect.

But right now…he is winning.

[10:50 PM]…

[Reminder: all tactical battles are on the same brown  map for now in my build]

image

And here…come the archers. Sad smile

So it’s just me (and pioneers) against his small army.

He never had a chance.  I’m Sauron!

Unfortunately the damn Shrill Lord took out the city I had captgured earlier.

City destroying Shrill Lord

 

I started another city there…

Shrill Lord got it again.

I’m gonna kill that thing!

Quickie video of how powerful my sovereign is (too powerful?)

Sovereign vs. archer army

My opinion here is that my sovereign has too much HP. I like that he can mow down units, but it’s kind of crazy that he has over 120 HP (compared to just a few for others). Should probably be about half that with the player packing health potions and such.

[12:00am] TO be continued…

So there are 5 cities in the world at this point. I have 2, the AI has 3.

The problems with the AI that are affecting its play in this particular game include:

(1) Its researching isn’t very good. This is a known issue that is due to the AITraits not being hooked up yet. This means its armies aren’t as big as they could be.

(2) AI is too timid to send a major force around my strong point (I don’t have a choke hold) to attack my vulnerable rear city (I have a weak city and a strong city but the strong city is relatively close to their capital and they’re not sending units to attack the weak city because that would leave the capital city potentially vulnerable – but not really, they have a lot bigger army than I do).

 

image

I probably shouldn’t quibble too much since it’s not looking very good for me.  The issue here is that players don’t usually have the opportunity to build up overwhelming force like this.  If the monsters hadn’t taken out my capital, I’d not have let them get this far.

..

OK, I’m completely surrounded with only 1 town. It’s a bit of a stalemate because my sovereign is just so powerful.

OK, the AI finally won. 

image

The AI is getting better but the monsters were as much the AI’s helper. You can see where we were neck and neck right until one of my cities got taken down by the Shrill Lord.  So really it wasn’t a 1 on 1 battle, it was AI + Shrill Lord vs. me.  Still, progress.

Now to spend the next couple of hours implementing fixes and additions to the AI based on what I saw.

Good night!

1:42 am, signing off.

49,892 views 55 replies
Reply #1 Top

Note about tactical battles: For debugging, I only have 1 tactical battle map.

Reply #2 Top

So lots of brown.

Reply #3 Top

Interesting stuff! The second vid is bugged, btw.

It's also important to make sure that rushing the nearest opponent doesn't give you as much benefit against the other remaining kingdoms as you would get if you just focused on building up your empire. In some Civ games, you should always capture the closest opponent's cities as fast as you can to get a definitive edge over everyone else. It's boring if that's the tactic you have to use every time.

Reply #4 Top

I'm aiming to make players pay for doing it.

Reply #5 Top

Not saying that it shouldn't be a strategy players can choose. But it needs to carry some serious risk.

Reply #6 Top

Glad to see champions can die.  I'd like to see a retire champion option that gives you a choice of retiring a champion, to gain their heir some turns laters, who would be lvl 1, but with benefits from their adventurer parent.

 

That said, I think one of the fundamental things with AI is the ability of humans to save and reload means humans will be more reckless.  They really do get an advantage against the AI in that sense.  I'm generally ok with optional AI players get benefits vs some AI monsters to compensate.  (at least in terms of luck).

 

Maybe give AI's the ability to replay battles a few times per game in player AI vs world AI battles?

Reply #7 Top


I don't like the hit point boost given to ai units, it just doesn't seem fair/realistic (I couldn't enjoy playing higher lvl difficulties at all in E:wom because of this), I would like to play on higher difficulties but want it to be that they have an extra node/gold mine/iron mine/ food resources/ lvl 2 techs starting off - something that makes 'since' in the game world rather than these goblins are 10' tall now instead of 4' (24 hit points instead of normall goblin health of 6)

Reply #8 Top

"AI still casting stupid strategic spells."

I thought there were no stupid spells in EFE.

Reply #9 Top

Thanks for the great journal!

Reply #10 Top

Awesome post. Much joy in reading, thanks Frogboy!

 

Reply #11 Top

Quoting Grizzyloins, reply 7

I don't like the hit point boost given to ai units, it just doesn't seem fair/realistic (I couldn't enjoy playing higher lvl difficulties at all in E:wom because of this), I would like to play on higher difficulties but want it to be that they have an extra node/gold mine/iron mine/ food resources/ lvl 2 techs starting off - something that makes 'since' in the game world rather than these goblins are 10' tall now instead of 4' (24 hit points instead of normall goblin health of 6)

 

I gotta agree here that I prefer more natural bonuses so silly hp bonuses.

 

Luck vs the environment would be the best buff- players don't see it, and unlucky AIs are often too gimped to be fun to play against.

 

Reply #12 Top

I agree.  Luck versus the environment seems to be worth considering for the AI, to compensate for its inability to reload, with minimal interruption or noticeability to the player.

Reply #13 Top

I'm going to pay you guys the highest compliment I know.  That tactical battle looked just like Master of Magic.  Only better.

Reply #14 Top

 

What if the ai got an additional so many points to spend on traits/bonuses at the creation setup depending on difficulty lvl?  This way a hard or elit ai would recieve an additional 10 or 20 points to make the faction stronger off the start, allowing them to have additional 'defaulted' bonuses.  I would like the ability to spend points during creation to start with a library/gold mine/iron mine (like in E:wom)/magic node of choice/barracks/and so on.  This would add alot of options for specific strategies while allowing for the more difficult ai's to have the additional starting bonuses.  The 'Circle of Magi' Kingdom would be able to start with an additional node or three & a library, ensuring they're considered to be regarded as a powerfull Magic based Kingdom for instance or 'Tha Legion' could start off with the barracks, iron mine, food resources, 'Troy' could start with walls, militia, market, and so on pretty much like in E:wom but a few more options to allow for even greater diversity.

Reply #15 Top

I also much prefer more hidden bonuses like a resource boost to higher level AIs over a hp advantage.

 

Reply #16 Top


Good stuff.

Reply #17 Top

Good feedback and ideas here. I'll nix the hp bonus and setithe effect.

Reply #18 Top

I agree that better starting locations and increased amount of perks per faction would be really nice AI difficulty modifiers. It would be nice if the premade factions had different versions for each difficulty, so that it's not a blanket bonus for all AI players, but rather that the difference between Normal and Challenging Altar AI is different than that of Normal and Challenging Kraxis AI. It would allow for more flavor for each faction.

"Oh you beat Altar at Insane? Well, have you tried against Kraxis at insane, it's a completely different game."

This would be fun thing to mod too; it would be fun to be able to create your own faction and make different setups for each difficulty.

Maybe this could go the other way too? If you take an easier difficulty than normal, you get to use the factions with more bonuses instead of the AI. Or maybe you want to play the game at custom difficulty, giving each player the most souped up versions of the factions.

 

PS. Not mentioned here yet, stuff like increased sight radius / no fog of war for AI are invisible cheats I wouldn't mind either. I don't really know how much increased sight actually helps the AI, though.

Reply #19 Top

The other thing you might consider as a disincentive to the save/reload is a "hardcore" mode; where saving is limited to exiting the game only.  Give a score bonus (or a resource or luck bonus, as discussed above) if you're playing in hardcore mode.

Reply #20 Top

Yes a hardcore mode would be a nice addition. Needs to be shielded against crashes though.

Reply #21 Top

Quoting Frogboy, reply 17
Good feedback and ideas here. I'll nix the hp bonus and setithe effect.

 

That's good because if/when you give the AI a bonus you want it to be as subtle as possible. HP point is right in your face because it so obviously different from what you have. OTOH things like small production bonuses or better starting locations people tend to dismiss as luck or attribute to the AI's superior playing since they can't see it directly. 

Reply #22 Top

On the harder difficulties I think the AI should have visibility to the entire map (or scale with the difficulty). This should help ensure optimum placing of new settlements and best strategic movement of armies. Basically what I'm striving for is the AI to exploit any player weaknesses (undefended or weakly defended settlements, overstretching of a supply line to allow flanking, etc). I remember EWOM games where all the AI had to do was exploit my weaknesses and it was game over - instead, they would send numerous small armies (instead of a big one) and also commit sovereign suicide. Frustrating.

If you can create an AI that acts really smart (by giving it all the information it needs and also subtle to the player) it would be much better than a stupid AI with a bunch of % modifier handicaps. I'm picturing normal difficulty on the same level as the player - fog of war, etc. Higher up you go, the "smarter" it gets strategically (by giving it more info to make decisions).

For tactical combat, unsure how to make the AI "smarter". Maybe the default is as smart as can be but lower levels you add some randomness of AI making less than ideal choices? For example, smart AI decides first option is to focus fire on archers or weak units. However, if on normal difficulty, randomness calc (maybe 50% chance of doing a lower priority action) tells a unit to do priority #2 or #3 which is to attack the heavily armored melee unit.

In short I could care less if the AI on hardest difficulty knows the optimal settlement locations, knows my weaknesses, etc. I want a "smart" challenge vs. a dumb "brute" challenge. Maybe the sweet spot is a mixture of the two. I got that feeling from GalCivII and would love to feel it FE.

Reply #23 Top

I don't think giving the AI traits would work very well. It would homogenize all the teams. Instead a blanket resource multiplier or starting bonus would work better.

Giving the AI a good starting location could work but you would still have to watch out that the bonus is not always the same, ie a gold mine. Giving them a extra random resource tile, or a boost to food could work.

A hidden combat multiplier or ability to redo/undo combat in PvE would also work very well I think.That way you wouldn't have to worry about them getting unlucky in combat versus monsters.

Quoting Sir_Linque, reply 18
"Oh you beat Altar at Insane? Well, have you tried against Kraxis at insane, it's a completely different game."

I agree but really this should be because factions play different period, even at low difficulties, not because of a artificial boost at high difficulties. 

 

Reply #24 Top

If it is possible to ramp up the difficulty just by letting the AI to see more of the map, that would be optimal.

I don't get how giving more traits to higher level AIs would make them more homogenous than giving a blanket resource bonus. A blanket resource bonus is identical to all the factions getting the same extra trait. If you would give each AI different extra traits depending on their faction, it would make them more diverse, not the other way around.

So I still think that if the factions have additional bonuses at tougher difficulty levels, I would like them to be different for each faction. It would be nice if you actually saw what the additional bonuses each faction gets at a higher difficulty level as well.

Reply #25 Top

Quoting Frogboy, reply 17
Good feedback and ideas here. I'll nix the hp bonus and setithe effect.

 

I don't think it should be nixed, but should be a seperate difficulty option, if the UI can handle it.  Or maybe AI should be a tab all its own in options

 

How I'd like to see difficulty, this is a new idea, but it's something that could be implemented in the beta without radical changes.

 

Difficulty level caps at the max AI (and add a use full resource AI like you had in GC2 so we can trade a slower game for a smarter AI)

 

Then, have various AI cheats which can be turned on or off, such as some of the things suggested here.  (hp bonus, AI can "re-roll" battles, and so on)

 

I think this would provide the most varied experience, so everyone could find what they want.  Balance around max AI and no cheats though.

 

On the game select: you'd select world difficulty, and individual AI difficulty, which would default to the difficulty set in options.  AI Cheats would only be set in options