Jump to content

Photo

Thesis: Hide in Shadows


  • Please log in to reply
7 replies to this topic

#1
NExUS1g

NExUS1g
  • Members
  • 11 posts
After much searching around, I became frustrated with not finding the answers I've been looking for regarding the thief/ranger ability Hide in Shadows (HiS) and its counterpart for thieves Move Silently (MS). As such, I've conducted a thorough analysis of HiS and what affects it. This was done in a lightly modified Tutu client. No modifications to the thieving abilities were included.

Summary of findings:

- 1 point of HiS or MS is a 0.5% increase in chance to hide.

- There will always be a minimum 1% chance to fail under all circumstances.

- Penalties are percentage based. (This is explained in more detail later.)

- The ability to successfully hide = ( 2 / ( HiS + Move Silently )) * ( |100 / ( penalties - 100 )| ). (The formula may not be written elegantly and for that the writer apologizes).

- Therefore, assuming no penalties, having 100 HiS but 0 Move Silently (MS) results in a 50% success rate. Conversely, having 100 MS but 0 HiS also results in a 50% success rate. Given the additional benefits MS most likely provides, stealth points are best put toward MS before HiS.

- In order to receive no penalty to your HiS skill check, you must be in a shadow (the shadow must make your character appear darker when he walks into it or it must be night and you must be outside -- being in a shadow at night doesn't seem to provide a bonus). (All inside locations tested were all well lit and had no proper shadows.)

- Being out of a shadow during the daylight hours incurs a 50% penalty to your skill. (This is a percentage of your skill number, e.g. if you have 50 points in HiS you will have a 25% success rate. If you have 75 points in HiS you have a 37% success rate.)

- Being indoors in a lit area seems to incur a 30% penalty (it's the writer's suspicion that this is actually 1/3). If one were to locate shadows indoors this should be negated but could not be confirmed as no shadows indoors could be located for testing.

- Neutral/Friendly NPCs and party members do not hinder the ability to hide. The effects of hostile NPCs on hiding checks were not evaluated.

- Shields (any size), helmets and leather and studded leather armor do not affect hiding success rates. Elven chainmail was not evaluated.

- Night time ends as soon as the hour on the in-game clock reads "Hour 6." Night time begins when the clock reads "Hour 22." There is no easing -- it is either night or it is not.

- In order to successfully hide 99% of the time no matter the environemental conditions requires a total of 400 points into HiS or MS as the most significant penalty for hiding is attempting to hide during the day outside of the shadows which incurs a 50% penalty. Given the data, it seems as though the desired cap for MS is 255 (the max value as it's assigned only one byte) and 145 in HiS for 400 points total which should provide a 99% success rate in all environmental conditions (2 / ( 255 + 145 ) - 50% = 100%).


The following is the data used to make the aforementioned conclusions...

300 iterations with 100 HiS and 25 MS resulted in 102 failures to hide (102 / 300 = 34% failure rate).

300 iterations with 20 HiS and 100 MS resulted in 129 failures to hide ( 129 / 300 = 43% failure rate).

300 iterations with 100 HiS and 100 MS during the day out of shadows resulted in 147 failures to hide (147 / 300 = 49% failure rate).

300 iterations with 100 HiS and 100 MS during the day in the shadows resulted in 3 failures to hide ( 3 / 300 = 1% failure rate).

300 iterations with 50 HiS and 50 MS during the day out of shadows resulted in 234 failures to hide ( 234 / 300 = 78% failure rate).

300 iterations with 100 HiS and 100 MS at night out of shadows resulted in 8 failures ( 8 / 300 = 2.6% failure rate).

300 iterations with 100 HiS and 100 MS indoors in the light resulted in 89 failures ( 89 / 300 = 30% failure rate).

100 iterations with 100 HiS and 100 MS during the day in the shadows while wearing a helm resulted in 0 failures ( 0% failure rate).

100 iterations with 100 HiS and 100 MS during the day in the shadows while holding a large shield resulted in 2 failures ( 2 / 100 = 2% failure rate)

100 iterations with 100 HiS and 100 MS during the day in the shadows while wearing studded leather armor resulted in 2 failures (2 / 100 = 2% failure rate).

If one wishes to verify the findings, add information not evaluated or work with thieving skills (or cheat), the hex information for thieving skills will be provided.

Once the character file is open, the binary shows only the adjustment above and beyond what bonuses are provided inherently through class kits and stats. For instance, with 18 dexterity, a thief will start with 20 HiS. If 20 points are put into HiS when creating the character, the hex will read 14 (20 decimal) instead of 28 (40 decimal). Until this discovery, locating the proper binary to edit was difficult.

The hex columns and rows for thieving skills are as follows:
A0x9 HiS
C0x8 Detect Illusion
C0x9 Set Trap
C0xB Open Locks
C0xC MS
C0xD Find Traps
C0xE Pick Pockets

Edited by NExUS1g, 20 June 2012 - 11:27 PM.


#2
Son of Imoen

Son of Imoen
  • Members
  • 520 posts
Kudo's for doing such a thorough research. It's long been assumed the chance to Hide in Shadows is determined by the average of HiS and MS. You've proven this with a statistical analysis. New (to me at least) is knowing the exact penalty of being in daylight and being in a lit indoor area. Kudo's for that.

One question: you mention there's other benefits to Move Silently, making you advise to put more in MS than in HiS. What are those other benefits, to your opinion or findings?

#3
NExUS1g

NExUS1g
  • Members
  • 11 posts
Hi, Son of Imoen!

Thanks for your reply and enthusiasm over my research. Regarding your question, this is my gut feeling and untested hypothesis. I would like to do more testing regarding MS to prove the hypothesis if I get a chance. Further testing may even bring to the front revelations about the relation of the two abilities that overturn some of my findings here.

Until I complete an MS testing, I personally consider this a work-in-progress.

#4
Grond0

Grond0
  • Members
  • 4,846 posts
The advantage of MS is supposed to be that it extends the period you remain hidden after starting another action. For instance there are a couple of traps on the bridge in the Nashkel mines where you can:
- hide in shadows
- move up and detect traps
- remove trap
- move back while still hidden
- repeat for second trap

#5
morbidest2

morbidest2
  • Members
  • 390 posts
Sounds like you're saying that the Game assumes that the fewer points you have in MS, the more likely the chance that you will sneeze while hiding! Seems reasonable.
Let me also thank NExUS1g for his research thesis. Seems like a good step towards getting a doctorate in Thievery.

#6
polytope

polytope
  • Members
  • 342 posts
I'm pretty sure there's no actual difference between HIS and MS, as ranger's only get one such blanket skill (stealth), the average is all that matters. Also, never invest 255 skill points in an ability, because it will wrap around to a very low value (integer underflow bug) after dex and racial modifiers are added.

Even with a high chance to MS, enemy spellcasters will still detect you and start casting True Sight/Invisibility Purge... The only exception is some of the added battles if you are playing with aVENGER's Rogue Rebalancing mod.

#7
NExUS1g

NExUS1g
  • Members
  • 11 posts
Polytype, thanks for your post. It's possible that HiS and MS are the same, but it seems redundant. I understand that you may consider it to be a way to get around the 1-byte limit, but adding a second byte would have been easier from a programming standpoint. Like I said, I do hope to get some time to test MS as well to help demystify the skill and eliminate the speculation game.

Onto something that you brought up which I'm curious about. I had imagined that once the engine loaded the variables that it converted them to a standard integer, added the stat bonuses and worked from that number from then on. From what you're saying is that the engine is still using a single-byte for the mathematics so if the total number, including bonuses, exceeds 255, it will cycle the bit back around. Which of these statements have you found to be correct?

#8
AnonymousHero

AnonymousHero
  • Members
  • 453 posts

NExUS1g wrote...

Polytype, thanks for your post. It's possible that HiS and MS are the same, but it seems redundant. I understand that you may consider it to be a way to get around the 1-byte limit, but adding a second byte would have been easier from a programming standpoint. Like I said, I do hope to get some time to test MS as well to help demystify the skill and eliminate the speculation game.


ISTR someone looking at the assembly code in a debugger and
concluding that the game is simply doing (HiS+MS)/2 to calculate the
base skill value (before penalties and bonuses). This was ages ago, so my memory may be off...

NExUS1g wrote...
Onto something that you brought up which I'm curious about. I had imagined that once the engine loaded the variables that it converted them to a standard integer, added the stat bonuses and worked from that number from then on. From what you're saying is that the engine is still using a single-byte for the mathematics so if the total number, including bonuses, exceeds 255, it will cycle the bit back around. Which of these statements have you found to be correct?


AFAIK it uses 8-bits for the internal computation -- which should be testable by cheating up a character with 250 + 250 and racial bonuses exceeding 5%.

(Actually, the calculation above should probably be HiS/2 + MS/2 since the math is different when considering overflow.)

Edited by AnonymousHero, 30 June 2012 - 10:22 AM.