Page 1 of 1
question about tactical AI
Posted: Thu Sep 22, 2011 5:04 pm
by marvalis
I am trying to figure out why the shade in the example below is not using tidal wave and battle call.
Code: Select all
============================== TACTICAL AI The Shade
The Shade 1073 tactical ai talents testing Battle Call T_BATTLE_CALL
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Battle Call T_BATTLE_CALL closein weight 4.7184299145073
The Shade 1073 tactical ai talents testing Tidal Wave T_TIDAL_WAVE
The Shade 1073 tactical ai talents testing Attack T_ATTACK
The Shade 1073 tactical ai talents testing Manathrust T_MANATHRUST
The Shade 1073 tactical ai talents testing Weapons Mastery T_WEAPONS_MASTERY
The Shade 1073 tactical ai talents testing Rune: Manasurge T_RUNE:_MANASURGE_1
The Shade 1073 tactical ai talents can use Rune: Manasurge T_RUNE:_MANASURGE_1 mana weight 2.0715669459446
The Shade 1073 tactical ai talents testing Stamina Pool T_STAMINA_POOL
The Shade 1073 tactical ai talents testing Mana Pool T_MANA_POOL
Tactical ai report for The Shade
* escape 8.3677602740994 (mult) nil
* mana 1.1281277984032 (mult) nil
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:09 pm
by marvalis
Probably this:
Code: Select all
ai = "tactical", ai_state = { talent_in=3, ai_move="move_astar", },
Ill see if I can dig out what that means.
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:21 pm
by edge2054
Tidal Wave has an escape weight with fairly low attack and disable weights. He'll probably only use that when he wants to get away.
Battle Call probably needs this.
Code: Select all
direct_hit = true,
requires_target = true,
Right now I don't believe the AI knows it can hit you with the talent.
As to the ai state it means he won't even use talents that often and doesn't have a preference to ranged or melee as long as he's able to hit you and his life isn't to low.
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:28 pm
by marvalis
Code: Select all
The Shade 1073 tactical ai talents testing Tidal Wave T_TIDAL_WAVE
[DEBUG] hit self!
[DEBUG] hit a foe!
After adding
Code: Select all
direct_hit = true,
requires_target = true,
Do I also need to add friendly fire or something?
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:34 pm
by edge2054
Nah, friendlyfire is already set to false on it. The AI should know that based on how it's built. That target function gets passed to the AI I believe.
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:37 pm
by marvalis
Adding friendly_fire=false, made it use tidal wave,
But it is still not using battle shout. I gave it a close in value of 4 :/. Let me try even more.
Code: Select all
============================== TACTICAL AI The Shade
The Shade 1073 tactical ai talents testing Battle Call T_BATTLE_CALL
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Battle Call T_BATTLE_CALL closein weight 8.6733770822077
The Shade 1073 tactical ai talents testing Tidal Wave T_TIDAL_WAVE
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Tidal Wave T_TIDAL_WAVE disable weight 3.3562389120154
The Shade 1073 tactical ai talents can use Tidal Wave T_TIDAL_WAVE escape weight 3.117337122213
The Shade 1073 tactical ai talents can use Tidal Wave T_TIDAL_WAVE attackarea weight 6.3506582982471
The Shade 1073 tactical ai talents testing Attack T_ATTACK
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Attack T_ATTACK attack weight 1.2902114852858
The Shade 1073 tactical ai talents testing Manathrust T_MANATHRUST
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Manathrust T_MANATHRUST attack weight 4.3701257967499
The Shade 1073 tactical ai talents testing Weapons Mastery T_WEAPONS_MASTERY
The Shade 1073 tactical ai talents testing Rune: Manasurge T_RUNE:_MANASURGE_1
The Shade 1073 tactical ai talents can use Rune: Manasurge T_RUNE:_MANASURGE_1 mana weight 1.8363074703698
The Shade 1073 tactical ai talents testing Stamina Pool T_STAMINA_POOL
The Shade 1073 tactical ai talents testing Mana Pool T_MANA_POOL
Tactical ai report for The Shade
* disable 15.598440409218 (mult) nil
* mana 1.8977836302365 (mult) nil
* attack 9.0106467726406 (mult) nil
* attackarea 12.78899419459 (mult) nil
Tactical choice: disable T_TIDAL_WAVE
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:42 pm
by marvalis
Yeh, for whatever reason closein wasn't working
Adding disable 2 got me this;
I still do not know why close in didn't trigger the use.
Code: Select all
============================== TACTICAL AI The Shade
The Shade 1073 tactical ai talents testing Battle Call T_BATTLE_CALL
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Battle Call T_BATTLE_CALL disable weight 4.1345439211061
The Shade 1073 tactical ai talents can use Battle Call T_BATTLE_CALL closein weight 8.2835003583756
The Shade 1073 tactical ai talents testing Tidal Wave T_TIDAL_WAVE
[DEBUG] hit self!
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents testing Attack T_ATTACK
The Shade 1073 tactical ai talents testing Manathrust T_MANATHRUST
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Manathrust T_MANATHRUST attack weight 4.4663360322818
The Shade 1073 tactical ai talents testing Weapons Mastery T_WEAPONS_MASTERY
The Shade 1073 tactical ai talents testing Rune: Manasurge T_RUNE:_MANASURGE_1
The Shade 1073 tactical ai talents can use Rune: Manasurge T_RUNE:_MANASURGE_1 mana weight 1.574653552763
The Shade 1073 tactical ai talents testing Stamina Pool T_STAMINA_POOL
The Shade 1073 tactical ai talents testing Mana Pool T_MANA_POOL
Tactical ai report for The Shade
* mana 1.1249417027713 (mult) nil
* disable 17.526008540806 (mult) nil
* attack 9.000577586129 (mult) nil
Tactical choice: disable T_BATTLE_CALL
[LOG] The Shade uses Battle Call.
[LOG] Player is called to battle!
Re: question about tactical AI
Posted: Thu Sep 22, 2011 5:50 pm
by marvalis
Even putting close in to 10 does not make the shade use it at all:
Code: Select all
============================== TACTICAL AI The Shade
The Shade 1073 tactical ai talents testing Battle Call T_BATTLE_CALL
[DEBUG] hit a foe!
The Shade 1073 tactical ai talents can use Battle Call T_BATTLE_CALL closein weight 20.426805774301
The Shade 1073 tactical ai talents testing Tidal Wave T_TIDAL_WAVE
The Shade 1073 tactical ai talents testing Attack T_ATTACK
The Shade 1073 tactical ai talents testing Manathrust T_MANATHRUST
The Shade 1073 tactical ai talents testing Weapons Mastery T_WEAPONS_MASTERY
The Shade 1073 tactical ai talents testing Rune: Manasurge T_RUNE:_MANASURGE_1
The Shade 1073 tactical ai talents testing Stamina Pool T_STAMINA_POOL
The Shade 1073 tactical ai talents testing Mana Pool T_MANA_POOL
Tactical ai report for The Shade
(nothing)
And I am still getting this:
Code: Select all
The Shade 1073 tactical ai talents testing Tidal Wave T_TIDAL_WAVE
[DEBUG] hit a foe!
[DEBUG] hit self!
So friendly_fire= false did not solve anything.
Re: question about tactical AI
Posted: Thu Oct 20, 2011 3:28 am
by yufra
Your first problem is that there is "friendlyfire" and a "selffire" attribute. You need to set "selffire" to False.
For your second problem I'll step through how the tactical AI works. The available talents are all evaluated to figure out their tactical subtypes and respective weights. That is what you are seeing in the first bit of the log, where each talent is tested. After the talents are categorized the immediate needs (or wants as the table is called) are evaluated, shown here:
Tactical ai report for The Shade
* disable 15.598440409218 (mult) nil
* mana 1.8977836302365 (mult) nil
* attack 9.0106467726406 (mult) nil
* attackarea 12.78899419459 (mult) nil
Finally the highest weighted talent from the highest weighted need is chosen:
Tactical choice: disable T_TIDAL_WAVE
So the real question is why does "closein" not show up in the wants table? Well the "closein" need is special in that it requires a flag set in the ai_tactic table to indicate that the NPC does indeed want to be closer to the target. This is automatically set if you use the "melee" or "tank" resolvers, but otherwise is nil. Maybe we should change the default behavior to always on, and let NPCs opt out of that instead?