Go Back   Angband Forums > Angband > Vanilla

Thread Tools Display Modes
Old June 19, 2009, 15:34   #1
Join Date: May 2009
Posts: 37
jv123 is on a distinguished road
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 .
jv123 is offline   Reply With Quote
Old June 19, 2009, 15:45   #2
Join Date: Jun 2008
Location: Los Angeles
Posts: 1,068
Zikke is on a distinguished road
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:
Zikke is offline   Reply With Quote
Old June 19, 2009, 19:00   #3
DaJAngband Maintainer
will_asher's Avatar
Join Date: Apr 2007
Location: San Antonio, TX
Posts: 927
Donated: $10
will_asher is on a distinguished road
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.

Play DaJAngband:
will_asher is offline   Reply With Quote
Old June 19, 2009, 21:06   #4
Join Date: May 2009
Posts: 62
Cauldron is on a distinguished road
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.
Cauldron is offline   Reply With Quote
Old June 20, 2009, 16:18   #5
buzzkill's Avatar
Join Date: May 2008
Location: Indiana, USA
Posts: 2,939
Donated: $8
buzzkill is on a distinguished road
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.
__________________ - Get your 32x32 tiles here. UT32 now compatible Ironband and Quickband 9/6/2012.
My banding life on Buzzkill's ladder.
buzzkill is offline   Reply With Quote
Old June 22, 2009, 20:45   #6
Join Date: May 2009
Posts: 37
jv123 is on a distinguished road
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 at 21:50.
jv123 is offline   Reply With Quote
Old June 22, 2009, 21:40   #7
Angband Devteam member
Join Date: May 2007
Location: London, UK
Posts: 5,057
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate
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.
Magnate is offline   Reply With Quote
Old June 22, 2009, 22:07   #8
Angband Devteam member
d_m's Avatar
Join Date: Aug 2008
Location: Philadelphia, PA, USA
Age: 39
Posts: 1,516
d_m is on a distinguished road
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.
d_m is offline   Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Improving disturbance andrewdoull Development 0 May 23, 2009 23:12
stealth and sleeping monsters bebo Vanilla 11 February 26, 2009 19:52
Excellent Stealth bpleshek Vanilla 5 September 5, 2008 02:09
RGRA portal stealth post feature zaimoni Oook! 13 December 13, 2007 17:53

All times are GMT +1. The time now is 19:36.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.