View Single Post
Old September 9, 2018, 15:45   #3
t4nk
Swordsman
 
Join Date: May 2016
Posts: 330
t4nk is on a distinguished road
Quote:
Originally Posted by wobbly View Post
Just checking some stuff.
The calculations are:

edit: (LOL, disregard that. I just remembered that my Angband repo is on 4.0.5! I recall Nick changed stealth when he changed pathfinding)
edit2: (It seems he changed it back? well, then the description below is correct)

Player's noise is 1 << (30 - stealth). In other words, noise is 2 in the power of (30 - stealth).

Then, the game does this:
Code:
int notice = randint(1024);

if (notice * notice * notice <= noise)
{
    int wake_up_amount = 1;

    if (distance_to_player < 50)
         wake_up_amount = 100 / distance_to_player;

    wake_up_monster_a_little(wake_up_amount);
}
The noise stuff is in player-calcs.c: calc_bonuses() and other stuff in mon-move.c: process_monster_timed().

edit: in 4.1.3 it's in monster_reduce_sleep()

Quote:
A monster wakes on it's own turn? Perception is effectively multiplied by monster speed & divided by player speed. Chance is stealth dependent?
Amount of sleepiness lost is distance dependent?
Yes to all of that.

Last edited by t4nk; September 9, 2018 at 16:04.
t4nk is offline   Reply With Quote