Page 1 of 2

Improved NPC Targeting

Posted: Sat Jul 27, 2013 6:08 pm
by Hachem_Muche
This addon is a buff for NPC's.
It improves the way NPC's locate and keep track of the player when they can't see or otherwise detect him/her.

Tracking is less random, has a limited amount of error, and is more consistent from turn to turn.

The tooltip for NPC's has been updated to give stealthed/invisible players a hint about which enemies have successfully detected them.

This addon is compatible with ToME 1.0.5, commit a801604d1610f49560862d15dfaecd03fda8ab40

It includes changes to:

engine.interface.ActorAI.lua
mod.class.NPC.lua

It can be downloaded at:
http://te4.org/games/addons/tome/npc-ta ... provements

In debug mode the tooltip will show where NPC's think a stealthed/invisible player is if they've lost track.

Re: Improved NPC Targeting

Posted: Sat Jul 27, 2013 8:34 pm
by spiralrazor
I don't think npcs need to be buffed in this way. they already pretty much autodetect you unless you have crazy high lvls of the skill(stealth) and if buffed, invis will be even more useless then it already is.

Re: Improved NPC Targeting

Posted: Sun Jul 28, 2013 2:56 am
by HousePet
That would depend on whether the current targeting method uses any cheating.
If so, this change would make it much fairer.

Re: Improved NPC Targeting

Posted: Sun Jul 28, 2013 6:01 pm
by Hachem_Muche
This addon doesn't change the chance for NPC's to detect you, it makes them guess better where you are when they lose track of you. In addition, it gives the player a hint which way the NPC's are looking on the tooltip.

NPC's already cheat a little bit (The game knows where you are exactly, but gives the NPC's a pretty large fuzz radius depending on how long it's been since they last saw you). This addon keeps them from being helpless just around a corner because their guesses are too random.

Re: Improved NPC Targeting

Posted: Mon Sep 02, 2013 2:57 am
by jenx
I'm getting endless lua errors, even when all other addons are removed:

Code: Select all

error = "Lua Error: .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:39: attempt to call method 'clearAITarget' (a nil value)\
  At [C]:-1 clearAITarget\
  At .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:39 doAI\
  At /mod/class/NPC.lua:61 act\
  At /engine/GameEnergyBased.lua:126 tickLevel\
  At /engine/GameEnergyBased.lua:62 tick\
  At /engine/GameTurnBased.lua:46 tick\
  At /mod/class/Game.lua:1054 "
seen = true
reported = true

Re: Improved NPC Targeting

Posted: Mon Sep 02, 2013 4:59 am
by Crim, The Red Thunder
Is this inability to find and path to you related to enemies being stuck in walls and not pathing their way out, or is that a completely unrelated problem? And would enabling this addon solve the problem of things like sandworm queen/Telos/Aletta/etc getting stuck in walls?

And in the hope that the answer is yes, If I edit this addon into a savefile, will it apply the new pathing algorithms to creatures already in existence? Or only creatures generated afterwards?

Re: Improved NPC Targeting

Posted: Mon Sep 02, 2013 6:27 am
by Hachem_Muche
jenx wrote:I'm getting endless lua errors, even when all other addons are removed:

Code: Select all

error = "Lua Error: .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:39: attempt to call method 'clearAITarget' (a nil value)\
  At [C]:-1 clearAITarget\
  At .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:39 doAI\
  At /mod/class/NPC.lua:61 act\
  At /engine/GameEnergyBased.lua:126 tickLevel\
  At /engine/GameEnergyBased.lua:62 tick\
  At /engine/GameTurnBased.lua:46 tick\
  At /mod/class/Game.lua:1054 "
seen = true
reported = true
I've uploaded an revised version at http://te4.org/games/addons/tome/npc-ta ... ovements-0

No idea how I missed that obvious error before.

Re: Improved NPC Targeting

Posted: Mon Sep 02, 2013 6:38 am
by Hachem_Muche
Crim, The Red Thunder wrote:Is this inability to find and path to you related to enemies being stuck in walls and not pathing their way out, or is that a completely unrelated problem? And would enabling this addon solve the problem of things like sandworm queen/Telos/Aletta/etc getting stuck in walls?

And in the hope that the answer is yes, If I edit this addon into a savefile, will it apply the new pathing algorithms to creatures already in existence? Or only creatures generated afterwards?
Adding this addon into the desc.lua file in the save folder will enable the new detection algorithms as soon as you reload the character.
I'm not sure what the problem is with certain NPCs (like the Sandworm Queen) in walls not finding the player, but this addon should help them find you once they get you targeted. So it's worth a try and it won't hurt anything. I suspect that the problem is an issue with level generation and NPC placement.

Re: Improved NPC Targeting

Posted: Thu Sep 05, 2013 8:40 pm
by jenx
I'm getting bad addon message with the latest versionof this.

Re: Improved NPC Targeting

Posted: Sat Sep 07, 2013 9:07 pm
by Hachem_Muche
I've posted a new version (configured for ToME version 1.0.4), but the server appears to be slow to update.

You can download it here: http://te4.org/sites/default/files/game ... et1.2.teaa

Let me know if there's still problems getting it to validate.

Re: Improved NPC Targeting

Posted: Thu Sep 12, 2013 1:41 pm
by jenx
Hachem_Muche wrote:I've posted a new version (configured for ToME version 1.0.4), but the server appears to be slow to update.

You can download it here: http://te4.org/sites/default/files/game ... et1.2.teaa

Let me know if there's still problems getting it to validate.
new lua errors all the time, e.g. with deep below boss:

Code: Select all

error = "Lua Error: .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:93: attempt to index local 'LSeen' (a number value)\
  At [C]:-1 __index\
  At .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:93 aiSeeTargetPos\
  At .../addons/NPCTarget/superload/engine/interface/ActorAI.lua:50 doAI\
  At /mod/class/NPC.lua:61 act\
  At /engine/GameEnergyBased.lua:126 tickLevel\
  At /engine/GameEnergyBased.lua:62 tick\
  At /engine/GameTurnBased.lua:46 tick\
  At /mod/class/Game.lua:1054 "
seen = true
reported = true

Re: Improved NPC Targeting

Posted: Thu Sep 12, 2013 9:08 pm
by Hachem_Muche
I'm having trouble reproducing this error. Is this under 1.0.4 or git and do you have any other addons running?

Re: Improved NPC Targeting

Posted: Thu Sep 12, 2013 11:16 pm
by jenx
Hachem_Muche wrote:I'm having trouble reproducing this error. Is this under 1.0.4 or git and do you have any other addons running?
I have better tactical ai, tough dumb ai, store wish list, rest tweaks.

running 1.0.4

Re: Improved NPC Targeting

Posted: Sat Sep 14, 2013 4:47 pm
by Hachem_Muche
Still can't get this error.

Started a new character (rogue) with NPC Targeting and the latest versions of better tactical ai, tough dumb ai, store wish list, and rest tweaks. Ran around in the Trollmire and The Deep Bellow (against the boss).

Re: Improved NPC Targeting

Posted: Sun Sep 15, 2013 12:50 am
by Jeoshua
Validates now, new version, new thread here:

http://forums.te4.org/viewtopic.php?f=5 ... 0&start=15