Frogboy Frogboy

It is time for your destruction to begin

It is time for your destruction to begin

T_Pandemonium_PaintingWe have promised, many times, that Fallen Enchantress will be so bad that it’ll give you some sort of disease.

It is now time to pay up.

For today, the tactical battle AI begins its development.  And my job is to kill you. Thousands and thousands of times.  Meanwhile, you’ll be trying to kill the AI in tactical battle with your various tricks. They will avail you to naught. You humans and your armies will be destroyed. Your kingdoms crushed. There will be much farting in general directions.

For the past several months, I’ve been asking my diabolical cohort Charles to write me tons of little functions that I could eventually use to build up the tactical AI.  While I worked on the main game and the strategic AI, Charles did put together a decent tactical AI with what he had. 

Unlike the strategic map where the AI can’t see all, the tactical map AI has no such problem. All units can see each other.  The odds are even.  There’s no reloading your game in the middle of a battle. It’s just you and the AI.

So for the next couple of months, we’re going to get to know each other.  You will beat the AI a lot at first. And hopefully, you’ll share your secrets. From those secrets I will ask for new APIs and new XML that will help.  I still have a lot of data requests (I don’t know how many turns have taken place in a given battle so I have no concept of whether we just started the battle or are nearing its end, I don’t yet have access to what spells are good and what spells aren’t – but I will soon).

I will have to solve the AI’s terrible use of mana strategically so that it has mana left over to do horrible…horrible things to you guys.  I will also probably ask for a lot of new tactical spells that the AI is more inclined to use effectively (I got a few cool new strategic spell requests that are being put in that are…simply ridiculously evil).

So to start this conversation, let’s look at some of the things the AI needs to think about:

  1. What is the balance of power in ranged units?
  2. Should I attack the closest unit or bypass that unit to go after a more vulnerable unit
  3. How important is vulnerablity? No point casting a fire dart at a fire elemental but should I spend a day coding about blunt weapons versus cutting weapons? (remember: time is a finite resource, I don’t get a year to write this, just N engineering hours).
  4. Should I cast a spell? Right now, the AI wastes magic when it shouldn’t (because it rolls the dice rather than calculating it).  No point in using burning hands if I can kill you with a sword almost as well.

This is going to take awhile and it won’t be in the first BETA 2 build.  Or if it is, it won’t be much better than what is currently there.  But together, we should be able to come up with something pretty lethal.

205,700 views 91 replies
Reply #26 Top

It would be cool if the AI could feint... For example make an obvious rush for one unit and then halfway there turn around and target something else. Just knowing that the AI could do that would mess with the mind of the human player for sure.

Reply #27 Top


Brad - for the first time in EWOM or FE I lost a game last night to your ridiculous strategic AI (and proud to admit it!) Was playing Verga and straight up got mobbed by stacks and stacks of Magnar archers. That is progress! Not sure if the stars aligned but felt good about losing a game - for real.

Looking forward to seeing what you got. :cylon:

Reply #28 Top

Quoting seanw3, reply 21
Actually you can block flanking. Just put your units on every other tile in a line. Probably the lack of tactical AI and OP of heroes has obscured the limited ZoC, but it is also tiresome to read suggestions based in incomplete data.
End of seanw3's quote

Sorry for tiring your eyes :P

I guess it would help in terms of my later suggestion of a similar mechanic, but even so I still believe for some sort of flanking based AI routines and unit bypassing to be *fun* and smart the game would need some sort of pre-battle formations, as well as a lot of tweaking in terms of movement ranges, battle layouts and the like.  Plus a lot in the realm of balancing effectiveness of armor costs/usefulness vs just going DPS.  All of which seems like a lot of change and is probably would be great in the end, but not right this minute.

The point still being if the AI is going to try to bypass my units, I would want it to be fleshed out lots, or its not fun right now.  If the countering mechanic is annoying to set up (rearranging all my units every battle and making initiative even more critical), or will take lots of other changes, then it won't be fun for awhile, so might not be a great thing for the AI to focus on.

Just my .02 though.

Reply #29 Top

As someone with a big interest in modeling human decision-making, I would LOVE to be a fly on the wall while the AI gets programmed.

This journal is the next best thing. Keep it up!

Reply #30 Top

Even when a combat can be determined to be close,  the AI should probably look at the strategic map closely (particularly when the AI was attacked by us).   It should be thinking, should I retreat and join another stack close by?  Should I retreat to a nearby city - where I may get stat boosts?  It should always be looking for an advantage and also be protecting its cities at all costs.

 

Reply #31 Top

Well a big thing is listening to people play the game.

Can you imagine how cool it would be to write the Starcraft AI to deal with the Korean champions?

Reply #32 Top

Give me .78 and I'll give you 5 play by plays a day.

Reply #33 Top

Quoting Frogboy, reply 31
Well a big thing is listening to people play the game.
End of Frogboy's quote

 

Why just listen?  Why not for this next stage of the beta record the battles (unit position, moves, actions) as people play and feed the results back into a Stardock server?  Then you can analyze the patterns and weaknesses and optimize the AI behavior.

(Optionally you could use a set of genetic algorithms to optimize the XML files... but what fun is that ;)).

Reply #34 Top

Another request on the strategic/tactical front would be to allow for adjacent armies to flank, or at a minimum reinforce armies engaged in tactical battles, either at the beginning of a battle or even mid-way through the battle. 

Reply #35 Top

Quoting Frogboy, reply 31
Well a big thing is listening to people play the game.

Can you imagine how cool it would be to write the Starcraft AI to deal with the Korean champions?
End of Frogboy's quote

Yep, but not from a modelling perspective. As people become experts in task domains, you get a transition from the deliberative process that an AI uses to something like a huge collection of If-then statements linked to a pattern-recognition system. AI and human decision-making kind of seem like Bizzaro-world brothers.

To stay on topic:

1. I think that the power of archery units should be substantial, but should depend on the opposing army's composition. Very strong if unprepared to extremely weak if only prepared for archers. 

2. Maybe it could calculate expected values for damage to local targets and use that to estimate expected values for damage 'saved' by the elimination of one unit or another.* 

3. Just personally, I think that the RPS system attached to damage and armor types should be less extreme than that of the unit system. I'd personally prefer if it was just strong enough to add flavor, but not so strong that I'm completely f'ed if I don't have the right damage type.

4. See #2.*

*I have absolutely no concept of how processing intensive this would be.

Reply #36 Top

Well first there needs to be some kind of threat assessment by the AI, but on 2 fronts.

1.  First in tactical combat, these is units that are dangerous in that battle.  Maybe at the beginning have some sort of numerical value attached to units that represent danger to its units.  like maybe if it knows its using a bunch of fire creatures and you have something that they are weak against.  Also it should have some sort of value on units that it needs to protect more.

2.  second it would be really neat if it somehow knew that you had a unit that had caused it grief in the past, probably only applying to other kingdoms and it would really gun for that particular unit to get rid of it.  Maybe you have a particular champion or powerful unit and it was involved in a bunch of fights and didn't die.  it would seek revenge against this unit and maybe expend more magic or kamikaze it with other units just to get rid of it.


i think those would be neat.

Reply #37 Top

Tactical Spell Wish List

  1. Downpour (Water Level 4) - Limits attack range and view range of all units/spells to 2 tiles - From a tactical perspective this means that both sides can't see units more than 2 tiles distant. Fire Resistance +50% to all units on the map for the duration of the spell . Duration Int/3 
  2. Smoke (Fire Level 4) - Limits attack range and view range for all units to 1 tile. Good spell if cast if enemy has ranged attackers and you don't. Fire spells are still effective. Duration Int/2
  3. Wind Gust (Air Level 4) - Dispels Smoke and Downpour
  4. Sink Holes (Earth Level 3) - In a 4x4 tile area movement is reduced to 1 tile per turn as the earth becomes soft and pocketed with sinkholes that slow movement until dispelled.

Ranged Unit Balance

1. AI Has Ranged Units, Enemy Has No Ranged Units and No offensive spell casters = AI Waits for other side to advance while raining arrows on their opponent
2. AI has no ranged units, enemy has ranged units = AI closes in on enemy

Reply #38 Top

Howdy, is it possible to set up tactical battles only as a online human vs AI deposit.  What I mean is can you simply make a tactical battle game were we the players can battle in tactical only.   The results Can then be sent to you as a turn by turn datum were you can load it and watch it.  This way you can set up parameters for the players and pick the AI to battle.  You could test all the ideas you come up with and visually see the battles and methods used.  Just a though to not have to read 1billion posts on different strats.  

Reply #39 Top

Quoting Barrynor, reply 3
Once you are dedicated to kill something, KILL IT! Currently the AI switches targets, especially against superior numbers, and attacks all of em a bit. If its dead, its not doing damage anymore. He who slaps the most wins... dead things dont slap. A unit with 1 HP leftover is still 100% more effective than a unit with 0 HP.
End of Barrynor's quote

In fact that's not true in the game. Units that lose HP will also lose soldiers and then lose dice. If you have initially a unit with 5 soldiers you roll 5 dice of damage. With only one left you only roll 1.

Reply #40 Top

Quoting Frogboy, reply 31
Well a big thing is listening to people play the game.

Can you imagine how cool it would be to write the Starcraft AI to deal with the Korean champions?
End of Frogboy's quote

 

Yes.

Reply #41 Top

Quoting Frogboy, reply 31
Well a big thing is listening to people play the game.

Can you imagine how cool it would be to write the Starcraft AI to deal with the Korean champions?
End of Frogboy's quote

Interestingly enough, there's been a lot of work done for Starcraft AIs. Here's an excellent article on the subject:

http://arstechnica.com/gaming/news/2011/01/skynet-meets-the-swarm-how-the-berkeley-overmind-won-the-2010-starcraft-ai-competition.ars

The AI of the first early scout drone alone is so effective that they can't use it at all against the game AIs. "Sparky’s antics are so devastating against the built-in AI that we had to disable it during testing or we would never get to later stages of the game"

I especially liked how they implemented scattering behavior when their units were hit by an AoE attack.

Reply #42 Top

I will never divulge my secret of auto combating with burning hands.  Apparently Burning Hands has no range when in auto combat form....

 

 

SHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! 

Reply #43 Top

In one of the next betas, make it possible to set up custom battles, like in the fheroes2 mod's Battle Only mode.  Then download certain battle configurations (including tactical battle map) to the custom battle facility, and automatically send the results of these battles to you (but make sure players know).

Anyway, just a thought.  In fheroes2 Battle Only mode you can customize the armies of both sides, and then either play against a human or the computer.  The Battle Only mode even took account of customized stats and skill effects.

Reply #44 Top

Yeah, even on a combat scale as "Limited" as FE, there's a hoard of tactics you can apply once you have the basics covered. Here's a few of the simpler ones...

 

Brutal damage race (is what we do now, most of the time, just send in a hero and kill em all ASAP and move on).

Triple group heal units with tanky armies.

Shutdown of enemy through crowd control and debuffs.

(Provided flee is enabled) Hit and run tactics with high initiative troops.

AoE swamping with three earth elementals and AoE spells (this works very well in high magic games, and is one of my favorites atm).

Non focus fire on turn 1 so everything takes damage, turn 2, Blizzard on turn 2...

Buffing your own army till it so absurdly overbuffed it kills everything with ease (this requires either more buff spells which we do not have at the moment, or a hoard of out of combat buffs...)... right up untill you engage some counter magic.

Use overland spells to demolish armies that come into your range (Frogboy, here's one for you to remember, because its a particulary vile trick: Send a few pioneers alongside an army, and when you engage a very strong enemy in non-claimed territory, make an outpost, spam it with overland spells that are only usable on your own territory and then kill off what is left behind...)

 

 

 

That's the real problem for your AI here... Starcraft, given all its complexity, has a limited number of units and a limited number of rock-paper-sciccor moments... FE... well... I'll rock-paper-sciccor your Earth Elementals with my swords of +10 vs Elementals... or with a curse and a shrink... or with Flame Dart with +10 in Shards... yeah..

 

edit: That custom battle thingie he already has... it is also delivered in Total War as part of the game, and they are very good testing beds for everyone to see what works nicely and what does not.[

 

Reply #46 Top

There's none for us, but I remember Frogboy saying for WOM he had such a setup. So I assume he has it for FE as well.

Reply #47 Top

Quoting vieuxchat, reply 39

Quoting Barrynor, reply 3Once you are dedicated to kill something, KILL IT! Currently the AI switches targets, especially against superior numbers, and attacks all of em a bit. If its dead, its not doing damage anymore. He who slaps the most wins... dead things dont slap. A unit with 1 HP leftover is still 100% more effective than a unit with 0 HP.

In fact that's not true in the game. Units that lose HP will also lose soldiers and then lose dice. If you have initially a unit with 5 soldiers you roll 5 dice of damage. With only one left you only roll 1.
End of vieuxchat's quote

I agree that if you (or rather the AI) are in a situation where you think you have a fair chance of winning, it's important not to waste a large damage attack taking out the last trooper in a unit if you can instead use that attack to take out 3 out of the 5 troopers in another unit, thus depriving them of attack dice.

On the other hand, if you (or the AI) are in a situation where you're going to lose the battle, it's better to eliminate units completely since partial units heal on the strategic level, whereas dead units don't (yet. as far as I know. ;) )

Reply #48 Top
Damnit.  I'm such a sucker.
 
1 What is the balance of power in ranged units?
 
You can answer that.
 
You need to extract your combat code from the game, and lots of run simulations on different stack makeups.  That way regardless of any changes you make to the system, you can re-run the simulations to find some good balances of x vs x.  To easy.
 
2. Should I attack the closest unit or bypass that unit to go after a more vulnerable unit
 
Most difficult question you have posted.  See idea at end.
 
3. How important is vulnerablity? No point casting a fire dart at a fire elemental but should I spend a day coding about blunt weapons versus cutting weapons? (remember: time is a finite resource, I don’t get a year to write this, just N engineering hours).

Extremely important if you want to make an AI that kicks arse.  See idea.
 
4. Should I cast a spell? Right now, the AI wastes magic when it shouldn’t (because it rolls the dice rather than calculating it).  No point in using burning hands if I can kill you with a sword almost as well.

See idea.
 
 
Idea!
No-one does tactical combat well.  No-one.  Probably because of time, probably because there are so many variables and combinations that it just takes such a long time to figure out stuff.
 
It's all well and good that everyone is here posting ideas, but what you really need is to CAPTURE it in a way that doesn't require you to figure out how the heck it fits in, how you can implement it in code, and what other stuff it needs to get running, but at the same time ensure that we can input our thoughts to this system without writing the code ourselfs.  A middle ground.
 
I would even suggest that this be the first thing you get ideas about.  I can start with a concept that might be easy for us to input into, and might be easy(er) to implement those idea with.
 
So 3 areas where we would try to slot in out ideas.
 
The Commander - Big Picture
  • This fella thinks about things like - Shit, i'm about to go to war, who stole my magic!  I need it before we go hunting wabbits!  No more magic for you sargent!
  • He has personality - and takes input from The Advisor, but is tempered by his personality
For him, we would want ideas that consider bigger concepts that run outside of the tactical battlefield.
 
The Sargent - Tactical
  • This guys thinks about things like who do I need to defend and protect, who do I need to kill, how can I kill him, how do a get my god damn troopers to stay in formation!  Damn that big picture pansy commander, I need more magic - I hate having to take orders from him! 
  • He takes orders from the commander, and makes tactical choices within those limits
For him, we need ideas that talk about who to defend, who to attack, how to position our troops, and such.
 
The Advisor - Stats and Analysis
  • This dude knows every god damn stat on the planet.
  • He just advises everyone, telling them this and that, but they never listen. Never!
We would want more technical, formula like ideas for this guy.

Reply #49 Top

A couple of things that will help:

What is the damage/chance of each action, meaning a melee hit will do 2-6 at 90% hit, while a spell will do 4-9 at 95% hit.

When you got the numbers, what will reduce the enemy power the most, by looking at their tables. Killing a hero which does 10-20 damage is better than wiping a stack that does 5-15 is obviously better, but reducing 2 of these stacks to near death in 2 hits might be worth more than spending these attacks on the hero.

 

Reply #50 Top

Could you have a 3 stage AI threaded to handle combat? Is that already how it works? I liked BlightOr's way of describing the factors in every decision. 

Here are a couple of Commander scenarios for the AI:

I am making so many soldiers it doesn't matter if I lose this army. Just kill whatever you can and wait for the next army to clean up. 

I have so much magic coming in I can cast as much as I want. Get AoE on the frontline and play defensive at the rear of the field.

I have a well balanced group of high level units. Keeping everyone alive is paramount to success. Focus on weakening the enemy's attack by flanking archers and mages.

I have Verga soloing so much he is 10 levels ahead of everything right now. Make a bee line for the nearest capital. Taking that will capitalize on the temporary advantage and turn the game in my favor. 

 

These are all things I have done on a commander level that the AI should be more than capable of at least trying. Oh, and make sure the AI can counter these strategies too. No pressure. My only weakness is my overconfidence from years of playing Immense on GalCiv2:TA.  :cylon: