diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2011-01-06 23:42:46 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2011-01-07 03:23:50 +0530 |
commit | 95cc9338a77e5c4182e0f6e807801c6bcd438847 (patch) | |
tree | ed09bac745294fb8e32c53ab813d343d36d1f009 /crawl-ref/.gitignore | |
parent | 6129dcaa68151913ebcbc0a2fa3b3b1b4f9ad32d (diff) | |
download | crawl-ref-95cc9338a77e5c4182e0f6e807801c6bcd438847.tar.gz crawl-ref-95cc9338a77e5c4182e0f6e807801c6bcd438847.zip |
New noise propagation system.
The old noise propagation system alerted all monsters within `loudness' radius
of the noise source, ignoring obstacles between the observer and the noise
source.
The new noise system applies only to monsters; the player is still messaged as
before. This is for two reasons:
1. noisy() must return if the player heard the noise, which forces us to
propagate the noise immediately for each noise, an unacceptable overhead on
busy maps (such as Sprint). Therefore we cheat and use the old noise rules for
the player. This is relatively simple to work around, since not many code paths
rely on the noisy() return code, and these places can be changed to work around
this lack of information.
2. The new noise system allows loud noises to drown out quiet noises. This may
be an unacceptable loss of information for the player.
The new system keeps track of noises produced by noisy(), but does not
act on them immediately. Instead, all noises are processed in world_reacts.
Noises are processed by a simple flood-out from their sources, attenuated by
distance, terrain (such as closed doors, trees), and by twists in the noise's
path (a winding corridor attenuates noise more than a straight line). Noise
propagation and attenuation uses movement geometry, not LOS geometry, *but*
attenuation assumes it is harder for the noise to change direction than to keep
going in its old direction.
To simplify handling of noises, it is assumed that louder noises overwhelm
quieter noises. An actor exposed to both a loud and a quiet noise at the same
distance will hear only the loud noise. However, an actor closer to the quiet
noise than the loud noise will hear first the quiet noise, then the loud noise
(because the floodfill visits points at an increasing radius from each noise
source). Given two equally loud noises, the closer noise will always win.
Multiple quiet noises emitted close together do not combined into a louder
noise.
Monsters hearing a noise at a distance from its source may not correctly guess
the noise's origin if the noise did not travel in a straight line to the
monster.
Noises are currently processed before and after handle_monsters() so that
monsters can react to noises produced by the player and by each other. We could
conceivably drop one of the apply_noises() calls (probably the one after
handle_monsters()) without adverse effects.
Since the new noise system allows closed doors to cut off sound, I've dropped
the Sprint noise attenuation from 1/3 to 1/2.
If Crawl is compiled with DEBUG_NOISE_PROPAGATION, it will write a
noise-grid.html dump file showing noise sources and intensities on the map for
each call to apply_noises that processed a noise.
Diffstat (limited to 'crawl-ref/.gitignore')
-rw-r--r-- | crawl-ref/.gitignore | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/.gitignore b/crawl-ref/.gitignore index 9efed9977f..bd8118f84f 100644 --- a/crawl-ref/.gitignore +++ b/crawl-ref/.gitignore @@ -20,6 +20,9 @@ art-enum.h # Autogenerated tile lists dc-unrand.txt +# Noise grid dump file +noise-grid.html + # Patch related junk *.diff *.orig |