slpwnd wrote:LoL this thing is brilliant. Actually one of the ideas we had was that the different machines would have different sounds and they would be played based on the players position / distance towards the machine. However in the end we dropped the idea because we thought it would get monotonous soon.
I think the sound-design to make the game not sounding monotonous is not easy, but possible. And when done right it can sound quite realistic.
I'll try to explain this in detail and don't try to make too much own suggestions.

This article is not about the game music, it's only about the sound and how a really own sound can be generated, which sounds great and enable the players in hearing informations about the state
of their factory just by listen.
At first, there is the "sound area", a sound can be heard. The area is dependent from the map and the player, which stands on the map. The player hears the surrounding sounds. He doesn't hear the game music, but many other things happen here. There is for example wind, which is some kind
of background noise, which can always heard. Some other sound are from the pure surroundings, water, forest, sand... All make different sounds.
Then there are the things you can built,or stuff which isn't made by the creepers. Factories, inserters. Yes, also the belt makes a silent, but bearable noise, if you are standing directly aside.
Of course the more distant, the less I can hear and the more the sound is smeared.
This is very important to make the sounds realistic. In a wide and open area, sound can be heard very far. I think to the area you can see when zooming out nearly completely. The more stuff is built, the more noise is produced, and so, the "area
of a sound" shrinks, cause it will be lost in the background noise. This is also very CPU-friendly, because when you have much things on screen, only the nearest would make sound.
The second point is the distance.
Of course it is not like "here I hear it, and one step further the sound is gone". The sound blends out with the distance.
The third thing is the "room". This is a term in music engineering. It means, that every instrument, every noise, has it's own sound, plus the room-sound. You cannot record an instrument without room sound (you can, but its extremely hard and it sound absolutely unnatural, when you hear such a recording). For factorio this means, that a sound - dependent on his position relative to the player - is going into different sound-rooms. The simplest example is stereo: if a sound is on the left, the signal is routed to the left stereo channel and vice versa. This is a special case, cause stereo channels are normally not thought as rooms, but for this example it was good.
Till here, we have a soundscape like in Rollercoaster Tycoon. I recommend a look into it, cause the sound is for such a game really great.
But lets go further. In reality distant sounds become not only more silent, but more and more reverb is added, because the sound is reflected more times. And very loud (=near) sounds blend the others out. This means, that far sound are more and more mixed into a reverb-room and blended out from the normal room. For distant sounds, the heights are cutted. High frequencies are more and more filtered out (this is the general rule, in the mountains it is different, but we have here no mountains til now).
Very near or loud sounds will kill every other sound. This is done in a compression room. When you hear techno, the basedrum often mutes all other sounds, especially pads, strings or so. This is done with compression. The basedrum signal is routed to a compressor and mutes the normal- and reverb-rooms.
Let's abstract: the sound design in this game is a complicated process.
1 Find all sounds that currently should be played. This depends on
1.1 priority. For example the bongos
of the creepers before they start their rush is important. The swooshing
of the trees and hissing
of the wind is also very important, because when you suddenly remove it, it will sound strange (can be done, before the night comes, is a very psychoacoustic effect). The sound
of the steam engine is more important than those
of a bird in the forest or some machines, because it gives the player an important information about the state
of electricity. But in the morning, the birds become important, so they are played.
1.2 distance. As explained at some point it is senseless to play a sound because it gets too silent and gets lost in the background noise.
2. Mixing
This is just taking every sound and calculate the level for each stereo channel. There are some formulas, which can calculate this more or less correctly. (It's not just level = 1/distance!)
3. Rooming
By distance and resulting level sounds are mixed into different rooms. For example
- normal-room. That's just the normal signal.
- reverb-room. The more distant sound becomes more and more reverb and the high frequencies are filtered.
- near/loud-room very near or very loud sounds come into this rooms and will damp the other rooms (compression)
This is very rudimentary. For example, it makes sense to trigger also a very near sound into the reverb or echo-room, when it is very loud. Think
of thunderstorm or a blast.
4. Mixing the rooms.
The rooms are mixed together; eventually if you are in survival or good mode the mix changes. The result is the in-game sound.
Some more stuff about sample design in factorio
A sample is piece
of sound which is played, when some event happens.
When you hear a machine, you have very much different sounds. For example lets take a car. It doesn't make just brbrbrbrbrbrbrbr, it makes more brbrbttbrbttbrbrbbrbr. The sound is not monotonous, there are different parts. One makes br, the other btt, the third bbr. And they are mixed together by random. Other example. If you take a sample
of a snare-drum and play it over and over it will sound like a machine-gun. To make a realistic sounding snare, you need many snare samples and play it in some more or less random order. There are some more tricks like this but in general the altering
of sounds is very important because in reality every explosion sounds different and the ear is very good in hearing little differences.
For factorio this means, that for example the copper wire production - which is very fast - just cannot use the same sample over and over. You need altered sounds, because otherwise it won't sound as machine, it sounds like a machine gun.
Think
of different situations, when power is low it sounds different than, with high power. Or when coal runs out.
This means to the process described above, that we have a step 1.3 that's responsible for choosing the right samples,because dependent on the state
of the machine, the produced item, the surrounding (water, terrain, forest) there could be different sounds.
And that for all types
of machines, creepers, their houses, etc. in different states. Could become a nightmare soon, so a high level
of planning and organization is needed.
What can be done yet is making one example engine and try to program the whole process
of sound generation through, one, because the complicated stuff is creating the samples. How many are needed, how does it sound in the mix...
As mentioned above I tried not to be too selfish, but cannot inhibit own ideas. So I will repeat my own ideas here so you can distinct them. I think for some background noises, depending on ground material. Over this, the normal sounds from the direct surrounding are pulled and over that distant, but loud sounds. I think that you might hear the time
of day just by hearing the surrounding sound. It's also possible to hear very distant explosions or some conga war songs from the creepers. When standing besides am machine, it's so loud, that other sounds are turned down, this expands the dynamic.
Edit: cole to coal and hole to whole. No purpose, bad habit.