Skip to content

Commit

Permalink
[PORT] Droning Subsystem (#596)
Browse files Browse the repository at this point in the history
## About The Pull Request

This PR ports the Droning Subsystem from EFN.

The Droning SS is used for playing looped music for the area's that
players are in. Different music can be given to different areas and
areas can have multiple different tracks tied to them that will change
when a player enters said area. In my opinion this is a super cool
Subsystem that we could benefit a lot from because it adds much more
atmosphere to the ship when properly setup. (Video previews in proof of
testing are a bit short due to github file size limitations)

This Subsystem does not replace the already existing ship ambience,
instead it plays at the same time adding to the soundscape of the server
in a unique way.

Currently on this PR I have given the different Areas featured on
Belryth their own tracks and it is making for a nice and dark atmosphere
aboard an old and forgotten ship. All the tracks on the PR currently are
simple liminal tracks and
ambient droning. This SS does not come with a pref that players can
toggle and I am not intending to add one either.

All tracks have been sourced from: https://freesound.org/ See below for
all the tracks that have been used on this PR.

<details>
<summary>Tracks used:</summary> <!-- Leave the line after this one
empty. Embeds like breaking if you don't -->

https://freesound.org/people/ZHR%C3%98/sounds/692011/

https://freesound.org/people/ZHR%C3%98/sounds/531447/

https://freesound.org/people/ZHR%C3%98/sounds/692006/

https://freesound.org/people/ZHR%C3%98/sounds/692009/

https://freesound.org/people/ZHR%C3%98/sounds/702966/

https://freesound.org/people/Mellau/sounds/505667/

https://freesound.org/people/GregorQuendel/sounds/674408/

</details>

Code and inspiration taken from Escape from Nevado:
- https://gitgud.io/the-itobe-denomination/escape-from-nevado
-
https://gitgud.io/the-itobe-denomination/escape-from-nevado/-/blob/master/modular_septic/code/controllers/subsystem/droning.dm

## How Does This Help ***Gameplay***?
Background music ontop of the normal sounds + the ambience sound system
is so much better. The atmosphere is completely different on the ship
now and it feels much darker and drearier.

## How Does This Help ***Roleplay***?
Immersion, adding this to our soundscape makes me feel 10x more immersed
when im standing in some shitty dark corner on Belryth.

## Proof of Testing
<details>
<summary>Screenshots/Videos</summary> <!-- Leave the line after this one
empty. Embeds like breaking if you don't -->

# SOUND ON 🔉 


https://github.com/Artea-Station/Artea-Station-Server/assets/79924768/dc8e2aa8-9b01-482d-9604-889805cf91fa

## Normal ship droning


https://github.com/Artea-Station/Artea-Station-Server/assets/79924768/5c5da108-8648-4068-a27a-8b014c193940

## Medical Droning


https://github.com/Artea-Station/Artea-Station-Server/assets/79924768/293a0280-5cb7-42a7-946a-b10474037a12

## Engi Droning


https://github.com/Artea-Station/Artea-Station-Server/assets/79924768/ef6a093f-e4e2-47d1-97d2-cbd358023ca9

</details>

## Changelog
:cl:
soundadd: Added multiple tracks of background music that change
depending on the area of the ship you are in.
/:cl:

---------

Signed-off-by: Rimi Nosha <riminosha@gmail.com>
Co-authored-by: Rimi Nosha <riminosha@gmail.com>
  • Loading branch information
QuacksQ and RimiNosha authored Oct 5, 2024
1 parent 2c8e94d commit 7d9a36b
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 1 deletion.
14 changes: 14 additions & 0 deletions code/__DEFINES/droning_defines.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#define DRONING_DEFAULT list('sound/ambience/shipambience.ogg')

#define DRONING_AMBIENCE list('sound/droning/ambience1.ogg')

#define DRONING_NORMAL list('sound/droning/normal_droning1.ogg', \
'sound/droning/normal_droning2.ogg')

#define DRONING_ENGINEERING list('sound/droning/engi_droning1.ogg')

#define DRONING_MAINTENANCE list('sound/droning/maint_droning1.ogg')

#define DRONING_SECURITY list('sound/droning/sec_droning1.ogg')

#define DRONING_MEDICAL list('sound/droning/med_droning1.ogg')
36 changes: 36 additions & 0 deletions code/controllers/subsystem/droning.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//Used to manage sending droning sounds to various clients
SUBSYSTEM_DEF(droning)
name = "Droning"
flags = SS_NO_INIT|SS_NO_FIRE

/datum/controller/subsystem/droning/proc/area_entered(area/area_entered, client/entering)
if(!area_entered || !entering)
return
var/list/last_droning = list()
last_droning |= entering.last_droning_sound
var/list/new_droning = list()
new_droning |= area_entered.droning_sound
//Same ambience, don't bother
if(last_droning ~= new_droning)
return
play_area_sound(area_entered, entering)

/datum/controller/subsystem/droning/proc/play_area_sound(area/area_player, client/listener)
if(!area_player || !listener)
return
if(LAZYLEN(area_player.droning_sound) && (listener.prefs.toggles & SOUND_SHIP_AMBIENCE))
//kill the previous droning sound
kill_droning(listener)
var/sound/droning = sound(pick(area_player.droning_sound), area_player.droning_repeat, area_player.droning_wait, area_player.droning_channel, area_player.droning_volume)
SEND_SOUND(listener, droning)
listener.droning_sound = droning
listener.last_droning_sound = area_player.droning_sound

/datum/controller/subsystem/droning/proc/kill_droning(client/victim)
if(!victim?.droning_sound)
return
var/sound/sound_killer = sound()
sound_killer.channel = victim.droning_sound.channel
SEND_SOUND(victim, sound_killer)
victim.droning_sound = null
victim.last_droning_sound = null
15 changes: 15 additions & 0 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@
/// The airlock controller in this area. Used by mapped custom controllers to yell at mappers.
var/obj/machinery/airlock_controller/airlock_controller

/// DRONING SYSTEM VARIABLES
var/droning_sound = DRONING_DEFAULT
var/droning_vary = 0
var/droning_repeat = TRUE
var/droning_wait = 0
var/droning_volume = 25
var/droning_channel = CHANNEL_BUZZ
var/droning_frequency = 0

/**
* A list of teleport locations
*
Expand Down Expand Up @@ -416,6 +425,12 @@ GLOBAL_LIST_EMPTY(teleportlocs)
if(!isliving(arrived))
return

var/mob/living/living_arrived = arrived
if(living_arrived.client && !living_arrived.combat_mode)
//Ambience if combat mode is off
SSdroning.area_entered(src, living_arrived.client)
return

var/mob/living/L = arrived
if(!L.ckey)
return
Expand Down
13 changes: 12 additions & 1 deletion code/game/area/areas/station.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
icon = 'icons/area/areas_station.dmi'
icon_state = "station"
allow_door_remotes = TRUE
droning_sound = DRONING_NORMAL
droning_volume = 15

//Maintenance

Expand All @@ -13,10 +15,12 @@
ambience_index = AMBIENCE_MAINT
area_flags = BLOBS_ALLOWED | UNIQUE_AREA | CULT_PERMITTED | PERSISTENT_ENGRAVINGS
airlock_wires = /datum/wires/bulkhead/maint
sound_environment = SOUND_AREA_TUNNEL_ENCLOSED
sound_environment = SOUND_AREA_LARGE_ENCLOSED
forced_ambience = TRUE
ambient_buzz = 'sound/ambience/source_corridor2.ogg'
ambient_buzz_vol = 20
droning_sound = DRONING_MAINTENANCE
droning_volume = 15

//Maintenance - Departmental

Expand Down Expand Up @@ -306,6 +310,7 @@
/area/station/hallway
icon_state = "hall"
sound_environment = SOUND_AREA_STANDARD_STATION
droning_sound = DRONING_NORMAL

/area/station/hallway/primary
name = "\improper Primary Hallway"
Expand Down Expand Up @@ -833,6 +838,8 @@
ambience_index = AMBIENCE_ENGI
airlock_wires = /datum/wires/bulkhead/engineering
sound_environment = SOUND_AREA_LARGE_ENCLOSED
droning_sound = DRONING_ENGINEERING
droning_volume = 15

/area/station/engineering/engine_smes
name = "\improper Engineering SMES"
Expand Down Expand Up @@ -1100,6 +1107,8 @@
sound_environment = SOUND_AREA_STANDARD_STATION
min_ambience_cooldown = 90 SECONDS
max_ambience_cooldown = 180 SECONDS
droning_sound = DRONING_MEDICAL
droning_volume = 15

/area/station/medical/abandoned
name = "\improper Abandoned Medbay"
Expand Down Expand Up @@ -1220,6 +1229,8 @@
ambience_index = AMBIENCE_DANGER
airlock_wires = /datum/wires/bulkhead/security
sound_environment = SOUND_AREA_STANDARD_STATION
droning_sound = DRONING_SECURITY
droning_volume = 15

/area/station/security/office
name = "\improper Security Office"
Expand Down
5 changes: 5 additions & 0 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,8 @@
/// Holder variables for viewport scaling.
var/last_view_x_dim = 7
var/last_view_y_dim = 7

/// Used by the area music system to avoid repeating tracks
var/last_droning_sound
/// Current ambient track
var/sound/droning_sound
2 changes: 2 additions & 0 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
if (!stealth_admin)
deadchat_broadcast(" has disconnected.", "<b>[mob][mob.get_realname_string()]</b>", follow_target = mob, turf_target = get_turf(mob), message_type = DEADCHAT_LOGIN_LOGOUT, admin_only=!announce_join)
mob.become_uncliented()
QDEL_NULL(droning_sound)
last_droning_sound = null

GLOB.clients -= src
GLOB.directory -= ckey
Expand Down
Binary file added sound/droning/ambience1.ogg
Binary file not shown.
Binary file added sound/droning/engi_droning1.ogg
Binary file not shown.
Binary file added sound/droning/maint_droning1.ogg
Binary file not shown.
Binary file added sound/droning/med_droning1.ogg
Binary file not shown.
Binary file added sound/droning/normal_droning1.ogg
Binary file not shown.
Binary file added sound/droning/normal_droning2.ogg
Binary file not shown.
Binary file added sound/droning/sec_droning1.ogg
Binary file not shown.
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include "code\__DEFINES\DNA.dm"
#include "code\__DEFINES\do_afters.dm"
#include "code\__DEFINES\drone.dm"
#include "code\__DEFINES\droning_defines.dm"
#include "code\__DEFINES\dye_keys.dm"
#include "code\__DEFINES\dynamic.dm"
#include "code\__DEFINES\economy.dm"
Expand Down Expand Up @@ -533,6 +534,7 @@
#include "code\controllers\subsystem\dcs.dm"
#include "code\controllers\subsystem\discord.dm"
#include "code\controllers\subsystem\disease.dm"
#include "code\controllers\subsystem\droning.dm"
#include "code\controllers\subsystem\early_assets.dm"
#include "code\controllers\subsystem\economy.dm"
#include "code\controllers\subsystem\eigenstate.dm"
Expand Down

0 comments on commit 7d9a36b

Please sign in to comment.