[ANSWERED] Fallout 1 & 2 Sneak Formula?

Discussion in 'Fallout RPG Gameplay & Tech' started by QuantumApprentice, Nov 9, 2018.

  1. QuantumApprentice

    QuantumApprentice First time out of the vault

    Feb 9, 2018
    Hey everybody, I've got another weird technical question about original vanilla Fallout.

    So I've noticed a youtube video and a couple of forums where people claim sneak has a really good combat ability (), and I was wondering if anybody here had come across the formula used by the engine?

    The manual says "When you first start Sneaking, and every minute after, the computer rolls against your Sneak skill. If successful, all critters will have their Perception halved when trying to notice you."
    I'm curious if their perception continues to be halved for each successive minute, meaning after 2-3 minutes all enemies have a perception of 1 as you continue to sneak? Or if it just resets and does a new calculation on base stats again.

    Any info up to and including the actual game formula I'd love to see. TIA :)
     
    • [Rad] [Rad] x 1
  2. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    @NovaRain @burn @Lexx Is this info something one of you has? I'd be interested in the answer as well :o
     
    Last edited: Jan 4, 2019
  3. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    falltergeist's GitHub page has an article that should give a rough idea of Stealth mechanism. The major difference is the next roll delay for failed rolls is always 1 min in FO1, while in FO2 it's affected by skill level as described in the page.

    The engine logic for checking if target is within watcher's perception range is like this:
    Code:
    if (target is in front of watcher) {
        perception_range = 5 * watcher_perception;
        if (target has TransGlass_ flag on) { // Stealth Boy effect
            perception_range /= 2;
        }
        if (target == player) {
            if (successful sneak) {
                perception_range /= 4;
                if (player_sneak_skill > 120) {
                    perception_range -= 1;
                }
            } else if (sneak mode on) { // unsuccessful sneak - roll failed but player's still in sneak mode
                perception_range = 2 * perception_range / 3;
            }
        }
    }
    if (distance <= perception_range)
        return 1;
    }
    
    // in back of watcher
    if (in combat) {
        perception_range = 2 * watcher_perception;
    } else {
        perception_range = watcher_perception;
    }
    if (target == player) {
        if (successful sneak) {
            perception_range /= 4;
            if (player_sneak_skill > 120) {
                perception_range -= 1;
            }
        } else if (sneak mode on) { // unsuccessful sneak
            perception_range = 2 * perception_range / 3;
        }
    }
    if (distance <= perception_range)
        return 1;
    } else {
        return 0;
    }
     
    Last edited: Jan 4, 2019
    • [Rad] [Rad] x 1
  4. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    Awesoooome thank you very much!

    I feel dumb having played Fallout for 20 years and didn't realize how powerful Sneak was at high skill levels. lol
     
  5. Black Angel

    Black Angel Grand Inquisitor of the Ordo Hereticus

    Mar 21, 2016
    Wait, what? Does this mean the whole mechanic only really 'works well' if you actually invest in the skill? Can anyone summarize how does it actually work in layman terms? I've taken a look at the formula above, and understand that successful roll will halves NPC's Perception check, but I still don't understand how does that mean our character can become practically invisible at high Sneak.

    Also, does it work on Fallout 1 only or also on Fallout 2?
     
  6. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    The formula above is for FO2. The detection range formula is simpler in FO1, no player's sneak skill > 120 check and perception_range * 2 / 3 for unsuccessful sneak.
     
    • [Rad] [Rad] x 1
  7. QuantumApprentice

    QuantumApprentice First time out of the vault

    Feb 9, 2018
    Oh wow! My question caught the attention of Sduibek!

    Thanks for the info everybody! Definitely some good reading here XD
     
    • [Rad] [Rad] x 1
  8. Sduibek

    Sduibek Creator of Fallout Fixt Moderator Modder

    Oct 27, 2010
    Don't thank me, thank NovaRain :cool::salute:
     
  9. QuantumApprentice

    QuantumApprentice First time out of the vault

    Feb 9, 2018
    Don't sell yourself short, this question sat here for 2 months before you noticed it :P

    @NovaRain Thank you so much for taking the time to dig up this info, and I noticed falltergeist has a page documenting the steal function too xAWESOMEx!

    A couple of followup questions, if nobody minds:

    1) I noticed "watcher perception range" is doubled when approaching from behind in Combat Mode, is it also doubled when approaching from the front in Combat?

    2) Having effective sneak ranges is excellent information (thank you again <3 :ok: <3 ), but how is a successful sneak determined? Is it a longer formula like the Chance to Hit? And does it take light levels into effect? I saw that falltergeist had tested during day and night, but they didn't say what effect it had. More pertinently, what stats are checked when determining if a sneak check is successful?

    3) Do successful sneak checks stack? Falltergeists page indicates reduced delays between sneak checks at higher skill levels...does this mean multiple concurrent sneak modes can occur at higher skills (because the first sneak mode is on a 60 second timer or something)? Or does it reset sneak mode during each check, effectively giving you a chance to fail more often at higher sneak skills?

    Everyone! THANK YOU!
    This info is so cool, it could mean a completely new type of character build with abilities I didn't even know existed in this game XD
     
    Last edited: Jan 19, 2019
  10. QuantumApprentice

    QuantumApprentice First time out of the vault

    Feb 9, 2018
    Never-mind about question 3, I looked a little closer at Falltergeists write-up and noticed it only checks more often if the check fails, otherwise it's 60 seconds per successful check.
    But I do have one more question to add:

    4) Does toggling sneak mode manually reset the sneak check? ie Does the same sneak check pass apply if you accidentally run or turn sneak off and on again? Same question for failed sneak checks?
    Although, I suppose this doesn't matter much since you can't tell if you've passed a sneak check or not :P