Page 1 of 1

Stealth, and Unseen Actions+Luck

Posted: Sat May 21, 2016 4:02 am
by Einzbern
I have two questions:

1.) When an enemy rolls to see if they detect me in stealth, how exactly is this determined? I'd assume stealth power factors into some equation, but what is the equation? Or if I have say 50 stealth power, what are my chances to be detected vs 100 stealth? 75? 50? 25? 0? Is there somewhere on an enemy's character sheet that shows how much stealth detection they have? First time I checked I didn't see it anywhere.
Edit-
I'm just blind. See Stealth/Invisible is under Vision on the General tab.

2.) I know luck helps to stay in stealth through Unseen Actions. Assuming my estimated chance to stay in stealth is 100%, and I have 0(or whatever the base is) luck, what are my chances to actually lose stealth due to luck?

Re: Stealth, and Unseen Actions+Luck

Posted: Mon May 23, 2016 12:49 pm
by mikekchar
I only quickly looked at the code (and this is old code that is probably missing some stealth changes, but it's what I had on hand). Anyway in this code for every point of luck over 50 that you have, you get a 0.2% chance to avoid breaking stealth. So at 100 luck you will have an extra 25% chance to avoid breaking stealth. With 0 luck you are 25% *more likely* to break stealth.

Edit: Those should be +- 10%. I can't do math :-D

The chance to break stealth overall seems to simply be the amount in the Unseen Actions tool tip as your base skill against the each other NPC's detection in the same way you do combat (i.e. 50% chance if it is even, +- 2.5% for every point difference). I would expect this to be scaled by distance, but I don't actually see that in the code (remember I'm looking at old code -- probably 1.3.0... can't remember).

It seems likely that at a 1.89 multiplier at level 5 you should almost never break stealth, but I *think* that there must be a minimum chance of 5% to break stealth (as there are for many saving throws). That would correspond with my subjective feel for how often stealth breaks. However, I don't have time to check the code to find out. I would be interested to hear if anyone knows.

Interestingly, though, the luck is added *after* the chance is calculated, so it would seem that if you have at least 75 luck it should offset my supposed 5% minimum chance and allow you never to break stealth (as long as you are level 5 and have at least 11 point higher in stealth than your opponent's stealth detection). If true possibly you can achieve permanent stealth without needing Tricks of the Trade (I'm not sure how high opponents' stealth detection can get, so this might be incorrect).

Edit: I should also mention that the stealth detection stats seem to be output to the log, so it might be worth looking at them for more information.

Re: Stealth, and Unseen Actions+Luck

Posted: Tue May 24, 2016 1:26 pm
by mikekchar
I had a little more time to look into the code closely and to test it. The problem for breaking stealth is *not* Unseen Actions. The problem is that if you attack when the opponent has noticed you, then you deactivate stealth. Luckily, whenever the opponent targets you (in other words, can see you) when you are stealthed, you get a message "So-and-so briefly catches a glimpse of you". This means that the opponent can see you! So you need to move before you can attack safely.

How the calculation of if they can see you is a bit complicated. Essentially if they have ESP for you then they can see you 100% of the time. Otherwise it is essentially their stealth detection against your stealth, minus 10% for every tile more than 1 away from you they are. *This* is the one that likely has the minimum 5% chance to detect (although I haven't verified it in the code) as very occasionally a 30 against 60 will still see me.

One more thing. If the opponent is flailing around and manages to stumble into you (whether they hit or miss), if you attack it will break stealth. Again, you need to move to be safe.

If I'm correct (and I may not be), then as long as you are careful to check the status you should be able to wander around without breaking stealth. The unfortunate point is that there are times when you can not attack.

Edit: I just tested it and actually if they miss you while stumbling around you can attack without breaking stealth it seems. It only breaks stealth if they manage to hit you. So it's good to have very high defence.

Edit: One more slight annoyance. The opponent has the ability to see you on the same turn that you attack, which means that you will not get the "briefly catches site" message and only get "notices you just in time" when the stealth breaks. So once every 20 attacks they will see you and break stealth and there seems to be no way to avoid it :-(

Re: Stealth, and Unseen Actions+Luck

Posted: Tue May 24, 2016 2:37 pm
by Mordy
All those stealth break rules feel very annoying to make a good use of.

Re: Stealth, and Unseen Actions+Luck

Posted: Tue May 24, 2016 11:30 pm
by mikekchar
Probably I should update the wiki with this information. I'm not quite sure how to get access to the edit pages...

Mordy: It does seem annoying, but actually when I was testing, I found it quite fun to play. Of course some people won't like how fiddly the mechanics are. The main thing is that you have to be careful. You have to be constantly watching to see if anyone has spotted you. If so, it's best to retreat and then start again. If you haven't been spotted, once you have fairly high level in Unseen Actions, you are completely free to act. I'm assuming just for balance, the 1 in 20 stealth break is necessary. In fact, if you didn't have it, those Grand Master Assassins would be crushing you every single time.

But basically, the game play seems to be to try to isolate single opponents and kill them. If you are spotted, run away and try again. If you break stealth (very infrequent) you use an escape to get away and hide. Rogues have almost no way to recover stamina as well, so you are constantly sneaking up, attacking, running away, resting. For me this is an interesting game play and I think, in general, it's quite a good success.

I have 3 complaints about it (which I should probably make an addon to try to fix because it would be easy):

First the way you find out that you have been noticed is far from obvious. Especially for people like me with poor vision, having to pay attention to tiny little text is really hard. Also, it's likely that the notification will get scrolled off the screen from time to time, so you have to occasionally open up the message log and check it. I think it would be much better if any opponent who can see you was highlighted on the screen.

Second, the balance between being noticed and Unseen Actions seems kind of broken to me. I had level 4 in unseen actions and a stealth of 62. My check for unseen actions is 133 against their stealth. Basically there is *no way* for Unseen actions to break stealth because if the opponent is able to notice me, they are going to do it by observing me (where they have to do the check against 62) rather than Unseen Actions (where they have to do the check against 133). I think there needs to be a better balance between having stealth broken from being spotted and stealth broken from Unseen Actions.

Finally, once you get up to 60 or so stealth, there is almost nobody who can see you. The only time they notice you is the 1 in 20 situation. This makes it seem arbitrary because every opponent has the same chance to spot you. So probably the fix is to make stealth less powerful so that it breaks in a more understandable fashion. Conversely, it is probably necessary to scale down the stealth detection of the end game opponents so that stealth is still viable. This is probably the most tricky change to get right.

Re: Stealth, and Unseen Actions+Luck

Posted: Wed May 25, 2016 2:52 am
by mikekchar
Sorry to go on about this, but I realized one other unfortunate issue with my test character. In certain circumstances (possibly only vaults, but I didn't read the code closely), if *one* of your opponents can see you, then they tell their friends where you are. So if you are fighting those pesky Ziguranth patrols and one of the guys happens to have a very high stealth detection... well you are as good as dead. The worst part is that there is no particularly easy way to tell that this has happened. You don't break stealth until you actually attack, so you think you are safe, but then they whack you with everything they have. So it is important to check rares and uniques to makes sure they *all* have low stealth detection before you assume that you are safe.

I still think it's quite fun because it is challenging, but as was said in another thread this is one of those areas where the rules are just not discoverable by normal means. I think this is why most people conclude that stealth is useless.

Re: Stealth, and Unseen Actions+Luck

Posted: Wed May 25, 2016 5:09 am
by mikekchar
Sigh... I should have dug into the code deeper before I opened my mouth....

The "to hit" function that is used for determining whether or not someone sees you is the *old* "to hit" function which uses completely different math to the current "to hit" functionality. And I suppose I should be putting this in spoilers by now... but if you care, then avert your gaze. The chance to be detected is:

50 * ((1 / (1 + exp(-(detection - stealth) / 7)) + (detection / (detection + stealth)))

But there is no minimum as I had earlier thought. Yes, if you accidentally saw this formula and the game is ruined for you now, I offer my deepest apologies... :-P

It prints the actual chance to be detected in the log as "=> chance to hit" after it prints "check hit <detection> <stealth>". So in my case if my opponent has 25 stealth detection and I have 62.7 stealth, then the chance to be detected each turn is 13.9% -- so quite high.

The first part actually drives to zero very quickly, so you can get an approximation of this by simply by doing 50 * (detection / (detection + stealth)). For those that don't like to do tricky math in your head, you can approximate this further. If you have 75 stealth then for reasonable ranges of the opponent's detection, your chance to be detected is about half the opponent's detection skill. If you have 125 stealth then it is about a third of the opponent's detection skill.

Basically stealth is pants if there are many people to observe you :-)

Re: Stealth, and Unseen Actions+Luck

Posted: Fri May 27, 2016 10:46 am
by Einzbern
Interesting. Thanks for the info!

Still a little curious about luck though. The way I'm understanding it, does it mean with 550 luck and 0 stealth power I will never break stealth other than that 5% chance that always happens? Or if I had 30% chance to stay in stealth in actuality it would be 60%? Or what exactly?

Re: Stealth, and Unseen Actions+Luck

Posted: Sat May 28, 2016 11:57 pm
by mikekchar
Sorry. My previous posts are far from clear :-) I'll try to summarize.

Luck only works with Unseen Actions. It gives you +0.2% chance to avoid losing stealth in Unseen Actions for every point above 50. Luck is notoriously difficult to acquire so getting much over 100 luck is pretty much impossible.

However, this point is moot because you will *never* break stealth on Unseen Actions once you get to level 4 or so. Normally when you are in stealth, if you do a non-movement action (attacking, using an infusion, casting a spell, etc) you will break stealth. If you have Unseen Actions, each opponent will make a check against a multiple of your Stealth. At level 1 the multiple is 0.4 and at level 5 I think the multiple is 1.89. Although there is no scaling for distance, luck further modifies the result.

If you only move, then you will never break stealth. However, this is not terribly relevant because every turn (or possibly every time the opponent has an action... I didn't check), the opponent gets a chance to "spot you". This comes in the form of a check against your Stealth. It is important to note that *this* check is not scaled at all (no scaling from Unseen Actions, no contribution from luck, no scaling from distance). If they succeed then they will spot you and can target you (and hit you with no penalties).

If an opponent "spots" you, then for a turn or so, they can see you. If you attack in a turn where an opponent can see you, then you will break stealth. So as I said, you need to keep track of the little messages saying that an opponent has spotted you. However, if the opponent spots you in the *same turn* that you attacked, you will get no such message. You will simply break stealth. I think this is where people think Unseen Actions are failing them, but in truth it never gets to the Unseen Actions check.

The key here is that every action the opponent gets a chance to see you which essentially nullifies your advantage from stealth. This check is unmodified. The only check that is modified is your Unseen Actions one and that one is modified enough that it is unlikely ever to break your stealth. So once you get to level 4 or 5 of Unseen Actions, every single stealth breakage will come from being spotted. Being spotted does not include luck.

So as long as you have at least 50 luck (your starting position), and you have at least level 4 in Unseen Actions, then luck will play absolutely no role in stealth.

There is one other important aspect with Stealth. That is Hide In Plain Sight. This allows you to regain stealth once you have broken it. Each opponent makes a check against your Stealth scaled by your level (0.9x for level 1 and 2.7x for level 5). The resulting chance for detection is further reduced by 10% for every tile the opponent is away. So Hide in Plain Sight is the only one that scales by distance. It also does *not* use luck. Why Hide in Pain Sight is the only talent to scale by distance, I have no idea...

One thing I didn't talk about previously is that the opponents' stealth detection level is increased by a factor of their level and their cunning (I can't remember if it was 0.5 * level + 0.25 * cunning or the other way around...). Anyway, the point is that once you get to the mid game, your opponents will all have 30+ stealth detection. Unless you can get your stealth to stratospheric levels (I believe someone was talking about having 190 Stealth), you will be detected when you encounter large groups. In my test run I had 62 stealth when I got to the alternative Daikara level. It was impossible to use stealth at all because there is nothing to break the line of sight and you have 5-6 opponents each with a 14% chance of spotting you. So every time you attack you break stealth. I think to run an effective stealth campaign you need to invest in traps and use sticky smoke and the target dummy to obscure vision and draw creatures away from you. But I haven't tested this theory.

You should also note that in the Ideas part of the forum somebody is redesigning the Rogue including Stealth. The ideas look good and I think it is pretty obvious that Stealth needs an overhaul, so one of these days I'd like to give it a try.