Frogboy Frogboy

FE 0.80: AI Test Game

FE 0.80: AI Test Game

Version 0.80 is an internal build of Fallen Enchantress.  This is basically a test of the AI on normal.

I’m playing as Relias, the sovereign of Altar, a Kingdom of Men.

My opponents are the Blood Elves of Magnar, The Mancers of Capitar, and the Wraiths led by Ceresa.

Note: I’m playing in the debugger so please bear that in mind before commenting too much on graphics as these are set to minimum.

An early battle:

This is the new tactical AI in action.  I’m not sure I like what it decided.  The wolves decided to bypass my strongest unit in order to target my weaker champion. But in doing so they were vulnerable to my main guy.

So let’s see what we can do next…

54,315 views 59 replies
Reply #26 Top

Quoting Alstein, reply 24
You're fighting wolves, not Wile E. Coyote and his family.

 

You might be onto a hell of a game idea there!

Reply #27 Top

Quoting Spitz, reply 11
I think the wolves made the right call. They had no chance of killing your stronger character and no chance of winning the battle overall. Concentrating on the weakest foe to inflict max damage before losing is the right move.

 

 

 not true

 

ai should calculate if it can deal dmg in the turn or not

 

when its not possible to reach the weakest target (or the target they want to attack in general) then the choice should be between

-attacking a secondary target WHILE getting close to the main objective

-not attacking at all, making a move just to be closer to the main target while staying out of range (if possible)  of the strong enemy 

 

there are other possibilities too ofc

Reply #28 Top

I think without the ability to flee.  Staying out of range of the strongest opponent is just delaying the inevitable.

Reply #29 Top

Also we run the risk of a stalemate if both armies have no range access, equal movement and initiative. It will lead to both armies stopping at the one square beyond their opponents movement and passing forever. Not a problem in a human battle because in the end the human would blink first just to get the game moving again, but in a auto resolve, or AI vs AI battle it could lead to a potential infinite loop.

Reply #30 Top

Quoting Murteas, reply 28
I think without the ability to flee.  Staying out of range of the strongest opponent is just delaying the inevitable.

 

so? thats the smartest move anyway

 

since its *inevitable* like you say in the time you are there you have to make the most dmg possible... b4 you die

that is achieved stay out of the first combat range of the strongest melee, at least

Reply #31 Top

Quoting Lonemessiah, reply 29
Also we run the risk of a stalemate if both armies have no range access, equal movement and initiative. It will lead to both armies stopping at the one square beyond their opponents movement and passing forever. Not a problem in a human battle because in the end the human would blink first just to get the game moving again, but in a auto resolve, or AI vs AI battle it could lead to a potential infinite loop.

 

i think its simple to implement a real stalemate, if after N turns no one has gained the victory both go home 

 

i really dont want to see the AI making a stupid move cause "it has to do something" what a crap thought is that???

 

 

lets say we have both 1 unit with 2000 attack and 0 def

both with 2 mov range and no particular ability

then the wisest move for BOTH is staying out of range and call it a day

whoever move closer first die, why would you want the ai to suicide?

Reply #32 Top


I agree with Alstein, a simpler less intelligent AI for dumb animals and a more powerful, smarter AI for intelligent opponents.

Reply #33 Top
I think Lonemessiah is correct here. Infinite stalemates between AI players would not be a good thing. If the units with the proposed stats always just stay put for N rounds then they'll attack again next turn, wait N rounds, attack, wait, attack, wait, you get the picture. Attacker should probably have to press the attack for some reason or another. That said, This probably isn't a huge issue for Frogboy.
Reply #34 Top
Regarding the request for different AIs for animals and intelligent opponents, it sounds like a neat feature, but would people even notice it? Is it worth putting effort into such a minor feature if nobody notices it?
Reply #35 Top

Anyone played chess? Given the size of the maps and movement penalties when adjacent to an enemy, it would be impossible to end up in a stalemate. Any melee unit is designed to attack a target. Even if it is faster and weaker, it would attack the enemy. A ranged unit with alot of speed would win by running and attacking. That would still only work in a 1v1 situation. This is the problem of conjecture, it doesn't take into account every variables. 

Reply #36 Top
I think ddd888 example demonstrates a valid stalemate situation. 2 units with equal movement and both able to kill the other one with a single melee strike. First to move in will lose. If this seems too far fetched then a situation where the units are not able to outright kill, but will cause enough casualties to win in the end is also a situation where a stalemate is the best result you can expect.
Reply #37 Top

Quoting Lonemessiah, reply 29
Also we run the risk of a stalemate if both armies have no range access, equal movement and initiative. It will lead to both armies stopping at the one square beyond their opponents movement and passing forever. Not a problem in a human battle because in the end the human would blink first just to get the game moving again, but in a auto resolve, or AI vs AI battle it could lead to a potential infinite loop.

Easy fix have a set number of turns that combat can last. AOW used 25 turns and they had bigger Tactical maps with terrain features that mean something. But I would have it as an option for the player to set with unlimited being one of the options.

Reply #38 Top

Melee units won't run away though. Even if they did, they would reach the edge of the map and the opposing unit would be able to block them in with ZoC.

Reply #39 Top

Quoting Vallu751, reply 36
I think ddd888 example demonstrates a valid stalemate situation. 2 units with equal movement and both able to kill the other one with a single melee strike. First to move in will lose. If this seems too far fetched then a situation where the units are not able to outright kill, but will cause enough casualties to win in the end is also a situation where a stalemate is the best result you can expect.

 

In essence, this would turn tactical combat into a game we cannot win.

 

This is not what I'd like from the AI. I'd prefer it to try and cause some damage, and then smack my damaged units a turn later with a nasty surprise. That's what I would do.

Reply #40 Top

In chess there is "stalemate if the same playing position is seen 3 times" rule and "stalemate if no captures in 50 moves". These forbid forever lasting games. I think the last rule would be good for elemental, too. Stalemate if no damage dealt in last N moves. I don't know the right N, probably something like 3 * number of units in the battle or something...

This way the AI could play the most intelligent strategy. Playing out a draw in a situation where your other choice is losing the battle is a good strategy. Although this might be boring from playability perspective.

From the videos it seems one of the biggest problems is that the AI lets the enemy hit him first by moving into strike distance. This can easily decide the whole battle. Of course, an AI that waits for the human to attack is pretty boring from playability viewpoint. I think the best solution for this is to have, as often as possible, battles where one side benefits from moving in. This can be done by giving ranged attacks (even weak ones) or weak magical attacks to the units. The side which has more long-range potential benefits from staying back. Thus, it is completely OK for the AI to stay back if it has more long-range potential.

I think the most crucial aspect of the tactical battles is when to "mass-attack" your enemy, and how to execute that attack. By "mass-attacking" I mean a move where you try to get as many of your units to attack the enemy with as little enemy counter attacks as possible. I don't think the AI is particularly good at this, but it is hard to tell because in many of the videos the forces are so unbalanced that it doesn't seem to matter much what the AI does.

Reply #41 Top

I just don't think it is a good idea to have an ai that sits there waiting for the player to advance.  I agree it may be the best tactical move for the computer to make, but can you imagine the outcry from people.  

 

"Tactical battles are broken.  The AI just sits there."

 

I think that when battles take place later on in the game, there are enough abilities and spells in the fights to compensate for the initial move.   Or simply add a defend ability to the computer so that it can move and if doesn't attack it can defend which improves its armor by some %.

Reply #42 Top

Don't spread this around, but I usually let the AI attack first. Since it will always come at me in no particular formation, I can sit back. The highest level heroes will hit me first, but be so far ahead of their army I can wreck their best units and then mop up the rest. It's more effective in terms of keeping all my units at full health. 

Also, when sitting back this is the best formation:

X is empty tile and O is my defender units. 

XXOXXOXXOXX


This way the enemy can't get past you because of ZoC. They will choose one of the O's to attack. On your turn you can swarm that unit. It is best to have your damage dealing units waiting behind this line. You usually get back behind your defenders before their regular army has caught up. 

Reply #43 Top

It is true that an AI that does nothing will not be liked too much.

I would like to know which strategies the AI tries to use? I can see at least 3 potential base strategies:

  • Sit back and inflict damage with spells and ranged attacks.
  • Attack the enemy in controlled fashion: try to move in in a way which maximizes hits done by you vs hits done by enemy.
  • Rush-attack the enemy.

When to use the first one is obvious. The second one should be in use when the enemy doesn't have overwhelming ranged attack power. The last one is the tactic to use against ranged-only enemies, or enemies which have so powerful ranged attacks that you are going to die trying to do the controlled attack.

The main difference between the second and third one is that when using the third one you should not send lone fast units ahead of the group. They get one hit, the enemy kills the unit.

Another question is how do you test the AI programmatically? This seems pretty hard as the rest of the game can change in ways that change the "right" AI decision. Do you have something like unit tests? Or just plain human-testing?

Reply #44 Top

after watching this, i don't get why the AI moves the archers away from an enemy.  is there some kind of penalty or something for moving and attacking or for archers attacking inside melee range?  if there isn't then there should be.  at least make it so that that if you don't move at all then you get an extra attack or something.

Reply #45 Top

Quoting Barrynor, reply 39

 

In essence, this would turn tactical combat into a game we cannot win.

 

 

this what?

playing well?

 

its ridicolous AND FALSE

 

what are the odds of having 2 high dmg, low defense, non ranged, non magica, with same move and initiative units ?

 

seriously?

i just want WHEN it happens  (and wont be so often)  the ai knows how to play it

 

why instead dont YOU suicide your units moving first closer without any chance to attack?

i dont see why the ai should be dumbed down

Reply #46 Top

Quoting ddd888, reply 45

Quoting Barrynor, reply 39
 

In essence, this would turn tactical combat into a game we cannot win.

 
this what?
playing well?
its ridicolous AND FALSE
what are the odds of having 2 high dmg, low defense, non ranged, non magica, with same move and initiative units ?
seriously?
i just want WHEN it happens  (and wont be so often)  the ai knows how to play it

why instead dont YOU suicide your units moving first closer without any chance to attack?
i dont see why the ai should be dumbed down

 

Given all parameters involved in the fights, and assuming that every move has a countermove, and assuming that the AI gets to be as clever as you'd like it to see, this game will end in a stalemate. Chess is not won because someone has an advantage. Chess* is won because someone made a mistake. Given enough time and CPU power, Chess is a stalemate only broken by white going first, and the rule that you HAVE to move. Theoretically speaking, any game with balance works like this.This is what I refer to when saying "In essence, this would turn tactical combat into a game we cannot win".

 

Its all theorycraft anyway, because 1. chances of this turning up are pretty darn lowand 2. chances of Brad programming a stalemate AI are pretty low and 3. you can check, beforehand, what the enemy's stack contains so there's no reason why this should occur, ever. You just rock-paper-sciccor em.

 

*note that Chess computers do not have a real AI, they merely compute all possible moves and pick the statistically most succesfull. This is the same process that humans use to win, but Chess computers can look further into the future... loking more than 3 moves ahead on either side is very difficult, even for 2400+ players. I used to have one as a co-worker ;)

Reply #47 Top

If a stalemate occurs for N turns, roll the dice and force an AI player to attack. Problem solved.

Reply #48 Top

I don't think a stalemate would be possible.

A) non conquest victories

B ) not all troops can be in the same location at the same time

C) not all economies are equal

D) not all terrain is equal

Reply #49 Top

We are not talking about a stalemate in regards to the whole game, just a specific tactical battle. All it would take is two units of the same type to meet in battle and if the AI is unwilling to be the first to commit then an AI vs AI battle is doomed stall and an AI vs player battle would be very frustrating.

Of course the easy solution would be after x amount of turns a random unit is offered a massive initiative boost for 1 turn so that it could take two actions, and thus solve the stalemate. It is a cheating solution, but I suppose it could work.

Reply #50 Top

how about after X turns of inaction, a draw is concluded and the battle ends? (inaction being no damage taken)