AI concerns

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

AI concerns

Post by turin »

If you have a unit with 1 xp to advance and 1 health, and it has a ranged attack, and a nearby lvl 1 enemy does not... don't you shoot at that enemy and advance as opposed to attacking a different archer-type unit with melee, and risking death? :?

the AI apparently doesn't... maybe something should be added that says "if this guarantees you advance, do it"?
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Mindless
Posts: 17
Joined: September 25th, 2004, 3:15 pm

Post by Mindless »

For me it doesn't have any sense. I mean why the AI would attack unit which can hit back if nearby is unit which can be hit without any harm to the attacker.
I always try to attack units which can do less damage to attacker. So fighters against mages. Mages against fighters.
Integral
Posts: 244
Joined: December 14th, 2003, 9:36 pm
Location: Pennsylvania

Post by Integral »

I've noticed this too. The inverse problem also occurs: the AI will attack units that are guaranteed to survive and level as a result of the battle. (yes, this can sometimes be part of a diaboloical strategy....but believe me, I've seen the AI do this lots of times when it was just stupid)

Daniel
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Integral wrote:I've noticed this too. The inverse problem also occurs: the AI will attack units that are guaranteed to survive and level as a result of the battle. (yes, this can sometimes be part of a diaboloical strategy....but believe me, I've seen the AI do this lots of times when it was just stupid)

Daniel
really? most of the time the AI avoids soon-to-advance units pretty well, unless it can kill them...

although it often levels them with the hope of killing them after they level, which is not too effective...
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Examples (save files) of situations where the AI behaves poorly would be appreciated -- then I can easily tell why it's playing poorly, make changes to the code, and re-test.

With just a description of the situation, all I can do is try to set up a similiar situation and see if I can reproduce it. I tried to reproduce turin's example a few times, but each time the AI did what I would consider the intelligent thing.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

Dave is there an autosave in MP too ? if there is, that would avoid people havng to save manually "before" the bug
Fight key loggers: write some perl using vim
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Boucman wrote:Dave is there an autosave in MP too ? if there is, that would avoid people havng to save manually "before" the bug
Yes there is.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

A replay of Black Flag, where the AI does some stupid things. (I also saveload at the end to save Grüü.) Some of them could be fixed by making Slowhand a passive_leader. But at one point a Heavy Infantry attacks Kapou'e, with no chance to kill, sure to level up Kapou'e, and possibility to get the Heavy Infantry killed (which incidentally happened). I have some mid-game saves if needed, but I'd have to find out which one was just before this situation. A turn number would be helpful. :)

About the AI being about to level up, I don't believe it takes into account whether its units could level up. (I could be wrong.)
Play a Silver Mage in the Wesvoid campaign.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Invisible Philosopher wrote:A replay of Black Flag, where the AI does some stupid things.
Please provide saved games immediately before the AI does something stupid with a description of what the AI does stupid, and why.
Invisible Philosopher wrote: About the AI being about to level up, I don't believe it takes into account whether its units could level up. (I could be wrong.)
It does take this into account.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
Integral
Posts: 244
Joined: December 14th, 2003, 9:36 pm
Location: Pennsylvania

Post by Integral »

If you hit "end turn" on this save file, one of the AI's naga will valiantly charge at my sergeant (who is 1XP from leveling), despite the fact that it cannot possibly kill him. The computer can't be planning to attack him with more powerful units: nothing but naga can reach him, and the one naga that attacks him is the last unit the computer moves.

Daniel
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

Integral: thanks for the example. Here's the deal with it:

The AI attacks you along its line, concentrating on your spearmen and knight. There are various outcomes, but in many of them, the west-most naga is left unable to attack anyone but your almost-advanced unit from the swamp.

The naga is loathe to leave the swamp (smart, I'm sure you'll agree), and it doesn't want to flee, since the battle is reasonably closely contested.

So, what it decides to do is stay still. However, there is a provision in the AI algorithm, that if the AI moves a unit, and ends up next to an enemy, it will always attack. The reason for this is that some time ago, the AI used to be too passive in its main attack phase, so I added this in to make sure the AI wouldn't end up sitting around doing nothing.

However I think the AI's problems with being too passive in its main attack phase have been fixed. So, I'm changing this condition to only attack if the attack is risk-free (the enemy has no response). We'll see if it works out well.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
joshbosh321
Posts: 212
Joined: May 14th, 2004, 10:10 pm
Location: East Brunswick, NJ

Post by joshbosh321 »

Another problem, related to what Dave just said. If you have, say, a merman next to a lich leader, and the lich has 1 hp, it won't attack the merman even though it has no risk in doing so.

I never actually tried this with a merman, but I have with all sorts of other units. I think that the leader should always attack a unit if it is in no danger of being damaged, even if the leader is injured or passive. This doesn't mean that a Orcish Ruler leader at full health would ignore Konrad at 1 health and instead attack a dwarvish fighter at full health with it's ranged attack, just that the orc would do that if it had 1 health.
Space is big. You just won't believe how vastly, hugely, mind- bogglingly big it is. I mean, you may think it's a long way down the road to the drug store, but that's just peanuts to space.

---Douglas Adams
Invisible Philosopher
Posts: 873
Joined: July 4th, 2004, 9:14 pm
Location: My imagination
Contact:

Post by Invisible Philosopher »

Dave wrote:
Invisible Philosopher wrote:A replay of Black Flag, where the AI does some stupid things.
Please provide saved games immediately before the AI does something stupid with a description of what the AI does stupid, and why.
End turn, and the damaged Heavy Infantry attacks Kapou'e (at least that happened twice for me). The Heavy Infantry can't kill Kapou'e, is sure to level him up, and might die.
Play a Silver Mage in the Wesvoid campaign.
Post Reply