Improved NPC Targeting

A place to post your add ons and ideas for them

Moderator: Moderator

Message
Author
Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Improved NPC Targeting

#1 Post 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.
Last edited by Hachem_Muche on Sun Sep 15, 2013 5:56 pm, edited 1 time in total.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

spiralrazor
Thalore
Posts: 151
Joined: Mon Oct 24, 2011 8:05 pm

Re: Improved NPC Targeting

#2 Post 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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Improved NPC Targeting

#3 Post by HousePet »

That would depend on whether the current targeting method uses any cheating.
If so, this change would make it much fairer.
My feedback meter decays into coding. Give me feedback and I make mods.

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Improved NPC Targeting

#4 Post 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.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Improved NPC Targeting

#5 Post 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
MADNESS rocks

Crim, The Red Thunder
Sher'Tul Godslayer
Posts: 2000
Joined: Fri May 07, 2004 8:26 pm
Location: Nahgharash

Re: Improved NPC Targeting

#6 Post 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?
Currently playing under the name Aura of the Dawn 4 down, 227 to go!
Proud author of Orc Pit Restoration Project, Faction Allies, Dwarven Adventurer addons
SadistSquirrel wrote:DarkGod has two arms, one with an opened hand, one with a closed fist. You got the fist.

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Improved NPC Targeting

#7 Post 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.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Improved NPC Targeting

#8 Post 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.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Improved NPC Targeting

#9 Post by jenx »

I'm getting bad addon message with the latest versionof this.
MADNESS rocks

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Improved NPC Targeting

#10 Post 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.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Improved NPC Targeting

#11 Post 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
MADNESS rocks

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Improved NPC Targeting

#12 Post 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?
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

jenx
Sher'Tul Godslayer
Posts: 2263
Joined: Mon Feb 14, 2011 11:16 pm

Re: Improved NPC Targeting

#13 Post 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
MADNESS rocks

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: Improved NPC Targeting

#14 Post 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).
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

Jeoshua
Cornac
Posts: 37
Joined: Sat Sep 14, 2013 2:08 pm

Re: Improved NPC Targeting

#15 Post by Jeoshua »

Validates now, new version, new thread here:

http://forums.te4.org/viewtopic.php?f=5 ... 0&start=15
Last edited by Jeoshua on Mon Sep 16, 2013 11:42 pm, edited 1 time in total.

Post Reply