Creatures are unique objects in so far as they have line of sight and perception routines that alter their behaviour pretty heavily. You can test line of sight of any two objects or any two positions with NWscript and the game uses Line of Sight to alter what can be seen and heard in game, and what is displayed to creatures (PC and NPC).

Perception Ranges

Ranges.2da holds the info on creture and PC perception ranges. Note the game has a hardcoded 40.0M range on any visibility (this is why non-static placeables spawn slightly earlier than NPCs)

           Label              PrimaryRange   SecondaryRange   Name      
8          PercepRngShrt      10             10               6668
9          PercepRngMed       20             20               6669
10         PercepRngLng       35             20               6670
11         PercepRngDefault   ****           ****             6671
12         PercepRngPlayer    35             20               ****
13         PercepRngMonster   28             15               ****

Irrelevant lines removed. Column information:

  • PrimaryRange - The "sight" range of the creature
  • SecondaryRange - The "listen" range of the creature

The ranges are hardcoded into the engine slightly it appears:

  • PercepRngPlayer is used for the players perception range - so yeah, can see the most all the time
  • PercepRngDefault is a special one - it loads it from appearance.2da. Most appearances default to Medium, with more boss like ones such as dragons being Long
  • PercepRngShrt, PerceptRngMed, PercepRngLng are monster perception ranges selectable in the toolset. Long probably should match Player.
  • PerceptRngMonster is what in-combat AI get set to if their perception is lower than usual, eg; if set to Short range it's barely 1 tile distance, if attacked at range then they suddenly can see 28M (still not perfect but better than 10M!)

Note that weapons appear to have a hardcoded range slightly higher than 35M, probably 40M, which means technically - if left alone - a player could hit something it couldn't technically see if it walks slowly out of 35M range to say, 38M range. The weapon ranges in this 2da don't do anything.

Perception States

Creatures maintain a constant collection of states between them and other creatures known as perception lists. These contain items for Heard and Seen. AI scripts tend to rely on this list for checking if an enemy is able to be attacked. Players rely on this list so the game shows them what they can and can't attack.

Seen (Spot/Hide)

You need Line of Sight to see a creature (see below for notes on Line of Sight). A seen creature appears normally - that is, the model loads in with no effects. You can click on it to attack, ranged weapons and ranged spells will target them.

If a creature is in stealth mode, then you must succeed in a Spot check against their Hide ability (or you must have True Seeing). Once spotted they will remain seen until LOS is broken or Hide In Plain Sight is used.

If a creature is under some kind of invisibility effect, you can still see them if you have the correct counter (eg; See Invisibility for Invisibility).

Being blinded makes all other creatures unseen, but can be countered by blindsight. Blindsight is a special feat (there are 3 but only 1 is usually available and to monsters only) which basically makes everything in a certain distance seen regardless of your or their state (blindness, invisibility, etc.).

Not seeing a creature may still allow you to hear them, see below for more on hearing.

Heard (Listen/Move Silently)

You do not need Line of Sight to hear a creature - you can for instance listen through doors or around corners (not sure what determines how easy this is however). However ranged attacks on heard creatures requires LOS.

If a creature is in stealth mode, then you must succeed on a Listen check against their Move Silently ability.

If a creature is under a silence effect it can never be heard.

If you are blinded, or a creature is under a form of invisibility to you, then you rely on listen checks. Usually this means

State Table

SeenHeardActions availableNotes
YesYesAll actions are available
YesNoAll actions are availableNote this state can't really ever happen, except when Deaf, and even then it won't affect what actions are chosen (even though deafness will cause a spellcasting penalty)

No direct targeting of spells

Melee works once close enough

Ranged will work if inside of LOS

NoNoNone directly but still affected by AOE spellsThe creature is entirely removed from perception (their model even disappears for players)

Spot and Listen Checks

From here: (thanks NWN Fandom Wiki)

Detect Mode:

Passive (default) mode

  • Trap detection radius: 5ft
  • Trap detection rate: 6 seconds (every round)
  • Trap detection roll: d20
  • Spot/Listen roll: d10

Active (Detect) mode

  • Trap detection radius: 10ft
  • Trap detection rate: 3 seconds (twice per round)
  • Trap detection roll: d20
  • Spot/Listen roll: d20

Stealth checks

  • Player detects stealth: 5 times per second
  • Player rolls for hide/move silently/spot/listen: 6 seconds
  • NPC detects stealth: 4 seconds
  • NPC rolls for hide/move silently/spot/listen: 6 seconds

Listen/Move Silently checks:

  • Automatically cannot detect silenced creatures
  • Can only detect invisible (or when you're blind) creatures within the max attack range.
  • Cannot hear sanctuaried creatures
  • If there is something between you and the target (including creatures) there's a modifier of +5 DC for every 40cm of thickness in outdoor areas
  • In indoor areas, if the LOS is blocked and the target is within 4 tiles (dfs search) there's a modifier of +2 DC
  • Area listen check modifiers
    • +10 DC if you are in combat
    • +5 DC if the target is standing still
    • -5 DC if you are standing still
    • +1 DC for every 3 meters of distance to the target
  • Relative size modifiers (Tiny: +8, Small: +4, Medium: 0, Large: -4, Huge: -8)
  • Favoured enemy bonuses

Spot/Hide In Shadows:

  • Automatically cannot detect invisible creatures
  • Automatically cannot detect anything while blinded
  • Area spot check modifiers
    • During Night, if you do not have a light on you (including weapon lights and darkvision) there is a +5 DC modifier
    • During Night, if the target has a light on them, there is a -10 DC modifier
    • For stealthed players only, there is a +5 DC if they are in the back arc
  • +10 DC if you are in combat
  • +5 DC if the target is standing still
  • -5 DC if you are standing still
  • Relative size modifiers (Tiny: +8, Small: +4, Medium: 0, Large: -4, Huge: -8)
  • Favoured enemy bonuses

Line of Sight

Line of Sight can be tested using the NWscript commands LineOfSightObject and LineOfSightVector.

Head Height Right? No!

The object version takes into account the "creature vision" usually applied to an X/Y coordinate position, by adding 1.0M to Z ground height. This means yes, you must have your torso see between a giants legs to "see" them. See this diagram for how height differences really mess this up especially on larger creatures (both them looking at others, and others looking at them). Huge creatures also have the point further from their model edge, making it even more weird around corners where you can see a huge leg sticking out but can't "see" the creature it is from.

A picture paints a thousand words and Paint is easy to get a picture made in (wink) For instance the below Huge monster is unable to be seen by the puny human looking up at them due to the terrain height difference. This is in spite of the fact both can logically see each other head-to-head vision wise.

Why is it like this? Well, the game is rather old, Line of Sight checks are rather costly (it has to draw a line and check if it intersects any terrain blocking it) and this also makes things "fair" - in so far as halflings and gnomes can see more and dragons can see less (and be seen by less) and more consistent (since spells and arrows need LOS).

Updating it would be nice though, in so far as terrain blocking heads is a lot less common than that blocking random midpoints between legs, although it'd probably need both LOS checks to work correctly (so someones head who is too tall could still see something at a lower level and vice versa you don't need to see the giants head to see their legs).

  • No labels