Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Library of Enlightenment > Thread: How did AI win this battle?
Thread: How did AI win this battle?
Mortarial
Mortarial


Hired Hero
posted July 24, 2020 06:26 PM
Edited by Mortarial at 23:13, 24 Jul 2020.

How did AI win this battle?

So I've been testing some stuff and when I was trying to get the desired results I noticed something weird.

So we have 3 exactly same heroes, only one of them has different from others army. All of them are going to the Alchemist's Lab, which is guarded by 3 Swordsmen. And there is also an ambush right before the Lab with 6*20 Archdevils. All 3 heroes have Fire Elementals which are immune to fire, and all 3 heroes know the Armaggedon spell and have enough power to kill all Archdevils with a single cast.

But

Grindan can't cast the spell, since Archdevils kills his Fire Elementals before their turn. That is okay.

Then

We can see how Ciele with exactly same army somehow manages to kill Archdevils and then attack the guards. After defeating the Archdevils she gained Fireball spell and some mana to cast it, and 50 SpellPower (so now her SP =1). Also we can see that her Knowledge level increased because she gained few levels after defeating the Archdevils and her mana changed cause she used Armageddon. How? She should've lose just like Grindan did.

Then

Gelare, the one with a great army... can't defeat the Archdevils? What? He has enough stacks to survive the first Archdevils' attack. Moreover, Archdevils will prioritirize all hero's bigger stacks and even kill them with a single hit, while ignoring the Fire Elementals, so Gelare can cast Armageddon and win for sure. But he refuses. Why? Why Ciele must die but she wins somehow? Why Gelare is able to win but he loses?

[url=https://drive.google.com/file/d/1e0MOPV52lWFsn8vICs13hsIkyMoVMLJM/view?usp=sharing]Video[/url]

Upd

[url=https://drive.google.com/file/d/1PHk4fM-c1lezww7wAawoC31YFg9AQySd/view?usp=sharing]How is this even possible?[/url]

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Stevie
Stevie


Responsible
Undefeatable Hero
posted July 24, 2020 08:48 PM

That's actually really interesting.

Do we know for sure if the AI recognizes fire immunity? Maybe they think the army will not survive the Armageddon spell and lose the battle. But this might answer only why Gelare loses.

For Ciele, no idea. Maybe the battle during enemy turn is different than on player turn and AI acts differently.

Just throwing out some thoughts.
____________
Guide to a Great Heroes Game
The Young Traveler

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
RoseKavalier
RoseKavalier


Admirable
Supreme Hero
posted July 24, 2020 09:52 PM
Edited by RoseKavalier at 21:53, 24 Jul 2020.

See Gus's replies.

Quote:
"Quick Combat" is exactly the same as running the combat with Auto
Combat on.  The same code is executed, it's just run with the animations
off.

The AI heroes use something much simpler, for speed reasons.

Quote:
Actually, it attempts to simulate that.  The AI method simulates 4
"normal" rounds, in which archers can shoot without retaliation.  The
faster a melee creature is, the sooner it gets to participate in
combat.  After that, the result is determined by a combination of the
ratio of the two forces and a random factor.


Gelare is probably not casting Armageddon due to damage to his own troops.
____________
My Let's Plays: Metataxer's Revenge - The Empire of The World 2

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Mortarial
Mortarial


Hired Hero
posted July 24, 2020 10:55 PM
Edited by Mortarial at 22:56, 24 Jul 2020.

RoseKavalier said:
[url=https://groups.google.com/d/msg/comp.sys.ibm.pc.games.strategic/_50Bsv0SEjE/LMVlK_9CiksJ]See Gus's replies.[/url]

Quote:
Gelare is probably not casting Armageddon due to damage to his own troops.


Mortarial said:

He has enough stacks to survive the first Archdevils' attack. Moreover, Archdevils will prioritirize all hero's bigger stacks and even kill them with a single hit, while ignoring the Fire Elementals, so Gelare can cast Armageddon and win for sure.



 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Mortarial
Mortarial


Hired Hero
posted July 24, 2020 11:01 PM

[url=https://drive.google.com/file/d/1PHk4fM-c1lezww7wAawoC31YFg9AQySd/view?usp=sharing]Now that is really interesting![/url]

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
RoseKavalier
RoseKavalier


Admirable
Supreme Hero
posted July 25, 2020 04:29 AM

Mortarial said:

He has enough stacks to survive the first Archdevils' attack. Moreover, Archdevils will prioritirize all hero's bigger stacks and even kill them with a single hit, while ignoring the Fire Elementals, so Gelare can cast Armageddon and win for sure.


Normal combat logic doesn't apply to simulated combat
Gus Smedstad coded the thing, he should know. You can look up more quotes by him for more examples and quirks... there are several bugs that were never fixed and some checks that are just not done. In particular casting of spells was considered the most expensive computationally wise so full rules are not implemented to save cycles since the routine is being used a large number of times each time a hero takes a step.

Generally simulated combat is known to be flawed but it still does a pretty decent job. You can explore and find more bugs but this is the reason why AI can win unwinnable fights or sometimes lose way more creatures than it should.
____________
My Let's Plays: Metataxer's Revenge - The Empire of The World 2

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Mortarial
Mortarial


Hired Hero
posted July 25, 2020 09:21 AM

So I made few more tests with Ciele and it appears that results depends on the "strongest creature" in ambush. For example:

1. 3*6 Black Dragons + 1 Rust Dragon - win. Note that if there is more Black Dragons in any stack then she lose.

2. 3*6 Black Dragons + Centaur Captain - lose. Black Dragon is the strongest in this case and he has Magic Immunity.

3. 20*6 Archdevils + 1 Archangel - win. Both creatures can be affected by Armageddon.

4. 20*6 Archdevils + 1 Gold Dragon - lose. Gold Dragon is the strongest in this case and he is not affected by Armageddon.

5. 20*6 Devils + 1 Magic Elemental - win. Despite Magic Elemental is not affected by Armageddon, Devil is stronger.

6. 20*6 Zombies + 1 Magic Elemental - lose. Now Magic Elemental is stronger.

So in conclusion, it seems like AI ignores creatures' immunities if they (creatures) are not the strongest one. It explains how she kills Fire Elementals even if she should't, cause they are immune to Armageddon, but since Archdevils are stronger Ciele somehow is allowed to ignore their immunity.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Mortarial
Mortarial


Hired Hero
posted July 26, 2020 05:46 PM
Edited by Mortarial at 17:46, 26 Jul 2020.

I noticed one more thing: Armageddon damage is equal 7969 to points. It is enough to kill 227 Fire Elementals with it. But Ciele wins even if there is up to 305 Fire Elementals. 306 or more and she loses.

If her Spell Power is decreased to 44 (4002 Armageddon damage - minimum to kill all Archdevils) she still kills 305 Fire Elementals. But she should not kill more than 114 with that damage.

One more thing: it seems like the max number of Fire Elementals that she able to kill depends on the number of Archdevil in first stack. With 90 SP and 19*6 Archdevils she loses. With 1 Archdevil - 16 Elementals maximum, 4 - 62, 35 - 535, 27 - 412. The maximum number of Fire Elementals that she able to kill is equal somewhere about the number of Archdevils in first stack*15.25 (rounded down) + 1. But + 1 sometimes is not counted: 28 - 427.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Machberet
Machberet


Hired Hero
posted July 28, 2020 01:11 AM

Mortarial said:
I noticed one more thing: Armageddon damage is equal 7969 to points. It is enough to kill 227 Fire Elementals with it. But Ciele wins even if there is up to 305 Fire Elementals. 306 or more and she loses.

If her Spell Power is decreased to 44 (4002 Armageddon damage - minimum to kill all Archdevils) she still kills 305 Fire Elementals. But she should not kill more than 114 with that damage.

One more thing: it seems like the max number of Fire Elementals that she able to kill depends on the number of Archdevil in first stack. With 90 SP and 19*6 Archdevils she loses. With 1 Archdevil - 16 Elementals maximum, 4 - 62, 35 - 535, 27 - 412. The maximum number of Fire Elementals that she able to kill is equal somewhere about the number of Archdevils in first stack*15.25 (rounded down) + 1. But + 1 sometimes is not counted: 28 - 427.




Wenwell and me were experimenting with Death Ripple and Destroy Undead, Armageddon a bit too. In HotA also Berserk. Something is amiss with how this spells are calculated in AI-AI fight, they got too high value. Septienna with starting army and stats kills 22 genies.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0560 seconds