Difference between revisions of "Category:Detection"

2,615 bytes added ,  13:05, 7 March 2013
no edit summary
imported>Scruggs
(migck's note on dead actors also applies when using SetUnconscious; the game forgets to recalculate detection levels in both cases)
imported>Saebel
Line 127: Line 127:
A final note: The target-is-in-combat bonus is fairly significant.  Combined with the much lower combat threshold, this can make it ''very'' difficult for an actor to return to hiding once a hostile actor has seen them.
A final note: The target-is-in-combat bonus is fairly significant.  Combined with the much lower combat threshold, this can make it ''very'' difficult for an actor to return to hiding once a hostile actor has seen them.


==Note==
==Performance==
The detection formula runs on all active NPCs/Creatures all the time and is applied to all other NPCs/Creatures, not just the player.  Therefore, as the number of active actors in an area increase, the number of detection calls made increases exponentially.
{|border="1" cellpadding="5" cellspacing="0"
|-
! style="background:#efefef;" | <center> # of actors in the area </center>
! style="background:#efefef;" | <center> # of detection calls </center>
|-
| 1 actor
| 1 detection call towards the player
|-
| 2 actors
| 4 detection calls. 2 towards the player, and 1 each as the 2 actors detect each other.
|-
| 3 actors
| 9 detection calls. 3 towards the player, and 2 each as the 3 actors detect each other.
|-
| 4 actors
| 16 detection calls.
|-
| 10 actors
| 100 detection calls.
|-
| 15 actors
| 225 detection calls.
|-
| 20 actors
| 400 detection calls.
|-
| 30 actors
| 900 detection calls.
|}
 
With default Oblivion, you will rarely run into large numbers of NPCs/creatures, but in a heavily modded Oblivion, this can have a noticeable effect on performance when the player enters highly populated areas.  Detection is probably not the only Oblivion feature that behaves like this, but it's the one that we for sure know behaves this way.
 
Any mod that alters the detection formula (such as SDR) in combination with mods that increase the population density will therefore potentially impact performance as well, depending on how the mod is designed and implemented.
 
==Detection Functions==
 
[[IsActorDetected]] does not appear to call the detection formula, since it does not require both the target and detector to function.  It is the simplest method of determining whether an actor is being detected at any given time.
 
[[GetDetectionLevel]] does not appear to call the detection formula either, and may be the most efficient method of determining the detection result of a detector/target pair, especially when a mod that alters detection (like SDR) is in the load order.  Although it is unknown whether or not the result is based on Oblivion's native detection results or the detection altering mod's results.  The theory is that each detection result of target to detector is tracked internally, and is merely looked up by the GetDetectionLevel function.
 
[[GetDetected]], on the other hand, forces Oblivion to run the entire detection formula, and therefore any mod that alters or hooks that formula will have its sub-scripts called.  Depending on how often it is used, this could potentially cause performance issues.
 
==Notes==


* Dead actors seem to have their detection status "locked in" at whatever value it was when they died. This means an actor aware of the player when the player kills him, will ''always'' be considered aware of the player (though this does not matter since the actor is dead). It is therefore important in scripts which check detection levels to also make sure that the "detector" is, in fact, alive, in addition to checking other detection settings.
* Dead actors seem to have their detection status "locked in" at whatever value it was when they died. This means an actor aware of the player when the player kills him, will ''always'' be considered aware of the player (though this does not matter since the actor is dead). It is therefore important in scripts which check detection levels to also make sure that the "detector" is, in fact, alive, in addition to checking other detection settings.
Line 134: Line 178:
==See Also==
==See Also==
[[Sneak]]
[[Sneak]]
[[GetDetectionLevel]]
[[GetDetected]]
[[IsActorDetected]]




Anonymous user