bark followup - audio balance pass, bark intercepts, yelling nerf, falloff fix, etc!

This commit is contained in:
deathride58
2022-06-11 19:39:48 -04:00
parent 3ec6a024c7
commit 17917ed564
7 changed files with 34 additions and 8 deletions

View File

@@ -244,6 +244,7 @@
// #define HEARING_SPANS 6
#define HEARING_MESSAGE_MODE 7
// #define HEARING_SOURCE 8
#define COMSIG_MOVABLE_BARK "movable_bark" //from base of atom/movable/proc/Bark(): (list/hearers, distance, volume, pitch)
#define COMSIG_MOVABLE_DISPOSING "movable_disposing" //called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
#define COMSIG_MOVABLE_TELEPORTED "movable_teleported" //from base of do_teleport(): (channel, turf/origin, turf/destination)
#define COMSIG_MOVABLE_CHASM_DROP "movable_chasm_drop" //from base of /datum/component/chasm/drop() (/datum/component/chasm)

View File

@@ -115,6 +115,8 @@
#define BARK_DO_VARY(pitch, variance) (rand(((pitch * 100) - (variance*50)), ((pitch*100) + (variance*50))) / 100)
#define BARK_SOUND_FALLOFF_EXPONENT(distance) (distance/7) //At lower ranges, we want the exponent to be below 1 so that whispers don't sound too awkward. At higher ranges, we want the exponent fairly high to make yelling less obnoxious
// Is something in the IC chat filter? This is config dependent.
#define CHAT_FILTER_CHECK(T) (config.ic_filter_regex && findtext(T, config.ic_filter_regex))

View File

@@ -72,8 +72,8 @@
/datum/bark/chitter
name = "Chittery"
id = "chitter"
minspeed = 6 //This is a pretty long sound
soundpath = 'sound/items/Ratchet.ogg'
minspeed = 4 //Even with the sound being replaced with a unique, shorter sound, this is still a little too long for higher speeds
soundpath = 'sound/voice/barks/chitter.ogg'
/datum/bark/synthetic_grunt
name = "Synthetic (Grunt)"
@@ -91,6 +91,11 @@
maxpitch = 1.6 //This works well with higher pitches!
soundpath = 'sound/weapons/bulletflyby.ogg' //This works... Surprisingly well as a bark? It's neat!
/datum/bark/coggers
name = "Brassy"
id = "coggers"
soundpath = 'sound/machines/clockcult/integration_cog_install.ogg' //Yet another unexpectedly good bark sound
// Genetics-only/admin-only sounds. These either clash hard with the audio design of the above sounds, or have some other form of audio design issue, but aren't *too* awful as a sometimes thing.
// Rule of fun very much applies to this section. Audio design is extremely important for the above section, but down here? No gods, no masters, pure anarchy.
@@ -137,3 +142,9 @@
id = "weh"
soundpath = 'modular_citadel/sound/voice/weh.ogg'
ignore = TRUE
/datum/bark/honk
name = "Annoying Honk"
id = "honk"
soundpath = 'sound/creatures/goose1.ogg'
ignore = TRUE

View File

@@ -72,6 +72,8 @@
var/vocal_volume = 70 //Baseline. This gets modified by yelling and other factors
var/vocal_speed = 4 //Lower values are faster, higher values are slower
var/vocal_current_bark //When barks are queued, this gets passed to the bark proc. If vocal_current_bark doesn't match the args passed to the bark proc (if passed at all), then the bark simply doesn't play. Basic curtailing of spam~
/atom/movable/Initialize(mapload)
. = ..()
switch(blocks_emissive)
@@ -225,6 +227,10 @@
if(NAMEOF(src, glide_size))
set_glide_size(var_value)
. = TRUE
if(NAMEOF(src, vocal_bark))
if(isfile(vocal_bark))
vocal_bark = sound(vocal_bark) //bark() expects vocal_bark to already be a sound datum, for performance reasons. adminbus QoL!
. = TRUE
if(!isnull(.))
datum_flags |= DF_VAR_EDITED

View File

@@ -31,14 +31,18 @@ GLOBAL_LIST_INIT(freqtospan, list(
/atom/movable/proc/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
SEND_SIGNAL(src, COMSIG_MOVABLE_HEAR, args)
/atom/movable/proc/bark(list/hearers, distance, volume, pitch)
/atom/movable/proc/bark(list/hearers, distance, volume, pitch, queue_time)
if(queue_time && vocal_current_bark != queue_time)
return
if(SEND_SIGNAL(src, COMSIG_MOVABLE_BARK, hearers, distance, volume, pitch))
return //bark interception. this probably counts as some flavor of BDSM
if(!vocal_bark)
if(!vocal_bark_id || !set_bark(vocal_bark_id)) //just-in-time bark generation
return
volume = min(volume, 100)
var/turf/T = get_turf(src)
for(var/mob/M in hearers)
M.playsound_local(T, vol = volume, vary = TRUE, frequency = pitch, max_distance = distance, falloff_distance = distance * 0.75, S = vocal_bark, distance_multiplier = 1)
M.playsound_local(T, vol = volume, vary = TRUE, frequency = pitch, max_distance = distance, falloff_distance = 0, falloff_exponent = BARK_SOUND_FALLOFF_EXPONENT(distance), S = vocal_bark, distance_multiplier = 1)
/atom/movable/proc/can_speak()
return 1
@@ -57,10 +61,11 @@ GLOBAL_LIST_INIT(freqtospan, list(
hearers -= M
var/barks = min(round((LAZYLEN(message) / vocal_speed)) + 1, BARK_MAX_BARKS)
var/total_delay
vocal_current_bark = world.time //this is juuuuust random enough to reliably be unique every time send_speech() is called, in most scenarios
for(var/i in 1 to barks)
if(total_delay > BARK_MAX_TIME)
break
addtimer(CALLBACK(src, .proc/bark, hearers, range, vocal_volume, BARK_DO_VARY(vocal_pitch, vocal_pitch_range)), total_delay)
addtimer(CALLBACK(src, .proc/bark, hearers, range, vocal_volume, BARK_DO_VARY(vocal_pitch, vocal_pitch_range), vocal_current_bark), total_delay)
total_delay += rand(DS2TICKS(vocal_speed / BARK_SPEED_BASELINE), DS2TICKS(vocal_speed / BARK_SPEED_BASELINE) + DS2TICKS(vocal_speed / BARK_SPEED_BASELINE)) TICKS
/atom/movable/proc/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, face_name = FALSE, atom/movable/source)

View File

@@ -298,7 +298,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_LIVING_SAY_SPECIAL, src, message)
var/is_yell = (say_test(message) == "2")
if(client && !eavesdrop_range && is_yell) // Yell hook
if(/*client && */!eavesdrop_range && is_yell) // Yell hook
listening |= process_yelling(listening, rendered, src, message_language, message, spans, message_mode, source)
//speech bubble
@@ -319,11 +319,12 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
listening -= M
var/barks = min(round((LAZYLEN(message) / vocal_speed)) + 1, BARK_MAX_BARKS)
var/total_delay
vocal_current_bark = world.time
for(var/i in 1 to barks)
if(total_delay > BARK_MAX_TIME)
break
addtimer(CALLBACK(src, /atom/movable/proc/bark, listening, (message_range * (is_yell ? 4 : 1)), (vocal_volume * (is_yell ? 1.5 : 1)), BARK_DO_VARY(vocal_pitch, vocal_pitch_range)), total_delay)
total_delay += rand(DS2TICKS((vocal_speed / BARK_SPEED_BASELINE) * (is_yell ? 0.5 : 1)), DS2TICKS(vocal_speed / BARK_SPEED_BASELINE) + DS2TICKS((vocal_speed / BARK_SPEED_BASELINE) * (is_yell ? 0.5 : 1))) TICKS
addtimer(CALLBACK(src, /atom/movable/proc/bark, listening, (message_range * (is_yell ? 4 : 1)), (vocal_volume * (is_yell ? 1.5 : 1)), BARK_DO_VARY(vocal_pitch, vocal_pitch_range), vocal_current_bark), total_delay)
total_delay += rand(DS2TICKS(vocal_speed / BARK_SPEED_BASELINE), DS2TICKS(vocal_speed / BARK_SPEED_BASELINE) + DS2TICKS((vocal_speed / BARK_SPEED_BASELINE) * (is_yell ? 0.5 : 1))) TICKS
/atom/movable/proc/process_yelling(list/already_heard, rendered, atom/movable/speaker, datum/language/message_language, message, list/spans, message_mode, obj/source)

Binary file not shown.