Add API for mods to change volume/radius of sound effects

Post your ideas and suggestions how to improve the game.
Post Reply
Clean0nion
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Sep 06, 2017 2:53 pm
Contact:

Add API for mods to change volume/radius of sound effects

Post by Clean0nion » Wed Sep 06, 2017 3:03 pm

TL;DR
Add API for mods to change the volume and radius of sound effects.

What?
The volume of sound effects can currently be changed manually by the user by replacing game files with louder versions of those game files. Mods can also replace sound files.
What mods cannot do is adjust the volume of those sounds in-game, or adjust the radius from which they can be heard.
Why?
Sounds can be heard from different distances - for example, inserters can be heard from a few tiles away, whereas belts can only be heard if you're very close to them - after all, you wouldn't want your eardrums pierced every time you crossed your main bus.

However, I'm not happy with the distribution of sound volumes and sound radii in-game. Take trains for example. When riding a train, I struggle to hear the thrum of the engine, and yet the clack-clack of traversing the track is very loud. I would like to increase the volume of the train engine, and also increase the radius from which the train can be heard - I want to be able to hear these massive engines even when they're off screen!

Currently, mods offer no way to do this, hence my suggestion.

Rseding91
Factorio Staff
Factorio Staff
Posts: 8846
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Add API for mods to change volume/radius of sound effects

Post by Rseding91 » Wed Sep 06, 2017 4:54 pm

All of that is defined through the prototypes for a given sound :)

The fast transport belt for example has this defined:

Code: Select all

    working_sound =
    {
      sound =
      {
        filename = "__base__/sound/fast-transport-belt.ogg",
        volume = 0.4
      },
      max_sounds_per_type = 3
    },
Additionally the working_sound property supports the following settings:
  • float: apparent_volume
  • uint8: max_sounds_per_type
  • bool: match_progress_to_activity
  • bool: match_volume_to_activity
  • bool: match_speed_to_activity
  • double: audible_distance_modifier
If you want to get ahold of me I'm almost always on Discord.

User avatar
Bilka
Factorio Staff
Factorio Staff
Posts: 1564
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Add API for mods to change volume/radius of sound effects

Post by Bilka » Wed Sep 06, 2017 6:14 pm

Rseding91 wrote: Additionally the working_sound property supports the following settings:
  • float: apparent_volume
  • uint8: max_sounds_per_type
  • bool: match_progress_to_activity
  • bool: match_volume_to_activity
  • bool: match_speed_to_activity
  • double: audible_distance_modifier
What about probability and idle_sound? And are those properties only possible for the working_sound, or also for other sounds, such as vehicle_impact_sound?

To me it seems like there is a "generic" sound that can be defined, like his:

Code: Select all

vehicle_impact_sound =  { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
--or
sound = { filename = "__base__/sound/substation.ogg" },
--or
sound =
{
 filename = "__base__/sound/accumulator-working.ogg",
  volume = 1
},
idle_sound = {
  filename = "__base__/sound/accumulator-idle.ogg",
  volume = 0.4
},
Working_sound uses that "generic" sound, and other properties can only be defined there, right? Or can I use filename directly inside working_sound?

And what volume does this use?

Code: Select all

   
 working_sound =
    {
      sound =
      {
        filename = "__base__/sound/electric-furnace.ogg",
        volume = 0.7
      },
      apparent_volume = 1.5
    },
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Ideas and Suggestions”

Who is online

Users browsing this forum: MisterDoctor and 5 guests