# A minor pet-peeve about computer games - NPCs with 'knowledge' of your actions.

**URL:** <https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139>\
**Category:** The Game Room\
**Created:** [January 6, 2009, 9:57pm UTC](https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139 "2009-01-06T21:57:58Z")\
**Posts on this page:** 4\
**Page:** 3

<div class="post-metadata">

**Author:** ![Ferret\_Herder](https://avatars.discourse-cdn.com/v4/letter/f/e47774/32.png) [@Ferret\_Herder](https://boards.straightdope.com/u/Ferret_Herder)\
**Post date:** [January 8, 2009, 5:03pm UTC](https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139/41 "2009-01-08T17:03:15Z")

</div>

> [@Jolly\_Roger](#):
>
> The one that welcomes you to join his hunt (after you do a few tasks for him) is [Nesingway Jr](http://www.wowwiki.com/Hemet_Nesingwary_Jr.)., I believe. they are two different NPCs. Its concievable that one may not have knowledge of what the other is doing. (I could be wrong, I have not played a quest with the senior Nesingway yet.)

Ah, that’s a complicated tale.

Before WoW had any expansions, [Hemet Nesingwary](http://www.wowwiki.com/Hemet_Nesingwary) was out in Stranglethorn Vale, in the “old world” continent of the Eastern Kingdoms. Then the Burning Crusade expansion came out, and Nesingwary couldn’t resist the lure of new things to hunt. He relocated to the new world of Outland, settling down with a crew in the region called Nagrand, and left his son behind to continue the hunt in Stranglethorn Vale.

Now with the expansion of Wrath of the Lich King, the senior Nesingwary somehow manages to hunt both out in Nagrand (on another world, remember), and to have relocated to the newly-explored continent of Northrend on the original world, where he’s set up a hunt camp in an area called Sholazar Basin.

Barring the world-hopping tactics he’s undertaking (hey, if I can do it, so can he, right?), I like to non-canonically resolve the PETA-parody quest line with the friendly Nesingwary by saying that former associates of his have split off from his group, driven to madness by the lust to kill (why else would they attack other people on sight with no provocation?), and he doesn’t mention them out of embarrassment for ever having been associated with these madmen. Meanwhile, the Animal Huggers don’t realize there’s been a schism, especially with the killers still claiming to be Nesingwary’s hunting crew (a certain glamour became associated with being that skilled to hunt with him), and have targeted a more dangerous group while missing entirely where the old leader really is.

---

<div class="post-metadata">

**Author:** ![Lightnin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lightnin/32/180_2.png) [@Lightnin](https://boards.straightdope.com/u/Lightnin)\
**Post date:** [January 8, 2009, 5:40pm UTC](https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139/42 "2009-01-08T17:40:07Z")

</div>

I’ve got two for WoW.

Last night, flying around Icecrown, a sentry dragon suddenly appeared next to me. Of course, being an NPC, it’s allowed to fly and shoot at me- and eventually it knocked me off my mount, so I fell to my death.

Okay, now I know. The next time I run into one, I’m flying close to the ground, so that if I get jumped by another sentry dragon, I can just land so I won’t die. It doesn’t work, though. I got jumped again, and managed to land before it knocked me off… and then it kept hovering out of melee range, shooting at me!

I’m playing a Death Knight- so I’ve only got, realistically, one method for dealing with ranged critters: Death Grip (which grabs the enemy and yanks him over to you). However… Death Grip can’t grab anyone who’s flying!

sigh. So I ran over a ridge, to try to break line of sight, to force him to come closer to me… and the bastard keeps shooting me \*through \*the terrain! Worse, his shots are ice bolts- they slow me down. I don’t even have a chance to run away. I die again.

So, basically, the damn things are just going to kill me. I’m forced to hug the canyon walls, and hope none of them get close enough.

…

However, there’s another “cheat”, one which I guess more than makes up for the cheating bad guys. With the proper video settings, I can see mobs a long way, sometimes out to the horizon. At least as long as a creature doesn’t just spawn on top of me, I’ve got plenty of warning so I can avoid him or plan my strategy.

The bad guys, though, are incredibly myopic- they can only see me if I get within their aggro range… which is typically about 50 feet or so. That particularly bugs me in instances- if the two guards sitting at a gate are sufficiently far apart, you can walk between them and they won’t even see you, even though you’re standing right in front of them. You’d think they’d have a better vision plan, in their line of work…

---

<div class="post-metadata">

**Author:** ![The\_Hamster\_King](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@The\_Hamster\_King](https://boards.straightdope.com/u/The_Hamster_King)\
**Post date:** [January 8, 2009, 5:59pm UTC](https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139/43 "2009-01-08T17:59:25Z")

</div>

> [@panamajack](#):
>
> Forgive me for saying, “It wouldn’t be that hard if …” but I think it would at least be nice to do range detection first followed by line of sight to/through the incoming missile/object as a double check. It would not add a great deal of extra time given the rarity of incoming shots, and might even feel a bit realistic, for example if you fire and duck out of sight you might not get noticed until they’re hit, but if you’re still standing in plain sight, their catlike reflexes will see you and react. That only goes to one part of the problem, but I think it would work (maybe it has been done already.)

Games do all sorts of different things to handle the problem efficiently. A typical solution is to have a weighting fuction that determines how often individual enemies perform LOS checks. The function factors in things like distance from the player and alertness level. If an enemy is being shot at their alertness level should spike and trigger high-frequency LOS checks.

---

<div class="post-metadata">

**Author:** ![The\_Hamster\_King](https://avatars.discourse-cdn.com/v4/letter/t/8edcca/32.png) [@The\_Hamster\_King](https://boards.straightdope.com/u/The_Hamster_King)\
**Post date:** [January 8, 2009, 6:23pm UTC](https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139/44 "2009-01-08T18:23:08Z")

</div>

> [@Projammer](#):
>
> I have played around a little with 3D game programming and LOS calculations are very much not trivial. To do true LOS coding for the NPCs, the computer would have to create a virtual screen for every NPC that you are in it’s detection range.

That’s overkill, though … no pun intended. 🙂

Half a dozen rays traced to different parts of the player character’s bounding volume is good enough for almost every situation. Often a single ray to the center of mass is good enough.

LOS checks are one of those things that intuitively feel like they should be trivial for a computer to do, but actually are a lot of work. In the real world if I look out the window it’s obvious if I can see someone or not. But in a game LOS is determined by tracing a line from the AI to the target and comparing it to _every single polygon in the scene_ to see if they intersect. If there are 10,000 polygons in the world geometry you need to test your line against each one every time you perform a LOS check.

(There are all sorts of culling strategies that can be used to keep this number as low as possible. For example it’s common to organize world geometry in groups surrounded by bounding boxes. You check to see if your line intersects the bounding box first, and if it doesn’t you ignore all the polygons inside.)

Alternatively, as \*\*Projammer \*\*points out, you can use the rendering pipeline to render a low-res version of the scene from the viewpoint of the AI. Either way you’re often talking tens of thousands of operations just for a single check.

[Previous page](https://boards.straightdope.com/t/a-minor-pet-peeve-about-computer-games-npcs-with-knowledge-of-your-actions/480139.md?page=2)
