Difference between revisions of "Category talk:Detection"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Scruggs
(Yes)
imported>Migck
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Line of Sight ==
== Line of Sight ==
Does whether or not you're in the origin's line of sight affect their ability to spot you? --[[User:Ronyn|Ronyn]] 11:42, 9 June 2009 (EDT)
Does whether or not you're in the origin's line of sight affect their ability to spot you? --[[User:Ronyn|Ronyn]] 11:42, 9 June 2009 (EDT)
: Yes.
: Yes. [[User:Scruggs|Scruggs]] 00:05, 11 June 2009 (EDT)
:: Just a side note to add that based on some experimentation, the Line-of-Sight field of view extends from -95 degrees to +95 degrees from the detector's point of view if the detector is looking straight ahead.  --[[User:Saebel|saebel]] 23:54, 16 May 2011 (EDT)
 
== Complete Formulas ==
 
I've put together the [[User:JRoush#Detection|complete formula]] after poking around in the disassembly.  Any objections to me updating this article?  It would be a fairly major edit.
 
:Not at all - accurate information is what we want, and the disassembly's a far greater source of that then any testing that we've done.
 
:You don't really need to ask - just know what you're talking about, we trust you. This Wiki is open for editing from everyone, and you're certainly someone.
:[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 20:33, 20 August 2010 (EDT)
 
:: Fair enough, thanks.  I only posted a query like this because I'll probably be rewriting the entire page. [[User:JRoush|JRoush]] 00:03, 21 August 2010 (EDT)
 
== Formula Double Check ==
I'm in the midst of a significant revamp of detection (if possible).  I noted that the description of how Detection is calculated doesn't match the description in the game.  Specifically Invisibility, which states that it only cancels out sight penalties, not audio.  But the detection formula presented seems to indicate that invisibility cancels out all detection.  Is there some way I could look at the actual formula that you got this from?  There might be something I can do with it.  I'm pretty good with scripting and programming, but new to ElderScrolls construction set.  I'd love to just override the entire detection formula if I could.  Thanks.  [this is my first wiki construction post, so please let me know if I have missed any of the common etiquette]  --[[User:Saebel|saebel]] 14:33, 13 February 2011 (EST)
 
:Your post is perfect form, no worries there.
 
:As for the formula, considering that the page was written by JRoush, I am reasonably sure that it results from his work disassembling Oblivion.exe, so this formula probably comes from the game code and is therefore accurate. I'd contact him on the {{Forums}} if you have more questions about it.
 
:Changing it would be a bit trickier. The CS does not give you access to this kind of thing (like I said, JRoush probably got this by disassembling the executable, because it's definitely not documented in the game or the CS), so a simple .esp mod could not change it. Instead, you'd have to write an [[:Category:Oblivion Script Extender|OBSE]] plugin to hook the game and make the changes you want. Making OBSE plugins requires knowledge of C++, however. If you know (or want to learn) C++, check out obse_plugin_example in the src folder of the OBSE archive download.
 
:Also, since JRoush clearly has already investigated detection some, I suggest talking to him about it - he may be able to save you a lot of work in determining where the code you want to change is, and how to do so. You may need to do some disassembly investigation yourself, however, which means you'll also need to understand assembly.
 
:I hope that helps - unfortunately, this will be a complicated project. Good luck! If you have questions about the process of creating an OBSE plugin, I can probably help with that.
:[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 15:18, 13 February 2011 (EST)
 
::Thanks for the tips!  I just sent him a message via the forums, so we'll see what happens with that.  In analyzing the formula further, I may be able to use what already exists with some workarounds.  I'm really good with scripting (I design FileMaker Pro databases), but C++ programming not so much (for the same reason).  So hopefully my workarounds will do the trick.  Not sure I can justify the time to learn C++ to the level required for this one mod.
 
::I've looked at just about all of the existing stealth/sneak mods, and found that although there were a lot of good ideas there, many of them either had mistakes, or inefficient/dirty code, or were pointing to the wrong gamesettings, or directly (and incorrectly in my opinion) modifying the sneak skill using diseases or spell effects, or just missing some gamesettings altogether!
 
::I've been reading through this wiki heavily, and plan on using all the tricks to keep everything slim, trim and optimized so that performance issues should be minimal.  I'm going to attempt using a scripts/ini system only if possible, and only focus on the fSneak* set of gamesettings, thus allowing for customization and minimal conflicts with other mods, and without modifying the player's current sneak skill.
 
::Big kudos is going to go to JRoush for this formula.  If what I have in mind works, it's gonna be a major game changer when it comes to sneaking.  --[[User:Saebel|saebel]] 16:25, 13 February 2011 (EST)
 
:::Point of interest: in the grand scheme of things, the efficiency of Oblivion scripts ''almost'' doesn't matter. A script would have to be ludicrously inefficient to cause any performance problems whatsoever. While of course best practices are encouraged, avoiding or recreating a mod simply because it missed some of those best practices is rather unnecessary, IMO. Obviously, if you want the actual content to be different, that'd be your prerogative.
 
:::The level of C++ knowledge necessary for this ''might not'' be very high - most of it is already done for you in obse_plugin_example. It really depends upon how much JRoush can tell you. If he's already revealed the appropriate function in his COEF project, then changing it would be as simple as overloading that function. If not... then it can get more complicated.
:::[[User:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">D</span>ragoon <span style="font-family: Oblivion, Daedric Runes; size=2;">W</span>raith]] [[User_talk:DragoonWraith|<span style="font-family: Oblivion, Daedric Runes; size=2;">TALK</span>]] 13:25, 15 February 2011 (EST)
 
::::I'm definitely not reinventing the wheel here.  Lots of new stuff you won't find in other mods.  I've figured out how to bypass most of the detection formula, however I can't get past the NPC ambient lighting and distance factor issues.  Oblivion uses the exact same distance factor equation for Sight, Sound, and Skill, and I want them all to be different.  So the only way to get the effect I want is to completely override and replace how Oblivion handles detection for NPCs.  I'm gonna check with JRoush and see if that's doable.  If I can't, I'll still release what I have, it just won't be as cool though.  Thanks again for the tip on the scripting performance.  That will make things simpler! --[[User:Saebel|saebel]] 14:19, 16 February 2011 (EST)
 
== Added Missing Minimum Detection Threshold ==
Noticed that "fSneakNoticeMin" was missing from the list of thresholds and added it.  --[[User:Saebel|saebel]] 23:43, 16 May 2011 (EDT)
 
== More On Detection Thresholds ==
I discovered through experimentation that it doesn't matter how high you set the minimum thresholds, the moment the detection level goes above 0 you are detected.
--[[User:Saebel|saebel]] 18:14, 21 May 2011 (EDT)
 
: Sounds interesting.  I've been meaning to look at the threshold code for a while; I'll do that and report back on what exactly is going on if I figure it out. [[User:JRoush|JRoush]] 20:21, 21 May 2011 (EDT)
 
== Dead actors lock ==
It seems that the detection level of an actor gets "locked" in whatever state it was when killed: when an actor is killed by the player, and the actor was aware of the player when dying, [[IsActorDetected]] will return 1 for the player always as long as him and the dead actor are in the same cell, no matter where (I tested in a cell with only me and my victim, and in cells with no one left alive). The victim's [[GetDetectionLevel]] is also locked (typically at 3 if you kill him face to face, at 0 if he didn't notice you when killed, etc) upon death. So it seems any script trying to use detection functions has to ensure that the actor is still alive.
No idea if it only applies towards the player or to any actor. [[User:Migck|Migck]] 10:01, 23 July 2011 (EDT)

Latest revision as of 09:01, 23 July 2011

Line of Sight[edit source]

Does whether or not you're in the origin's line of sight affect their ability to spot you? --Ronyn 11:42, 9 June 2009 (EDT)

Yes. Scruggs 00:05, 11 June 2009 (EDT)
Just a side note to add that based on some experimentation, the Line-of-Sight field of view extends from -95 degrees to +95 degrees from the detector's point of view if the detector is looking straight ahead. --saebel 23:54, 16 May 2011 (EDT)

Complete Formulas[edit source]

I've put together the complete formula after poking around in the disassembly. Any objections to me updating this article? It would be a fairly major edit.

Not at all - accurate information is what we want, and the disassembly's a far greater source of that then any testing that we've done.
You don't really need to ask - just know what you're talking about, we trust you. This Wiki is open for editing from everyone, and you're certainly someone.
Dragoon Wraith TALK 20:33, 20 August 2010 (EDT)
Fair enough, thanks. I only posted a query like this because I'll probably be rewriting the entire page. JRoush 00:03, 21 August 2010 (EDT)

Formula Double Check[edit source]

I'm in the midst of a significant revamp of detection (if possible). I noted that the description of how Detection is calculated doesn't match the description in the game. Specifically Invisibility, which states that it only cancels out sight penalties, not audio. But the detection formula presented seems to indicate that invisibility cancels out all detection. Is there some way I could look at the actual formula that you got this from? There might be something I can do with it. I'm pretty good with scripting and programming, but new to ElderScrolls construction set. I'd love to just override the entire detection formula if I could. Thanks. [this is my first wiki construction post, so please let me know if I have missed any of the common etiquette] --saebel 14:33, 13 February 2011 (EST)

Your post is perfect form, no worries there.
As for the formula, considering that the page was written by JRoush, I am reasonably sure that it results from his work disassembling Oblivion.exe, so this formula probably comes from the game code and is therefore accurate. I'd contact him on the Forums if you have more questions about it.
Changing it would be a bit trickier. The CS does not give you access to this kind of thing (like I said, JRoush probably got this by disassembling the executable, because it's definitely not documented in the game or the CS), so a simple .esp mod could not change it. Instead, you'd have to write an OBSE plugin to hook the game and make the changes you want. Making OBSE plugins requires knowledge of C++, however. If you know (or want to learn) C++, check out obse_plugin_example in the src folder of the OBSE archive download.
Also, since JRoush clearly has already investigated detection some, I suggest talking to him about it - he may be able to save you a lot of work in determining where the code you want to change is, and how to do so. You may need to do some disassembly investigation yourself, however, which means you'll also need to understand assembly.
I hope that helps - unfortunately, this will be a complicated project. Good luck! If you have questions about the process of creating an OBSE plugin, I can probably help with that.
Dragoon Wraith TALK 15:18, 13 February 2011 (EST)
Thanks for the tips! I just sent him a message via the forums, so we'll see what happens with that. In analyzing the formula further, I may be able to use what already exists with some workarounds. I'm really good with scripting (I design FileMaker Pro databases), but C++ programming not so much (for the same reason). So hopefully my workarounds will do the trick. Not sure I can justify the time to learn C++ to the level required for this one mod.
I've looked at just about all of the existing stealth/sneak mods, and found that although there were a lot of good ideas there, many of them either had mistakes, or inefficient/dirty code, or were pointing to the wrong gamesettings, or directly (and incorrectly in my opinion) modifying the sneak skill using diseases or spell effects, or just missing some gamesettings altogether!
I've been reading through this wiki heavily, and plan on using all the tricks to keep everything slim, trim and optimized so that performance issues should be minimal. I'm going to attempt using a scripts/ini system only if possible, and only focus on the fSneak* set of gamesettings, thus allowing for customization and minimal conflicts with other mods, and without modifying the player's current sneak skill.
Big kudos is going to go to JRoush for this formula. If what I have in mind works, it's gonna be a major game changer when it comes to sneaking. --saebel 16:25, 13 February 2011 (EST)
Point of interest: in the grand scheme of things, the efficiency of Oblivion scripts almost doesn't matter. A script would have to be ludicrously inefficient to cause any performance problems whatsoever. While of course best practices are encouraged, avoiding or recreating a mod simply because it missed some of those best practices is rather unnecessary, IMO. Obviously, if you want the actual content to be different, that'd be your prerogative.
The level of C++ knowledge necessary for this might not be very high - most of it is already done for you in obse_plugin_example. It really depends upon how much JRoush can tell you. If he's already revealed the appropriate function in his COEF project, then changing it would be as simple as overloading that function. If not... then it can get more complicated.
Dragoon Wraith TALK 13:25, 15 February 2011 (EST)
I'm definitely not reinventing the wheel here. Lots of new stuff you won't find in other mods. I've figured out how to bypass most of the detection formula, however I can't get past the NPC ambient lighting and distance factor issues. Oblivion uses the exact same distance factor equation for Sight, Sound, and Skill, and I want them all to be different. So the only way to get the effect I want is to completely override and replace how Oblivion handles detection for NPCs. I'm gonna check with JRoush and see if that's doable. If I can't, I'll still release what I have, it just won't be as cool though. Thanks again for the tip on the scripting performance. That will make things simpler! --saebel 14:19, 16 February 2011 (EST)

Added Missing Minimum Detection Threshold[edit source]

Noticed that "fSneakNoticeMin" was missing from the list of thresholds and added it. --saebel 23:43, 16 May 2011 (EDT)

More On Detection Thresholds[edit source]

I discovered through experimentation that it doesn't matter how high you set the minimum thresholds, the moment the detection level goes above 0 you are detected. --saebel 18:14, 21 May 2011 (EDT)

Sounds interesting. I've been meaning to look at the threshold code for a while; I'll do that and report back on what exactly is going on if I figure it out. JRoush 20:21, 21 May 2011 (EDT)

Dead actors lock[edit source]

It seems that the detection level of an actor gets "locked" in whatever state it was when killed: when an actor is killed by the player, and the actor was aware of the player when dying, IsActorDetected will return 1 for the player always as long as him and the dead actor are in the same cell, no matter where (I tested in a cell with only me and my victim, and in cells with no one left alive). The victim's GetDetectionLevel is also locked (typically at 3 if you kill him face to face, at 0 if he didn't notice you when killed, etc) upon death. So it seems any script trying to use detection functions has to ensure that the actor is still alive. No idea if it only applies towards the player or to any actor. Migck 10:01, 23 July 2011 (EDT)