[1.0.4] Tactical AI skips buff opportunities
Posted: Mon Sep 02, 2013 7:04 am
Here is the code, about line 360 of tactical.lua:
But in most cases, slingers and archers see you outside their range, so they have no attack options, meaning want.attack is false.
This is easy to see, as it happens every time in the arena.
I've added info to the log from tactical.lua, to study it, and here is the slinger's first move:
So even though Rapid Shot is weighted heavily at 40.77, want.attack is nil, because within_range is false for all shooting talents.
I'm not sure how the code should be changed to fix this bug though. Suggestions anyone?
Code: Select all
-- Need buffs
if avail.buff and want.attack and want.attack > 0 then
want.buff = math.max(0.01, want.attack + 0.5)
game.logSeen(self, ">>>>> tactical ai wants buff: %0.2f", want.buff)
end
This is easy to see, as it happens every time in the arena.
I've added info to the log from tactical.lua, to study it, and here is the slinger's first move:
Code: Select all
AI took for target 33476 halfling slinger :: 17687 thought-forged warrior 81 < 100
[LOG] >>>>> tactical ai talents testing: Inertial Shot, T_INERTIAL_SHOT; mode: activated; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: true; within_range: false;
[LOG] >>>>> tactical ai talents testing: Attack, T_ATTACK; mode: activated; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: true; within_range: false;
[LOG] >>>>> tactical ai talents testing: Reload, T_RELOAD; mode: activated; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: nil; within_range: false;
[LOG] >>>>> tactical ai talent is available to use: Reload, T_RELOAD
[LOG] >>>>> tactical ai talents can use: Reload, ammo. Weight: 3.55
[LOG] >>>>> tactical ai talents testing: Shoot, T_SHOOT; mode: activated; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: true; within_range: false;
[LOG] >>>>> tactical ai talents testing: Rapid Shot, T_RAPID_SHOT; mode: sustained; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: nil; within_range: false;
[LOG] >>>>> tactical ai talent is available to use: Rapid Shot, T_RAPID_SHOT
[LOG] >>>>> tactical ai talents can use: Rapid Shot, buff. Weight: 40.77
[LOG] >>>>> tactical ai talents testing: Heave, T_HEAVE; mode: activated; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: true; within_range: false;
[LOG] >>>>> tactical ai talents testing: Disengage, T_DISENGAGE; mode: activated; no_npc_use: 0; cooling down: false; pre-use satisfied: true; requires target: true; within_range: false;
[LOG] >>>>> tactical ai wants ammo: 0.00
[LOG] >>>>> tactical ai wants escape: 0.00
I'm not sure how the code should be changed to fix this bug though. Suggestions anyone?