Hello Engineers!
Welcome to one of many more to come: Dev Blogs for Train Life! In this short read we will talk about how we create sound for our game! We feel that sound is not talked about enough, and it plays a crucial part in Train Life - in any video game, for that matter.
With that in mind, let's get into it!
Placing Sound FX
Placing sound effects in a game seems like an easy task. The Sound Designer puts them as fixed-point sound sources on the levels and sound effects play when triggered (either once or until they are stopped). But it is a challenge when we have to face a huge map like Train Life has.
One of the first problems we encountered was the density of sound sources. In places where we wanted players to hear the constant sound (like forest ambiance), it was hard to decide how far the sources should be from each other, both in audial and optimization cases.
Luckily, we came up with a tool to place sounds in special areas that can be modified by desginers.
Developing Tools
Once a player enters the area, the sound source glues itself to the player and follows them. After leaving the area, the source still follows the player but is limited to the area's border. This allowed us to easily create ambient sounds in huge spaces (like forests, cities, or plains), as well as in smaller places (like industries).
We developed a variation of this tool for randomized sounds that play once per time, like birds or sirens.
The method of placing this tool is the same as for the previous one, but it works differently. It randomizes a location of where the sound should be played (whether on the border of the area or inside it) and designers can specify min-max values of how often the sounds should be spawned.
But that's not all. You must have noticed that when you enter tunnels or bridges, sound changes a bit. We add reverb specific to those places or, in the case of tunnels, we mute some of the sounds.
When implementing those effects, the sound designer's first thought might be placing collision boxes, triggering the effects on entering and removing on exiting. However, the change would be immediate, and we didn't want it in Train Life.
That's why we created a special kind of collision box that changes the strength of the effect based on where you are in the collision box. Thanks to that, the effect is not independent of the trains' velocity.
Usage In-Game
Although those tools speed up the process significantly, it still takes a lot of time to place them. They make it easier to see what type of sound is where and what sound line or zone needs to be adjusted if a level changed, but an empty level, especially a detailed one, needs days to be considered completed. Nevertheless, they allow us to quickly create soundscapes in big areas, giving a solid background for places that need more detail.
A big shoutout to our sound designer Greg in writing this blog! We hope you all enjoyed this informational blog post and make sure to follow Train Life on Twitter and join the official Discord channel to stay up to date with the latest and greatest news from our teams.
Until next time!
Mike
Train Life Community Manager