{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/87624040","pull_request_review_id":8232614,"id":87624040,"diff_hunk":"@@ -160,9 +161,48 @@ static std::vector<centroid> cluster_sounds( std::vector<std::pair<tripoint, int\n     return sound_clusters;\n }\n \n+int get_signal_for_hordes(int vol)\n+{\n+    int min_vol_for_hordes_cap = 61;\n+    int per_level_down_vol_reduce_coef_for_hordes = 2;\n+    int min_vol_for_hordes = 61;\n+    int max_vol_for_hordes = 200;\n+    int min_sig_power_for_hordes = 4;\n+    int max_sig_power_for_hordes = 8;\n+    //Lower the level- lower the sound\n+    int vol_hordes=( (g->get_levz() < 0 ) ? vol/(per_level_down_vol_reduce_coef_for_hordes*std::abs(g->get_levz())) : vol);\n+    //debugmsg( \"vol_hordes %d  g->get_levz() %d \",vol_hordes, g->get_levz());\n+    if( vol_hordes > min_vol_for_hordes_cap) {\n+        vol_hordes = ( (vol_hordes > max_vol_for_hordes ) ? max_vol_for_hordes : vol_hordes);\n+        // Formula for hordes hearing. Normalazing [min_vol_for_hordes,max_vol_for_hordes] ==> [min_sig_power_for_hordes,max_sig_power_for_hordes]\n+        int sig_power = (vol_hordes-min_vol_for_hordes)*(max_sig_power_for_hordes-min_sig_power_for_hordes)/(max_vol_for_hordes-min_vol_for_hordes)+min_sig_power_for_hordes;\n+        sig_power=( (sig_power <min_sig_power_for_hordes ) ? 0: min_sig_power_for_hordes);\n+        //debugmsg( \"vol %d  vol_hordes %d sig_power %d \", vol, vol_hordes, sig_power);\n+        return sig_power;\n+    }\n+    return 0;\n+}\n+\n+int get_signal_for_hordes_simple(int vol)\n+{\n+    int min_vol_for_hordes_cap = 61;\n+    int per_level_down_vol_reduce_coef_for_hordes = 2;\n+    int coef_for_hordes = 30;//= 1 overmap tile\n+    //Lower the level- lower the sound\n+    int vol_hordes=( (g->get_levz() < 0 ) ? vol/(per_level_down_vol_reduce_coef_for_hordes*std::abs(g->get_levz())) : vol);\n+    //debugmsg( \"vol_hordes %d  g->get_levz() %d \",vol_hordes, g->get_levz());\n+    if( vol_hordes > min_vol_for_hordes_cap) {\n+        //using simple formula\n+        int sig_power =vol_hordes/coef_for_hordes +1;\n+        //debugmsg( \"vol %d  vol_hordes %d sig_power %d \", vol, vol_hordes, sig_power);\n+        return sig_power;\n+    }\n+    return 0;\n+}\n+\n void sounds::process_sounds()\n {\n-    std::vector<centroid> sound_clusters = cluster_sounds( recent_sounds );\n+\tstd::vector<centroid> sound_clusters = cluster_sounds( recent_sounds );","path":"src/sounds.cpp","position":54,"original_position":54,"commit_id":"44521358004c69200a528923afbbc3266d870d6a","original_commit_id":"44521358004c69200a528923afbbc3266d870d6a","user":{"login":"Coolthulhu","id":1878860,"avatar_url":"https://avatars.githubusercontent.com/u/1878860?v=3","gravatar_id":"","url":"https://api.github.com/users/Coolthulhu","html_url":"https://github.com/Coolthulhu","followers_url":"https://api.github.com/users/Coolthulhu/followers","following_url":"https://api.github.com/users/Coolthulhu/following{/other_user}","gists_url":"https://api.github.com/users/Coolthulhu/gists{/gist_id}","starred_url":"https://api.github.com/users/Coolthulhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Coolthulhu/subscriptions","organizations_url":"https://api.github.com/users/Coolthulhu/orgs","repos_url":"https://api.github.com/users/Coolthulhu/repos","events_url":"https://api.github.com/users/Coolthulhu/events{/privacy}","received_events_url":"https://api.github.com/users/Coolthulhu/received_events","type":"User","site_admin":false},"body":"Looks like your IDE changed spaces here to tabs.\r\nYou'll need to change all tabs to 4 spaces each. Most IDEs support automatic tab->spaces.","created_at":"2016-11-11T17:18:19Z","updated_at":"2016-11-11T17:18:19Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19222#discussion_r87624040","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/87624040"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19222#discussion_r87624040"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222","id":93043039,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19222","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19222.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19222.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19222","number":19222,"state":"open","locked":false,"title":"[WIP] Rework hordes hearing signal calculation","user":{"login":"Firestorm01X2","id":17512620,"avatar_url":"https://avatars.githubusercontent.com/u/17512620?v=3","gravatar_id":"","url":"https://api.github.com/users/Firestorm01X2","html_url":"https://github.com/Firestorm01X2","followers_url":"https://api.github.com/users/Firestorm01X2/followers","following_url":"https://api.github.com/users/Firestorm01X2/following{/other_user}","gists_url":"https://api.github.com/users/Firestorm01X2/gists{/gist_id}","starred_url":"https://api.github.com/users/Firestorm01X2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firestorm01X2/subscriptions","organizations_url":"https://api.github.com/users/Firestorm01X2/orgs","repos_url":"https://api.github.com/users/Firestorm01X2/repos","events_url":"https://api.github.com/users/Firestorm01X2/events{/privacy}","received_events_url":"https://api.github.com/users/Firestorm01X2/received_events","type":"User","site_admin":false},"body":"Currently wander spawn (aka hordes) is hardcore mode for hardcore players. Actually even players who play Cataclysm for long time and who want to increase difficulty tend to avoid wander spawn.\r\n\r\nThe main reason of that - horde can hear gunshot from insane distance and have tricky and unfinished spawn and moving algorithms.\r\n\r\nThis PR tries to fix insane hearing distance and rework hearing formula for hordes.\r\n\r\nHere what we have new:\r\n* New formula that normalizes hearing sounds to overmap without coefficient. It can be easily tweaked further. Actually it scales sound interval like [X1,Y1] to overmap interval [X2,Y2] (http://stackoverflow.com/questions/929103/convert-a-number-range-to-another-range-maintaining-ratio);\r\n* Reduced hearing for hordes. Now city hordes should not hear you if you are in wilderness;\r\n* Hordes will hear only really loud sound that can leave reality bubble;\r\n* Hordes can actually hear you not only if you produce sound on zero z-level (ground). However if you stay under ground then ground cover sound partially. The lower you are - less sound you produce for hordes.\r\n\r\nNew hordes hearing interval in overmap tiles is [4,8]\r\n\r\nDiscussion is here:\r\nhttp://smf.cataclysmdda.com/index.php?topic=13632.0","created_at":"2016-11-09T21:34:42Z","updated_at":"2016-11-11T17:18:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eed9fb0a4f6615c1e7ecb11a0c8f41c9fcf8fde8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222/comments","review_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19222/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/44521358004c69200a528923afbbc3266d870d6a","head":{"label":"Firestorm01X2:hordesignalrework","ref":"hordesignalrework","sha":"44521358004c69200a528923afbbc3266d870d6a","user":{"login":"Firestorm01X2","id":17512620,"avatar_url":"https://avatars.githubusercontent.com/u/17512620?v=3","gravatar_id":"","url":"https://api.github.com/users/Firestorm01X2","html_url":"https://github.com/Firestorm01X2","followers_url":"https://api.github.com/users/Firestorm01X2/followers","following_url":"https://api.github.com/users/Firestorm01X2/following{/other_user}","gists_url":"https://api.github.com/users/Firestorm01X2/gists{/gist_id}","starred_url":"https://api.github.com/users/Firestorm01X2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firestorm01X2/subscriptions","organizations_url":"https://api.github.com/users/Firestorm01X2/orgs","repos_url":"https://api.github.com/users/Firestorm01X2/repos","events_url":"https://api.github.com/users/Firestorm01X2/events{/privacy}","received_events_url":"https://api.github.com/users/Firestorm01X2/received_events","type":"User","site_admin":false},"repo":{"id":69897544,"name":"Cataclysm-DDA","full_name":"Firestorm01X2/Cataclysm-DDA","owner":{"login":"Firestorm01X2","id":17512620,"avatar_url":"https://avatars.githubusercontent.com/u/17512620?v=3","gravatar_id":"","url":"https://api.github.com/users/Firestorm01X2","html_url":"https://github.com/Firestorm01X2","followers_url":"https://api.github.com/users/Firestorm01X2/followers","following_url":"https://api.github.com/users/Firestorm01X2/following{/other_user}","gists_url":"https://api.github.com/users/Firestorm01X2/gists{/gist_id}","starred_url":"https://api.github.com/users/Firestorm01X2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Firestorm01X2/subscriptions","organizations_url":"https://api.github.com/users/Firestorm01X2/orgs","repos_url":"https://api.github.com/users/Firestorm01X2/repos","events_url":"https://api.github.com/users/Firestorm01X2/events{/privacy}","received_events_url":"https://api.github.com/users/Firestorm01X2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Firestorm01X2/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA","forks_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/Firestorm01X2/Cataclysm-DDA/deployments","created_at":"2016-10-03T18:15:16Z","updated_at":"2016-10-03T18:15:25Z","pushed_at":"2016-11-11T17:06:15Z","git_url":"git://github.com/Firestorm01X2/Cataclysm-DDA.git","ssh_url":"git@github.com:Firestorm01X2/Cataclysm-DDA.git","clone_url":"https://github.com/Firestorm01X2/Cataclysm-DDA.git","svn_url":"https://github.com/Firestorm01X2/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":813003,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CleverRaven:master","ref":"master","sha":"3dfe2f4c1edd53e2e53abf0d748fba6cfc7fc6c2","user":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"repo":{"id":5973855,"name":"Cataclysm-DDA","full_name":"CleverRaven/Cataclysm-DDA","owner":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":false,"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","forks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/releases{/id}","deployments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/deployments","created_at":"2012-09-26T22:57:43Z","updated_at":"2016-11-11T03:00:43Z","pushed_at":"2016-11-11T17:06:17Z","git_url":"git://github.com/CleverRaven/Cataclysm-DDA.git","ssh_url":"git@github.com:CleverRaven/Cataclysm-DDA.git","clone_url":"https://github.com/CleverRaven/Cataclysm-DDA.git","svn_url":"https://github.com/CleverRaven/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":1091444,"stargazers_count":1138,"watchers_count":1138,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":984,"mirror_url":null,"open_issues_count":1081,"forks":984,"open_issues":1081,"watchers":1138,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/19222"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19222"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/19222/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222/comments"},"review_comment":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/19222/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/44521358004c69200a528923afbbc3266d870d6a"}}}}
{"actor":{"display_login":"Coolthulhu"}}