Improving stealth

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jv123
    Scout
    • May 2009
    • 37

    Improving stealth

    As I understand it, stealth works by giving each monster, each turn, some probability to be woken up. This depends on many factors, I'm sure, including stealth ability, race, aggravation, and distance from the monster.

    Is line-of-sight taken into account? From personal game-playing experience, it doesn't seem to me that it is. I think that it should be; after all, lots of animals sleep with their eyes open, exactly for this purpose --- so that they can spot approaching threats which are in their line-of-sight. This would also be fun from a gameplay perspective: let's say you want to engage a particular monster in melee, in a room with two doors, and the monster is sleeping near to one door and far from another. You'd have an incentive to approach by the door nearer to the monster, to minimize the time in its line-of-sight, and hence minimize the chance you'd wake it up before your first strike. This would be a fun and realistic gameplay element.

    Also, if a monster's sleeping in a room, I often wake it up when passing along a corridor that goes near the room, even if I'm not passing a door to the room. Is there any 'dampening' effect brought on by the fact that the monster is 'hearing' me through a wall? If not, there should be.

    Angband already has a chase-by-smell functionality, doesn't it? Presumably, the idea is that your 'smell' flows down the corridor, and monsters can chase you by following the smell gradient. This underlying code could also be used for stealth, if it isn't already: the 'smell' value of a particular grid square could also be interpreted as a 'noise' value, and the higher it is, the more likely a monster located there would be woken up.

    This could be used to achieve the previous goal, of lowering the chance of waking up a nearby monster that's separated from you by a wall. You could also improve it so that your 'noise' flows easily through empty squares and open doors, less well through closed doors, and very poorly through walls. This would give a computationally-efficient, but very effective, way of simulating noise levels.

    Maybe Angband already does all this already! If so, I apologise .
  • Zikke
    Veteran
    • Jun 2008
    • 1069

    #2
    It seems to me that waking up monsters does not take into account LoS. When I have telepathy and I see a group of Dreads in the distance, I usually move until only 1 or 2 of them are visible to telepathy and spam 5 until they notice me and come to me through walls.
    A(3.1.0b) CWS "Fyren_V" NEW L:50 DL:127 A++ R+++ Sp+ w:The Great Axe of Eonwe
    A/FA W H- D c-- !f PV+++ s? d P++ M+
    C- S+ I- !So B ac++ GHB? SQ? !RQ V F:

    Comment

    • will_asher
      DaJAngband Maintainer
      • Apr 2007
      • 1124

      #3
      Just to let you know, walls, empty space, and line of sight are not taken into account. only distance. I like your idea but it looks to me like it would be very hard to implement, but I'm not a very good coder so maybe I'm wrong.
      Will_Asher
      aka LibraryAdventurer

      My old variant DaJAngband:
      http://sites.google.com/site/dajangbandwebsite/home (defunct and so old it's forked from Angband 3.1.0 -I think- but it's probably playable...)

      Comment

      • Cauldron
        Apprentice
        • May 2009
        • 62

        #4
        I think the 'trace by smell' monster ability actually uses where you've been and how long ago, rather than where you are and how far away.

        If that makes any sense, I'm accusing you of reading my mind.
        I miss autoscum... but not that much.

        Comment

        • buzzkill
          Prophet
          • May 2008
          • 2939

          #5
          My 2 cents says that LOS should be a factor (for a majority of enemies) in determining if they are aware of you. It never occurred to me that LOS wasn't taken into consideration. After all, it's much easier to remain hidden when your enemy can't physically see you.
          www.mediafire.com/buzzkill - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
          My banding life on Buzzkill's ladder.

          Comment

          • jv123
            Scout
            • May 2009
            • 37

            #6
            I've worked out an algorithm for obtaining a noise value at every square. Fixing an integer parameter N, then the algorithm requires about 3N^3 integer operations each turn. Higher values for N increase the accuracy of the algorithm, and N also represents the maximum distance that the noise can travel. If N=100, probably higher than we'd ever need, this is about 3,000,000 integer operations. If N=50, which would still give a pretty good effect, it goes down to 375,000 operations. Surely this isn't too expensive? Even N=20 wouldn't be too bad, which only costs 24,000 calculations.

            We would be able to specify how well noise travels through empty spaces, walls and closed doors, without any extra computational cost. So you'd get a very realistic simulation of noise being channeled down a long corridor, with very little leakage through the walls, and escaping through open doorways in adjacent rooms. The algorithm assumes that noise travels instantaneously across the level. It would be very easy to build in extra noise being created by loud events (i.e. attacking something, firing a bolt spell, or whatever.)

            Monsters would be able to look at the noise value in their grid square, and move in the direction of maximum noise increase to intelligently more towards the player. The local noise value could also be used to determine the probability that a sleeping monster wakes up.

            Using similar techniques, you could also calculate 'smell' values for every square in the level. This is much cheaper computationally, only needing about 5N^2 integer operations per turn. The idea is that smell travels just like sound --- passing more easily through empty spaces than walls or closed doors --- but much more slowly, say only about 3 grid squares/turn. Monsters would also be able to move in the direction of increasing smell gradient to intelligently move towards the player.

            So this algorithm I'm suggesting could, with acceptably computational expense, provide very realistic values for 'noise' and 'smell' across the level. I'm not familiar with the Angband codebase, and wouldn't have the time to add this feature myself, but I could certainly help specify the core algorithm if someone else was willing to do the work to tie it into the rest of the game.
            Last edited by jv123; June 22, 2009, 21:50.

            Comment

            • Magnate
              Angband Devteam member
              • May 2007
              • 5110

              #7
              If Takkaria is interested in reworking stealth (and nothing on the tracker suggests that he is, but after he's read this thread he might be persuaded) I'd happily add your algorithm to the list of things I'd like to implement. At the moment I'm trying to rework magic devices, and then I want to sort out the nightmare of pref files (especially now we have dynastic character numbering). After that I'd be interested (unless Takkaria pronounces on the buyout button issue and I end up reworking store inventories) - I do think it would be better if monsters waking up took into account walls, closed doors etc.
              "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

              Comment

              • d_m
                Angband Devteam member
                • Aug 2008
                • 1517

                #8
                Could we use monster LOS to approximate this? That way, cover would function as auditory and visual cover.

                I realize LOS is a quagmire right now, but it seems like a cheap way to get a nice effect.
                linux->xterm->screen->pmacs

                Comment

                Working...
                😀
                😂
                🥰
                😘
                🤢
                😎
                😞
                😡
                👍
                👎