Frogboy Frogboy

Why FE’s AI is good but not as good as GalCiv’s

Why FE’s AI is good but not as good as GalCiv’s

I’ve ready a lot of comments on Fallen Enchantress: Legendary Heroes AI.  I feel confident in saying that most people seem very satisfied with it overall. But I think most people would say it’s not quite as good as GalCiv II’s.

In some respects, the GalCiv series is an anomaly.   I’ve been programming AI on GalCiv games for 20 years.  Let’s put that on the table for a moment and consider the ramifications. Can anyone think of a game, any game in the history of game development, where the same individual programmed the AI for the same franchise for 20 years.  That’s why the AI in the GalCiv games is so good. I’ve had 20 years to digest people’s ideas.

Similarly, a couple weeks ago we released FE: Legendary Heroes 1.3.  As many have observed, the AI improvements in it are nothing short of spectacular.  But that’s not because I suddenly became a better programmer (I wish! <g>). It’s because I’ve had just that much more time to play the game, read the forums, watch “Let’s Play Videos”.

Probably the biggest advantage the LH has had in AI is that pretty much everyone has multicore setups.  I can’t promise this but I think LH may be the first truly native multicore AI that’s been developed (it certainly won’t be the last).  That is, every AI player gets its smarts spawned out to a different CPU core.  That’s why the turn times are much shorter than in most games even though the AI plays pretty well without having to cheat.

Why we don’t like cheating

I’ve gotten a lot of email from people asking why I don’t just have the AI “cheat” on the challenging and normal difficulties.  And I think there may be an age thing.  People of my age (around 40) really really hate cheating AI.  I think it hurts the game. I think it hurts the game because when I play a game, I want to feel like the AI is playing the same game as I do.

Even on the harder levels in Legendary Heroes, the AI doesn’t just conjure up units out of thin air. We just give them more gold or more HP and other things that players can understand and react to.  We don’t, for instance, spawn enemies out in the FOW (a very common trick on our industry). The AI has to have the resources, even on “ridiculous” to create those units. That matters because players want to be able to knock out iron mines and stables and know that this is going to impact the AI’s ability to create those units (same for wiping out shards and spell casting).

What’s next

I still think of Legendary Heroes as a new game.  New DLC is in the works, new updates (1.4 and 1.5) are in the works.  The success of the DLC allows me to pay developers to keep enhancing the game. 

So how do we make the AI better?

There’s just no substitute for time on this.  When people play the game and post, I read. And I conspire how to thwart their plans. Smile  Like many of you, I enjoy playing the game and thinking of ways to wreck it.  I’m a lucky guy that I get to spend time with you guys and brainstorm new strategies for the AI.  I do feel bad for the amazing experts who won’t get to see the expression on those new players who suddenly see the AI doing something clever.

But I think, you and I, together are doing something really fun for next-generation gamers who will realize that 4X games are, actually, pretty darn amazing.

 

Cheers!

202,759 views 51 replies
Reply #26 Top

Quoting abob101, reply 21
I think something definitely isn't right right with whatever priority calculations for summons are currently used. The AI *never* casts tactical spells going by the feedback in this thread:

https://forums.elementalgame.com/447685/page/1/#3393328[/quote]

Indeed no matter what I do the AI never summons anything in tactical combat. I create some kickass new summons that are free and it never uses them.

Reply #27 Top

Quoting smeagolheart, reply 25

Do ducks duck and bees be?

This pretty much says it all.

Reply #28 Top

Thanks for the "behind the scenes" explanation! I really enjoy reading all of the detailed posts about AI development/improvement.

Oh and thanks for a great game too!! ;)

Reply #29 Top

Notice he says Galciv's AI..not Galciv 2's..what is it ten years now and the AI was never written to use all the special racial techs and abilities.

Reply #30 Top

The AI is actually pretty bad in absolute terms

it needs massive cheats just to provide a challenge against a decent player

 

although it may be good in relative terms, since most 4X games have terrible AI

Reply #31 Top


I am pretty sure no terrain,less depth and no tactical combat is also a factor why GC had better A.I.

Reply #32 Top

1) Knowing where the AI well and truely cheats makes me feel a lot better. ^.^

2) Tactical summons are a bit on the just for fun side until you get Mantle of the Ocean, or one of the mage robes going. In the same or less mana you can shoot out a fireball or lightning to have a instant and greater affect on the battle. Strategic summon isn't so bad. You have a good chance being able to reuse a summons. The Air Elemental with 5+ air shard is very very nasty and unlikely to die ... ever. Meaning you can use keep reusing it and reusing it. It's very efficient.

 

Edit: One trick you may want to teach the AI. The crown a sovereign can start with means paying no maintenance on summons. Meaning there is no difference between a tactical and strategic summons. The Queen would make a very nasty summoner.

 

Reply #33 Top


Thanks for being open about things other game companies keep quiet about. I appreciate the info. :star:   IMHO you and your team have done a great job with Fallen Enchantress, I deeply respect people who know their work (also knowing that younger colleagues are also needed for their new perspectives and energy).

 

 

Reply #34 Top

My deepest respect for you, Derek (Frogboy)!

 

You have the only company i can think of, where i spend my money with a good feeling, because i know that you deserve it, that you will use it fair and that you will create greate stuff with it!

And you just proved me right once again.

In a time where nobody seems to have much interest in developing strong, non-cheating AI's. you really shine.

 

 

Reply #35 Top

Quoting Haydun, reply 34

My deepest respect for you, Derek (Frogboy)!

 

You have the only company i can think of, where i spend my money with a good feeling, because i know that you deserve it, that you will use it fair and that you will create greate stuff with it!

And you just proved me right once again.

In a time where nobody seems to have much interest in developing strong, non-cheating AI's. you really shine.

 

 

Nobody will take offense but Derek is Kael and Brad is Frogboy. 

Reply #36 Top

They sound like a superhero duo. :)

Reply #37 Top

Quoting LordTheRon, reply 35

 

Nobody will take offense but Derek is Kael and Brad is Frogboy. 

Are you sure about that?  Has anyone ever seen them together?  Isn't it interesting that anytime Derek is around, where's Brad?  Anytime Brad is around, where's Derek?  Hmmmm....

Reply #39 Top

Quoting puntarenas, reply 17
Supporting the ongoing development made me buy the "Bunny Slippers DLC" and although content wise your DLCs feel poor, just count me in for another round of weird crowd funding.

Well why not to make a "Wise AI" DLC?

People of my age (around 40) really really hate cheating AI.

Me also. But if AI cheats invisibly it's more or less all right. Instead of meeting an AI troops with excessive traits, where the cheat is obvious, meeting AI troops just of high levels of experience and in large numbers would be better. I even like to smash zounds of AI armies.

I think that problem in the main would be solved if there were:

1. More and more AI units.

2. AI would be aggressive  and amass attacks on human player.

In real life most wars decided in one major battle but in computer strategy this is boring. Make a cosistent massive flood of AI enemies, give us consistent WAR and I think most complaints will be forgotten.

Reply #40 Top

Large numbers of badly managed troops aren't a plus, that's just a grind.

Reply #42 Top

Quoting Primal_Savage, reply 41

I'm just baffled as to why the AI leaves lairs/monsters (and sometimes even treasures) untouched when it has the strength to obliterate them.

 

I believe this was an error in the code. When the lairs were only 1 square away the AI could not find a way to it and vice versa for the AI hero. I think it will be fixed in the next patch.

Reply #43 Top

Hi Brad, at first: Fallen Enchantress is a good game with a lot of new ideas. I hope this game will push the genre of 4X-fantasy-games! 3D, Editors for all contents, nice towns, all has levels and the very cool idea of unit-design are fantastic.

The elemental game series has editors for all kind of content. In my opinion it would be consistent, if you have an AI-editor like in Dragon Age ( http://dragonage.wikia.com/wiki/Tactics_(Origins) ) too. One human can never build a perfect AI - but the mass of players can do. Especially in fantasy games with tons of spells, units and weapons. I prefer behaviour trees as basis for AI ( @all: you can find a good and easy to understand introduction here http://www.altdevblogaday.com/2011/02/24/introduction-to-behavior-trees/ ). With this kind of AI it would be very easy to build and upgrade the AI - and this by the players too. What do you think? Which basis for AI do you use?

 

 

 

Reply #44 Top

Quoting webusver, reply 39
Well why not to make a "Wise AI" DLC?

The problems is that aren't we already paid for this game?

Paying for new content as DLC is OK in most cases, which you can selectively add to the original game.

Paying for thing should be there in the first place is wrong, it should distributed as patches.

Reply #45 Top

Quoting Primal_Savage, reply 41
I'm just baffled as to why the AI leaves lairs/monsters (and sometimes even treasures) untouched when it has the strength to obliterate them.

I don't mind it if AI leaves lairs alone...if the lair isn't bothering the AI's growth/strength....but if they need to kill off the monsters on the lair, they really should take the loot.

 

Reply #46 Top

There's a number of tricky things with regards to the lairs.

For example, the AI does tend to leave lairs because it gets XP from farming them.  But in 1.4, I've made it more aggressive about going after them since people assume the AI just doesn't know what it's doing rather than doing something that's actually pretty smart.

Reply #47 Top

Quoting Draginol, reply 46

There's a number of tricky things with regards to the lairs.

For example, the AI does tend to leave lairs because it gets XP from farming them.  But in 1.4, I've made it more aggressive about going after them since people assume the AI just doesn't know what it's doing rather than doing something that's actually pretty smart.

I haven't run the math, but I'm not sure that it's a net positive for the faction (as opposed to the hero who's getting the XP, who definitely benefits). Either:

- A primary hero/unit is doing the farming, in which case they're not ranging afield, taking out lairs there - therefore, there's an opportunity cost

- A secondary hero/unit is doing the farming, in which case the XP is going to a secondary hero - therefore, losing concentration of effort

Reply #48 Top

Quoting elmuneco235, reply 47


Quoting Draginol, reply 46
There's a number of tricky things with regards to the lairs.

For example, the AI does tend to leave lairs because it gets XP from farming them.  But in 1.4, I've made it more aggressive about going after them since people assume the AI just doesn't know what it's doing rather than doing something that's actually pretty smart.

I haven't run the math, but I'm not sure that it's a net positive for the faction (as opposed to the hero who's getting the XP, who definitely benefits). Either:

- A primary hero/unit is doing the farming, in which case they're not ranging afield, taking out lairs there - therefore, there's an opportunity cost

- A secondary hero/unit is doing the farming, in which case the XP is going to a secondary hero - therefore, losing concentration of effort

 

The bigger fundamental problem is that the current system rewards a solo superhero, or at best 2 heroes.  That said, I think most players take the lairs close to them out first, for good reason, and the AI doing it is a good thing.

 

If the AI doesn't farm the lairs, the player will.  I'll invade to farm a lair if it's tasty.  The hero is also missing out on loot which makes fighting monsters easier.  I prefer to fan out, make my territory safe, then go after the neutral lairs.  Also if you're exploring, you run into the chance of having something too tough to handle attack you, which sets you back.

 

Reply #50 Top

can AI learn?

not only unit design, but general strategies?

can LH automaticaly send you important decisions/strategies from all the players (anonimously) and you implement some of those intot he AI?