Please sign in to comment.
Add a noise meter to the HUD
Noise is one of the more complicated systems in dcss, yet it's barely represented in the UI. This is partly because there's just so much information to represent. This commit attempts to partially solve this problem by providing a very simple UI element that summarizes noise heard by the player during the last turn in the form of a meter. This meter peaks at the loudest noise audible at the player's position during that turn, and will switch between several different colors (details vary slightly for different interfaces), described below. I chose to use sound that has propagated to the player, so more distant events will be attenuated by distance and dungeon features -- the idea is to give a measure as to how likely things are to move towards the player's position. While experienced players may have internalized a lot of this, most of this information is not at all apparent to less experienced players, and I think this UI element is potentially extremely useful (as opposed to clutter). 1. lightgray: the noise level at the player's position is within a range that makes it unlikely to propagate outside the player's los (though this can happen depending on terrain). Or more simply: this noise is probably basically ok. Most low-medium melee damage is in this category, as are most low-damage spells. 2. yellow: the noise heard at the player's position is likely to propagate outside the player's los, up to twice the los radius. Or more simply: this noise is bad. Shouting, distant fireballs, high damage melee attacks, high damage spells (e.g. many bolt spells), door creaks are in this category. longbows and bigger crossbows are on the border of this category. 3. red: the noise is like to be heard at a substantial distance, on an open level more than 2x the los radius. Or more simply: this noise is very bad. This category includes howler monkeys, lightning bolt, nearby fireballs, qazlal at pieties above ****. (Though thunder clouds may randomly produce red noise at nearly any piety.) 4. lightmagenta: these sounds are off the meter, the loudest sounds you can make. Includes: shatter, gong, ood collision, orb apport/pickup Potential issues/complications: * This implementation uses a heuristic for branch noise adjustment that is kind of hacky. A better (but much more complicated) solution might be to sample noise at various distances directly from the noise grid. Right now I just use a constant addition or subtraction to model the effects of branch noise; in e.g. shoals or crypt this will push some of the category boundaries for colors around. * An alternative approach would be to not use attenuated noise at all, but find the loudest noise (before propagation) in the player's los. * In wizmode there is also a numeric version of the meter displayed, but I decided this is too uninterpretable to be useful to players. (But, the heuristic for normal noise branches is: in a completely open area a sound of loudness l will propagate approximately l/.85 spaces.) * exposing this to the player may reveal some cases where it is not entirely intuitive that no sound is made. (For example, berserking is silent (but unstealthy) except when opening doors.) This is good! The noise bar replaces gold in the HUD; Gozagites now have gold where the piety bar would be.
- Loading branch information...
Showing with 364 additions and 32 deletions.
- +9 −3 crawl-ref/docs/crawl_manual.rst
- +1 −1 crawl-ref/source/duration-data.h
- +8 −0 crawl-ref/source/main.cc
- +1 −0 crawl-ref/source/mon-death.cc
- +2 −0 crawl-ref/source/nearby-danger.cc
- +122 −17 crawl-ref/source/output.cc
- +51 −0 crawl-ref/source/player.cc
- +5 −0 crawl-ref/source/player.h
- +21 −0 crawl-ref/source/shout.cc
- +2 −0 crawl-ref/source/tileweb.cc
- +2 −0 crawl-ref/source/tileweb.h
- +109 −4 crawl-ref/source/webserver/game_data/static/player.js
- +17 −1 crawl-ref/source/webserver/game_data/static/style.css
- +14 −6 crawl-ref/source/webserver/game_data/templates/game.html
Oops, something went wrong.