Per-source movement sounds. (#22800)

Movement sounds for mobs are now handled by a single component. Movement
sounds are fed into it through signals, which contain both a movement
source (like an item for a mob, causing the sound) and a list of sounds
to pick from.

To-do:

- [x] Figure out how to do barefoot species sounds
- [x] Maybe movement sounds for simple mobs
- [x] More movement sounds for other items

---------

Signed-off-by: Matt Atlas <mattiathebest2000@hotmail.it>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
This commit is contained in:
Matt Atlas
2026-07-23 18:29:50 +00:00
committed by GitHub
co-authored by Matt Atlas VMSolidus
parent 901ad7f0cb
commit 5682f3c651
68 changed files with 365 additions and 43 deletions
-14
View File
@@ -954,8 +954,6 @@
var/silent = 0
var/last_trip = 0
var/footstep_sound_override
/obj/item/clothing/shoes/Destroy()
QDEL_NULL(holding)
return ..()
@@ -1074,18 +1072,6 @@
. = ..()
track_footprint = 0
/obj/item/clothing/shoes/proc/do_special_footsteps(var/running)
if(!footstep_sound_override)
return FALSE
if(ishuman(loc))
var/mob/living/carbon/human/wearer = loc
if(running)
playsound(wearer, footstep_sound_override, 70, 1, required_asfx_toggles = ASFX_FOOTSTEPS)
else
footstep++
if (footstep % 2)
playsound(wearer, footstep_sound_override, 40, 1, required_asfx_toggles = ASFX_FOOTSTEPS)
return TRUE
///////////////////////////////////////////////////////////////////////
//Suit
/obj/item/clothing/suit
@@ -31,19 +31,19 @@
species_restricted = null
gender = PLURAL
icon_base = null
footstep_sound_override = 'sound/machines/rig/rigstep.ogg'
movement_sounds = list('sound/machines/rig/rigstep.ogg')
/obj/item/clothing/shoes/magboots/rig/advanced
slowdown_active = 0
/obj/item/clothing/shoes/magboots/rig/medium
footstep_sound_override = 'sound/machines/rig/rigstep_medium.ogg'
movement_sounds = list('sound/machines/rig/rigstep_medium.ogg')
/obj/item/clothing/shoes/magboots/rig/heavy
footstep_sound_override = 'sound/machines/rig/rigstep_heavy.ogg'
movement_sounds = list('sound/machines/rig/rigstep_heavy.ogg')
/obj/item/clothing/shoes/magboots/rig/chonk
footstep_sound_override = 'sound/machines/rig/rigstep_chonk.ogg'
movement_sounds = list('sound/machines/rig/rigstep_chonk.ogg')
/obj/item/clothing/suit/space/rig
name = "chestpiece"
@@ -47,7 +47,7 @@
/obj/item/clothing/shoes/magboots/rig/light
name = "shoes"
footstep_sound_override = null
movement_sounds = null
/obj/item/clothing/head/helmet/space/rig/light
name = "hood"
@@ -67,6 +67,8 @@
species_restricted = list(BODYTYPE_SKRELL)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/kala
name = "qukala voidsuit helmet"
desc = "A sleek skrell voidsuit helmet that slightly shimmers as it moves. This one has a Nralakk Federation emblem on it."
@@ -30,6 +30,8 @@
species_restricted = list(BODYTYPE_TAJARA)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/pra
name = "kosmostrelki voidsuit helmet"
desc = "A tajaran helmet used by the crew of the Republican Orbital Fleet."
@@ -152,6 +154,8 @@
species_restricted = list(BODYTYPE_TAJARA)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/nka
name = "new kingdom mercantile voidsuit helmet"
desc = "An amalgamation of old civilian voidsuits and diving suits. This bulky space suit is used by the crew of the New Kingdom's mercantile navy."
@@ -201,6 +205,8 @@
species_restricted = list(BODYTYPE_TAJARA)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/dpra
name = "people's volunteer spacer militia voidsuit helmet"
desc = "A refitted, sturdy voidsuit created from Hegemony models acquired during the liberation of Gakal'zaal. These armored models are issued to the People's Volunteer Spacer Militia."
@@ -41,6 +41,8 @@
species_restricted = list(BODYTYPE_UNATHI)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/kataphract/spec
name = "kataphract specialist voidsuit helmet"
desc = "A tough plated helmet with slits for the eyes, emblazoned paint across the top indicates that it belongs to the Kataphracts of the Unathi Izweski Hegemony. This one has the markings of a Specialist."
@@ -106,6 +108,8 @@
species_restricted = list(BODYTYPE_UNATHI)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/unathi_pirate/captain
name = "unathi raider captain helmet"
desc = "A decent helmet made to fit with a larger combat assembly."
@@ -139,6 +143,8 @@
species_restricted = list(BODYTYPE_UNATHI)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/hegemony
name = "hegemony military helmet"
desc = "A Hephaestus-manufactured armoured space helmet, made for Unathi. Usually seen on soldiers of the Izweski Hegemony Navy."
@@ -213,6 +219,8 @@
RAD = ARMOR_RAD_SHIELDED
)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/suit/space/void/unathi_pirate/tarwa/captain
name = "tarwa conglomerate captain's voidsuit"
desc = "A mishmash of parts taken from Unathi pirate-made raider suits and hardware commonly found in the Southern frontier of the Spur, all held together by Diona bark, a common crafting method among the Unathi fleet of the Tarwa Conglomerate. \
@@ -48,6 +48,8 @@
species_restricted = list(BODYTYPE_HUMAN, BODYTYPE_SKRELL)
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_TAJARA, BODYTYPE_IPC, BODYTYPE_UNATHI, BODYTYPE_SKRELL)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/merc/unathi
refit_initialize = BODYTYPE_UNATHI
@@ -42,6 +42,8 @@
species_restricted = list(BODYTYPE_HUMAN)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/coalition
name = "coalition vulture voidsuit helmet"
desc = "A helmet resembling an avian, built for the All-Xanu Grand Army and the Frontier Rangers. Heavy and plated with plasteel across its faces."
@@ -91,6 +93,8 @@
icon_supported_species_tags = list("ipc", "skr", "taj")
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_TAJARA, BODYTYPE_IPC, BODYTYPE_SKRELL)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/coalition/xanu
name = "\improper Xanan eagle voidsuit helmet"
desc = "An advanced voidsuit helmet, designed specifically for the All-Xanu Armed Forces as a major upgrade to the iconic vulture voidsuit. Its armor has been upgraded, but it feels no heavier than a vulture."
@@ -165,6 +169,7 @@
species_restricted = list(BODYTYPE_HUMAN)
refittable = FALSE
/obj/item/clothing/head/helmet/space/void/cruiser
name = "cruiser voidsuit helmet"
desc = "A silvery chrome, single visor space helmet with built-in peripherals and very bright fore lighting. A favorite of bounty hunters."
@@ -209,6 +214,8 @@
species_restricted = list(BODYTYPE_HUMAN)
refittable = FALSE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/valkyrie
name = "valkyrie voidsuit helmet"
desc = "A slot-eyed space helmet, sleek and designed for military purposes. Colored in Elyran military camouflage."
@@ -256,6 +263,8 @@
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_IPC)
max_heat_protection_temperature = FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE + 10000
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/lancer
name = "lancer voidsuit helmet"
desc = "A sleek helmet with a bright yellow visor, expertly made in and colored in the iconic branding of Ceres' Lance."
@@ -305,6 +314,8 @@
species_restricted = list(BODYTYPE_HUMAN)
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_UNATHI)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/suit/space/void/lancer/unathi
desc = "A bulky void suit with heavy plating. Looks to be colored in the branding of Ceres' Lance. This one is fitted to Unathi."
refit_initialize = BODYTYPE_UNATHI
@@ -361,6 +372,8 @@
icon_supported_species_tags = list("skr", "ipc")
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_IPC, BODYTYPE_SKRELL)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
//Zeng-Hu Pharmaceuticals espionage voidsuit
/obj/item/clothing/head/helmet/space/void/zenghu
name = "dragon biohazard suit helmet"
@@ -413,6 +426,8 @@
icon_supported_species_tags = list("skr", "ipc")
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_SKRELL, BODYTYPE_IPC)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
//Hephaestus Industries espionage voidsuit
/obj/item/clothing/head/helmet/space/void/hephaestus
name = "caiman drop suit helmet"
@@ -465,6 +480,8 @@
icon_supported_species_tags = list("una")
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_UNATHI)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
//Zavodskoi Interstellar espionage voidsuit
/obj/item/clothing/head/helmet/space/void/zavodskoi
name = "revenant suit helmet"
@@ -514,6 +531,8 @@
species_restricted = list(BODYTYPE_HUMAN)
desc_extended = "A portable, sleek combat suit utilized in excess by Zavodskoi Interstellar private military contractors. It is known to be utilized by the company's most secretive sectors explicitly for espionage."
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
//Freelancer voidsuit
/obj/item/clothing/head/helmet/space/void/freelancer
name = "armored voidsuit helmet"
@@ -563,6 +582,8 @@
species_restricted = list(BODYTYPE_HUMAN, BODYTYPE_SKRELL)
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_TAJARA, BODYTYPE_IPC, BODYTYPE_UNATHI, BODYTYPE_SKRELL)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/dominia
name = "dominian prejoroub combat helmet"
desc = "A glamorous, decorated helmet with thick plating across its faces. It holds the emblematic markings of the Empire of Dominia, if its design wasn't unmistakable enough."
@@ -619,6 +640,8 @@
icon_supported_species_tags = list("una")
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_UNATHI)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/suit/space/void/dominia/voidsman
name = "dominian voidsman suit"
desc = "A Dominian voidsuit helmet issued to imperial fleet voidsmen. Not as flashy as most Dominian equipment tends to be."
@@ -717,6 +740,8 @@
RAD = ARMOR_RAD_SMALL
)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/golden_deep/hoplan
name = "hoplan voidsuit helmet"
desc = "This is an extremely bulky and heavily made voidsuit helmet used by the Hoplan, the military of the Golden Deep. Designed to provide extreme protection in all conditions, but not particularly comfortable for human use."
@@ -1076,6 +1101,8 @@
icon_supported_species_tags = list("ipc", "skr", "taj", "una", "vau", "vaw")
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_IPC, BODYTYPE_TAJARA, BODYTYPE_UNATHI, BODYTYPE_SKRELL, BODYTYPE_VAURCA)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/tcaf
name = "tau ceti armed forces voidsuit helmet"
desc = "A Zavodskoi-designed armored voidsuit helmet, painted in the colors of the Republic of Biesel. Commonly seen in use by personnel of the Tau Ceti Armed Forces."
@@ -1151,6 +1178,8 @@
siemens_coefficient = 0.35
contained_sprite = TRUE
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
/obj/item/clothing/head/helmet/space/void/outereyes
name = "\improper Outer Eyes voidsuit helmet"
desc = "A royal burgandy and black armoured helmet of the mysterious Outer Eyes. At the center of the helmet, a single white eye."
@@ -193,6 +193,8 @@
allowed = list(/obj/item/gun,/obj/item/flashlight,/obj/item/tank,/obj/item/suit_cooling_unit,/obj/item/melee/baton)
refittable_species = list(BODYTYPE_HUMAN, BODYTYPE_TAJARA, BODYTYPE_IPC, BODYTYPE_UNATHI, BODYTYPE_SKRELL)
movement_sounds = SFX_ARMOURED_VOIDSUIT_FOOTSTEPS
//Atmospherics Rig
/obj/item/clothing/head/helmet/space/void/atmos
desc = "A special helmet designed for work in a hazardous, low pressure environments. Has improved thermal protection and minor radiation shielding."
@@ -74,6 +74,8 @@
BODYTYPE_IPC= 'icons/obj/clothing/species/machine/suits.dmi'
)
movement_sounds = SFX_VOIDSUIT_FOOTSTEPS
action_button_name = "Toggle Helmet"
var/helmet_deploy_sound = 'sound/items/helmet_close.ogg'
var/helmet_retract_sound = 'sound/items/helmet_open.ogg'
@@ -10,6 +10,8 @@
restricted_accessory_slots = list(ACCESSORY_SLOT_ARMOR_PLATE, ACCESSORY_SLOT_ARM_GUARDS, ACCESSORY_SLOT_LEG_GUARDS, ACCESSORY_SLOT_ARMOR_POCKETS)
valid_accessory_slots = list(ACCESSORY_SLOT_ARMOR_PLATE, ACCESSORY_SLOT_ARM_GUARDS, ACCESSORY_SLOT_LEG_GUARDS, ACCESSORY_SLOT_ARMOR_POCKETS, ACCESSORY_SLOT_GENERIC, ACCESSORY_SLOT_ARMBAND, ACCESSORY_SLOT_CAPE, ACCESSORY_SLOT_UTILITY_MINOR)
pockets = null
movement_sounds = SFX_LIGHT_ARMOUR_FOOTSTEPS
movement_sound_volume = 10
/obj/item/clothing/suit/armor/carrier/dominia
name = "imperial army flak vest"
@@ -59,6 +61,8 @@
/obj/item/clothing/accessory/storage/modular_pouch
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/ballistic
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/ballistic,
@@ -67,6 +71,8 @@
/obj/item/clothing/accessory/storage/modular_pouch/large
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/ablative
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/ablative,
@@ -75,6 +81,8 @@
/obj/item/clothing/accessory/storage/modular_pouch/large
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/military
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/military,
@@ -83,6 +91,8 @@
/obj/item/clothing/accessory/storage/modular_pouch/large
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/heavy
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/heavy,
@@ -91,6 +101,8 @@
/obj/item/clothing/accessory/storage/modular_pouch/large
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/heavy/scc
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/heavy/scc,
@@ -116,6 +128,8 @@
/obj/item/clothing/accessory/storage/chestpouch
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/tcaf/tcaf_light
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/tcaf/tcaf_light,
@@ -131,6 +145,8 @@
/obj/item/clothing/accessory/storage/modular_pouch/large
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/suit/armor/carrier/lance
starting_accessories = list(
/obj/item/clothing/accessory/armor_plate/riot/lancer,
@@ -139,6 +155,8 @@
/obj/item/clothing/accessory/storage/modular_pouch/large
)
movement_sounds = SFX_HEAVY_ARMOUR_FOOTSTEPS
/obj/item/clothing/accessory/armor_plate
name = "corporate armor plate"
desc = "A particularly light-weight armor plate in stylish corporate black. Unfortunately, not very good if you hold it with your hands."
@@ -10,6 +10,7 @@
mob_swap_flags = ~HEAVY
light_system = MOVABLE_LIGHT
blocks_emissive = EMISSIVE_BLOCK_NONE
footstep_component_type = /datum/component/mob_footsteps/human
/mob/living/carbon/human/Initialize(mapload, var/new_species = null)
if(!dna)
@@ -129,15 +129,7 @@
handle_leg_damage()
var/turf/T = get_turf(loc)
var/footsound
var/top_layer = 0
if(istype(T))
for(var/obj/structure/S in T)
if(S.layer > top_layer && S.footstep_sound)
top_layer = S.layer
footsound = S.footstep_sound
if(!footsound)
footsound = T.footstep_sound
if (client && T)
var/turf/T1 = GET_TURF_ABOVE(T)
@@ -149,16 +141,7 @@
return
last_x = x
last_y = y
if(shoes)
var/obj/item/clothing/shoes/S = shoes
if(S.do_special_footsteps(m_intent))
return
if (m_intent == M_RUN)
playsound(src, (is_noisy ? footsound : species.footsound), 70, TRUE, extrarange = MEDIUM_RANGE_SOUND_EXTRARANGE, required_asfx_toggles = ASFX_FOOTSTEPS)
else
footstep++
if (footstep % 2)
playsound(src, (is_noisy ? footsound : species.footsound), 40, TRUE, extrarange = SHORT_RANGE_SOUND_EXTRARANGE, required_asfx_toggles = ASFX_FOOTSTEPS)
/mob/living/carbon/human/proc/handle_leg_damage()
if(!can_feel_pain())
+12
View File
@@ -917,6 +917,9 @@ default behaviour is:
register_init_signals()
AddElement(/datum/element/connect_loc, loc_connections)
load_footstep_component()
if(footstep_sound)
SEND_SIGNAL(src, COMSIG_MOB_ADD_FOOTSTEP_SOUND, src, footstep_sound)
/mob/living/Destroy()
cameraFollow = null
@@ -1075,3 +1078,12 @@ default behaviour is:
set_density(FALSE)
else
set_density(TRUE)
/**
* Used to override if a mob should have footsteps or not.
*/
/mob/living/proc/load_footstep_component()
if(anchored)
return
LoadComponent(footstep_component_type)
@@ -41,6 +41,10 @@
var/fire_stacks_temperature = 0
var/footstep = 0
/// The type of footstep components spawned for the mob. Particularly important for humans, which have barefoot sounds.
var/footstep_component_type = /datum/component/mob_footsteps
/// The footstep sounds we want to play.
var/list/footstep_sound
/// This is used to determine if the mob failed a breath. If they did fail a breath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/failed_last_breath = 0
@@ -51,6 +51,7 @@
attack_sound = 'sound/weapons/bite.ogg'
emote_sounds = list('sound/effects/creatures/spider_critter.ogg')
sample_data = list("Genetic markers identified as being linked with stem cell differentiaton", "Tissue sample contains high muscle content")
footstep_sound = 'sound/effects/creatures/spider_walk.ogg'
//nursemaids - these create webs and eggs
/mob/living/simple_animal/hostile/giant_spider/nurse
@@ -1158,6 +1158,11 @@
visual_effect_icon = ATTACK_EFFECT_SMASH
..()
/mob/living/simple_animal/load_footstep_component()
if(flying || !footstep_sound)
return
return ..()
#undef BLOOD_NONE
#undef BLOOD_LIGHT
#undef BLOOD_MEDIUM