AI Does the Darndest Things

The tale of the siblings Althea and Shea https://www.winterwolves.com/seasonsofthewolf.htm
Post Reply
User avatar
yayswords
Elder Druid
Posts: 1436
Joined: Sat Jan 25, 2014 5:34 am

Re: AI Does the Darndest Things

Post by yayswords »

This was probably not planned by the AI, but could be a good thing to teach it.

The turn order was (start of fight): My druid, 3 enemy archers, then Riley. A druid + Riley nuke would finish one archer, so I opened with a nuke on my druid. But one of the archers hasted a front row mob so it got to act before Riley and could guard the injured archer :)
If at first try it doesn't explode, it ain't Jack who wrote the code.
User avatar
jack1974
Pack leader
Posts: 15482
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Does the Darndest Things

Post by jack1974 »

Yes I can tell them to haste a frontline fighter as first action in the battle. Is a good strategy indeed :)
User avatar
fabulaparva
Elder Druid
Posts: 761
Joined: Sun May 04, 2014 9:58 pm

Re: AI Does the Darndest Things

Post by fabulaparva »

Dem Healing skills.... v.0.8.24.8. This time Gamesh Crossbowmen are drinking up potions for 0HP. (Well, I've seen them do it before, but this time I got it logged! :P)

AI-Log:
Spoiler:
AI-Log Logfile
08/14/14 22:19:12
[22:19:19]
[22:19:19] ################# AI REQUEST for Gamesh Crossbowman A ################
[22:19:19]
[22:19:19] Considering Heal Potion
[22:19:19] 0 Friend(s) have less than 40 % HP, 1 needed (Reverse: False)
[22:19:19] Considering Armor Skin II
[22:19:19] Random: 67 <= 75
[22:19:19] Targets: ['Gamesh Crossbowman A']
[22:19:19] Decorator Has not Armor Skin
[22:19:19] Targets: ['Gamesh Crossbowman A']
[22:19:19] Target is Gamesh Crossbowman A
[22:19:19]
[22:19:19] ############### Executing Armor Skin II ##############
[22:19:19]
[22:19:20]
[22:19:20] ################# AI REQUEST for Gamesh Crossbowman B ################
[22:19:20]
[22:19:20] Considering Heal Potion
[22:19:20] 0 Friend(s) have less than 40 % HP, 1 needed (Reverse: False)
[22:19:20] Considering Armor Skin II
[22:19:20] Random: 17 <= 75
[22:19:20] Targets: ['Gamesh Crossbowman B']
[22:19:20] Decorator Has not Armor Skin
[22:19:20] Targets: ['Gamesh Crossbowman B']
[22:19:20] Target is Gamesh Crossbowman B
[22:19:20]
[22:19:20] ############### Executing Armor Skin II ##############
[22:19:20]
[22:19:39] Start AI action request for Gamesh Swordman A
[22:19:39] Request action from node Root
[22:19:39] Condition is True
[22:19:39] Request action from node Staggered
[22:19:39] Condition is False
[22:19:39] Request action from node Guard
[22:19:39] Condition is False
[22:19:39] Request action from node Position
[22:19:39] Condition is True
[22:19:39] Request action from node AreaAttack
[22:19:39] Condition is False
[22:19:39] Request action from node SpecialAttack
[22:19:39] Condition is True
[22:19:39] Request action from AI action SpecialAttackAction
[22:19:39] Test: Consider Shea for Snap Shot with 7.0 predicted damage
[22:19:39] Test: Adjustet value for wounded target: 14.0
[22:19:39] Test: Adjustet value for aggro: 47.6774414592
[22:19:39] Test: Consider Althea for Snap Shot with 6.0 predicted damage
[22:19:39] Test: Adjustet value for wounded target: 6.0
[22:19:39] Test: Adjustet value for aggro: 7.21875
[22:19:39] Test: Consider Riley for Snap Shot with 8.0 predicted damage
[22:19:39] Test: Adjustet value for wounded target: 8.0
[22:19:39] Test: Adjustet value for aggro: 15.5
[22:19:39] Test: Choosen target Shea with expected value of 47.6774414592
[22:19:39] Return action for slot SpecialAttack with Snap Shot as slotted skill.
[22:19:40] Start AI action request for Gamesh Swordman B
[22:19:40] Request action from node Root
[22:19:40] Condition is True
[22:19:40] Request action from node Staggered
[22:19:40] Condition is False
[22:19:40] Request action from node Guard
[22:19:40] Condition is False
[22:19:40] Request action from node Position
[22:19:40] Condition is True
[22:19:40] Request action from node AreaAttack
[22:19:40] Condition is False
[22:19:40] Request action from node SpecialAttack
[22:19:40] Condition is True
[22:19:40] Request action from AI action SpecialAttackAction
[22:19:40] Test: Consider Shea for Snap Shot with 7.0 predicted damage
[22:19:40] Test: Adjustet value for wounded target: 14.0
[22:19:40] Test: Adjustet value for aggro: 47.6774414592
[22:19:40] Test: Consider Althea for Snap Shot with 6.0 predicted damage
[22:19:40] Test: Adjustet value for wounded target: 6.0
[22:19:40] Test: Adjustet value for aggro: 7.21875
[22:19:40] Test: Consider Riley for Snap Shot with 7.0 predicted damage
[22:19:40] Test: Adjustet value for wounded target: 7.0
[22:19:40] Test: Adjustet value for aggro: 14.5
[22:19:40] Test: Choosen target Shea with expected value of 47.6774414592
[22:19:40] Return action for slot SpecialAttack with Snap Shot as slotted skill.
[22:19:43]
[22:19:43] ################# AI REQUEST for Gamesh Crossbowman A ################
[22:19:43]
[22:19:43] Considering Heal Potion
[22:19:43] 1 Friend(s) have less than 40 % HP, 1 needed (Reverse: False)
[22:19:43] Random: 38 <= 40
[22:19:43] Counter 10 is True (Reverse: False)
[22:19:43] Targets: ['Gamesh Swordman A', 'Gamesh Swordman B', 'Gamesh Crossbowman A']
[22:19:43] Decorator Minimum Health
[22:19:43] Targets: ['Gamesh Crossbowman A']
[22:19:43] Target is Gamesh Crossbowman A
[22:19:43]
[22:19:43] ############### Executing Heal Potion ##############
[22:19:43]

[22:19:44] Start AI action request for Gamesh Swordman A
[22:19:44] Request action from node Root
[22:19:44] Condition is True
[22:19:44] Request action from node Staggered
[22:19:44] Condition is False
[22:19:44] Request action from node Guard
[22:19:44] Condition is False
[22:19:44] Request action from node Position
[22:19:44] Condition is True
[22:19:44] Request action from node AreaAttack
[22:19:44] Condition is False
[22:19:44] Request action from node SpecialAttack
[22:19:44] Condition is True
[22:19:44] Request action from AI action SpecialAttackAction
[22:19:44] Test: Consider Shea for Snap Shot with 7.0 predicted damage
[22:19:44] Test: Adjustet value for wounded target: 14.0
[22:19:44] Test: Adjustet value for aggro: 47.6774414592
[22:19:44] Test: Consider Althea for Snap Shot with 6.0 predicted damage
[22:19:44] Test: Adjustet value for wounded target: 6.0
[22:19:44] Test: Adjustet value for aggro: 8.1328125
[22:19:44] Test: Consider Riley for Snap Shot with 8.0 predicted damage
[22:19:44] Test: Adjustet value for wounded target: 8.0
[22:19:44] Test: Adjustet value for aggro: 15.5
[22:19:44] Test: Choosen target Shea with expected value of 47.6774414592
[22:19:44] Return action for slot SpecialAttack with Snap Shot as slotted skill.
Combat-Log:
Spoiler:
Combat-Log Logfile
08/14/14 22:19:12
[22:19:16] The buff will expire in 3 turns
[22:19:16] SPRegen increased by 10
[22:19:16] HPRegen increased by 10
[22:19:16] Speed increased by 20 %
[22:19:16] Riley buffed Vaelis with Default
[22:19:16] Riley used Energize.
[22:19:19] The buff will expire in 5 turns
[22:19:19] Defense increased by 50 %
[22:19:19] Gamesh Crossbowman A used Armor Skin II.
[22:19:20] The buff will expire in 5 turns
[22:19:20] Defense increased by 50 %
[22:19:20] Gamesh Crossbowman B used Armor Skin II.
[22:19:26] The buff will expire in 7 turns
[22:19:26] SPRegen increased by 10
[22:19:26] Speed decreased by 15 %
[22:19:26] Vaelis used Recover.
[22:19:32] Gamesh Crossbowman B is KO.
[22:19:32] Shea hit Gamesh Crossbowman B for 82 Fire damage using Inferno.
[22:19:32] The Condition will expire in 2 turns
[22:19:32] Attack decreased by 20 %
[22:19:32] Fire decreased by -15 %
[22:19:32] Shea inflicted Burning on Gamesh Crossbowman B
[22:19:32] Gamesh Crossbowman B is staggered.
[22:19:38] Althea hit Gamesh Swordman A for 4 Air damage using Melee Attack.
[22:19:38] Critical Hit!
[22:19:38] Althea hit Gamesh Swordman A for 9 Normal damage using Melee Attack.
[22:19:39] Gamesh Swordman A hit Shea for 7 Normal damage using Snap Shot.
[22:19:40] Gamesh Swordman B hit Shea for 7 Normal damage using Snap Shot.
[22:19:42] Althea hit Gamesh Swordman A for 3 Air damage using Melee Attack.
[22:19:42] Althea hit Gamesh Swordman A for 10 Normal damage using Melee Attack.
[22:19:43] Gamesh Crossbowman A healed Gamesh Crossbowman A for 0 HP using Heal Potion
[22:19:44] Gamesh Swordman A hit Shea for 7 Normal damage using Snap Shot.
[22:19:44] Shea is staggered.
[22:19:45] Vaelis recovered 10 SP thanks to Recover skill.
User avatar
jack1974
Pack leader
Posts: 15482
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Does the Darndest Things

Post by jack1974 »

Yes that part was bugged, I've replaced it with new code now that should behave more cleverly :)
User avatar
fabulaparva
Elder Druid
Posts: 761
Joined: Sun May 04, 2014 9:58 pm

Re: AI Does the Darndest Things

Post by fabulaparva »

I think that yayswords posted about this already earlier (can't find the original post as it's not in this thread) but the Kiduu Pikeman skip*) turns occasionally. I've tried to catch this on the logs, but it's a bit hard because either when I can pinpoint it, I've had the log off, lol, or I can't find the spot when it happened in the log as the combat log has no trace on when a certain enemy should take a turn and the timestamp comparisons between AI and combat logs can get tricky when done afterwards.

(By the way, I find it a bit funny that one can inflict bleed on skeletons. It just feels physio-anatomically wrong. But I'm not suggesting for it to be changed. :P)

*)And by skipping I mean that he does absolutely nothing, no defend, no heal, no guard, no basic attack, niente.
User avatar
jack1974
Pack leader
Posts: 15482
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Does the Darndest Things

Post by jack1974 »

Well the new AI if can't do anything should just Defend as default skill, so if is a bug should show up in the logs, like "executing SKILLNAME" and then nothing should happen.
User avatar
fabulaparva
Elder Druid
Posts: 761
Joined: Sun May 04, 2014 9:58 pm

Re: AI Does the Darndest Things

Post by fabulaparva »

Kiduu Pikeman are not under the new AI as far as I know. Finally caught it:

Ai-Log:
Spoiler:
[22:32:28] Start AI action request for Kiduu Pikeman B
[22:32:28] Request action from node Root
[22:32:28] Condition is True
[22:32:28] Request action from node Staggered
[22:32:28] Condition is False
[22:32:28] Request action from node Guard
[22:32:28] Condition is False
[22:32:28] Request action from node Position
[22:32:28] Condition is True
[22:32:28] Request action from node AreaAttack
[22:32:28] Condition is False
[22:32:28] Request action from node SpecialAttack
[22:32:28] Condition is False
[22:32:28] Request action from AI action AttackAction
[22:32:28] Test: Consider Krimm for Melee Attack with 9.0 predicted damage
[22:32:28] Test: Adjustet value for wounded target: 9.0
[22:32:28] Test: Adjustet value for aggro: 38.5675482126
[22:32:28] Test: Consider Vaelis for Melee Attack with 9.0 predicted damage
[22:32:28] Test: Adjustet value for wounded target: 9.0
[22:32:28] Test: Adjustet value for aggro: 45.7606605177
[22:32:28] Test: Choosen target Vaelis with expected value of 45.7606605177
[22:32:28] Return action for slot Attack with Melee Attack as slotted skill.
[22:32:49] Start AI action request for Kiduu Pikeman B
[22:32:49] Request action from node Root
[22:32:49] Condition is False
[22:32:49] Request action from AI action OverdriveAction
[22:32:49] Return action for slot Overdrive with Poison Dagger as slotted skill.
Combat-Log:
Spoiler:
[22:32:43] Kiduu Pikeman A is KO.
[22:32:43] Althea hit Kiduu Pikeman A for 21 Air damage using Melee Attack.
[22:32:48] Vaelis hit Kiduu Pikeman C for 12 Normal damage using Melee Attack.
[22:32:48] Vaelis hit Kiduu Pikeman C for 17 Normal damage using Melee Attack.
[22:32:49] Bleeding caused Kiduu Pikeman B 7 HP damage
And then it's Riley's turn. Kiduu Pikeman B prepared for Poison Dagger but just took the damage and did nothing on his turn. Same thing happened a bit later with Kiduu Pikeman C, also as he was preparing to use poison dagger.
User avatar
jack1974
Pack leader
Posts: 15482
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Does the Darndest Things

Post by jack1974 »

Ah is the overdrive skill yes, that one had several problems with the old AI, will change the poison dagger to another skill :)
The AI is right, poison dagger needs a specific condition, so that's why doesn't work (unless someone in your party has that). Will check all the overdrive skill in the old AI enemies to be sure!
User avatar
fabulaparva
Elder Druid
Posts: 761
Joined: Sun May 04, 2014 9:58 pm

Re: AI Does the Darndest Things

Post by fabulaparva »

Does the new AI consider Aggro at all? I have gone through some fights using Ranger's Taunt. Ranger's Aggro is almost 70%, Vaelis/Krimm''s Aggros at the same time have been in under 20% or even under 10% and still the Halberdiers tend to target either of them after the first round, not the Ranger. During the first round, Ranger is on the topmost frontrow position and has not used Taunt yet -- if the Halberdiers are to hit him at all, then that seems to be the most probable time. Only the Hammerguards (old AI) keep targeting the one with Highest Aggro . If the new AI is intelligent enough to disregard the "I'm taunting you because I have the Bramble Coat/Mirror damage on me"-trap, then the usefulness of the Taunt skill has just been divided by a toppled-over 8. :P
User avatar
jack1974
Pack leader
Posts: 15482
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Does the Darndest Things

Post by jack1974 »

I can now define their behavior, so in some case their attacks are influenced by the aggro, in others not. I can have the AI target the weakest members, or even (using prediction) hit party member that will receive more damage with the selected skill.
As you can imagine ignoring the aggro makes the battles harder, still it should have some effect, so will check again and make more skill use the aggro to determine the target.
Post Reply