User Tools

Site Tools

Urban Games

modding:soundeffects

Sound Effects

The immersion of the game is not only supported by the graphics but also by an appealing sound design. It is therefore possible to specify a large number of sound effects in Transport Fever 2.

Sound Files

All sound files used by Transport Fever 2 are located in res/audio/effects/. They have several technical requirements:

  • The required file format is the Waveform audio file format with the file ending .wav.
  • The files have to be mono sounds. Stereo leads to unintended side effects regarding the sound orientation and distance calculation.
  • The bitrate should be 16 bit and the frequenzy should be 48000 hertz.

The sound files may either be referenced in soundsets or directly in the metadata of vehicles or constructions.

Sound Effect Mapping

The mapping of soundfiles to sound effect events is located in 3 different places:

  • res/config/sound_effects.lua for general sound effects
  • res/config/construction_sound/ for build tool related sound effects
  • in industry definitions for industry selection sound effects

General Sound Effects

The general sound effects are read from the res/config/sound_effects.lua. Per default, it requests the sound mapping from the soundeffectsutil.lua in the res/scripts/.

Each of the keys is a property with a list of file references relative to res/audio/effects/. When there is more than one reference in the list, one of the references is randomly chosen when the effect should be played.

Mouse Interaction

The keys for mouse interaction are:

  • buttonHover is played whenever the player hovers over a button.
  • buttonClick is played whenever the player clicks on a button.
  • startGame is played when the player clicks the START button.
  • tabClick is played whenever a tab is selected in a window or the bottom menu.
  • toggleOn is played when a toggle is switched on (e.g. the HUD icons).
  • toggleOff is played when a toggle is switched off (e.g. the HUD icons).
  • menuToggle is played when a image button in the main menu is selected (climates and vehicle sets).
  • componentActive is played when a slider or green toggle (e.g. the mod activation toggle) is used.
  • guidesystem is played when there is a new tip from the guide system (those yellow highlightings).

Selections

The keys for selections are:

  • selectTown is played whenever the player clicks on a town.
  • selectTrainDepot is played whenever the player clicks on a train depot.
  • selectRoadDepot is played whenever the player clicks on a road depot.
  • selectTramDepot is played whenever the player clicks on a tram depot.
  • selectAirDepot is played whenever the player clicks on a hangar.
  • selectWaterDepot is played whenever the player clicks on a shipyard.
  • selectAirport is played whenever the player clicks on an airport.
  • selectHarbor is played whenever the player clicks on a harbor.
  • selectTrainStation is played whenever the player clicks on a train station.
  • selectBusTramStation is played whenever the player clicks on a bus or tram station.
  • selectRoadStation is played whenever the player clicks on a truck station.
  • selectBuildingResidential is played whenever the player clicks on a residential building.
  • selectBuildingCommercial is played whenever the player clicks on a commercial building.
  • selectBuildingIndustrial is played whenever the player clicks on a industrial building.
  • selectPersonMale is played whenever the player clicks on a male person.
  • selectPersonFemale is played whenever the player clicks on a female person.

Bulldozing and Constructing

The keys for bulldozing and construction effects are:

  • bulldozeMedium is played if a small or medium sized object or construction is demolished.
  • bulldozeLarge is played if a large sized object or construction is demolished.
  • construct is played when a larger construction is built.
  • constructHalf is played when a smaller asset is built, e.g. with the brush asset.
  • constructNoMoney is played when a construction can't be constructed due to a lack of money.

Management

  • cashAccount is played whenever there is some income or cost that changes the bank account balance.
  • newLine is played when a new line is added.
  • addStation is played when a new station is added to a line.
  • addWaypoint is played when a new waypoint is added to a line.
  • buyVehicle is played when a vehicle is bought.
  • sellVehicle is played when a vehicle is sold.
  • setLine is played when a vehicle is sent on a line.
  • replaceVehicle is played when a vehicle is replaced.
  • sendToDepot is played when a vehicle is send back to the depot.
  • maintainVehicle is played when the maintenance level is set.
  • colorVehicle is played when a vehicle is recolored.
  • borrow is played when the loan is raised.
  • repay is played when money is payed back.

Game Progress

  • industryUpgrade is played when an industry changes to the next larger level.
  • industryDowngrade is played when an industry changes to the next larger level.
  • newVehicle is played when a new vehicle becomes available.
  • taskCompleted is played when a mission task is completed in campaign missions.
  • missionSuccess is played when a mission is completed successfully.
  • missionFailure is played when a mission has failed.
  • attention is played when there is something that needs the attention of the player.
  • importantNote is played when there is a new important note.
  • achievmentEarned is played when an achievement is earned.
  • medalEarned is played when a medal is earned in a mission.

Street Sound Effects

The street.lua file in the res/config/construction_sound/ folder contains the track construction related sound effect mappings:

  • dragStart is played when the player starts dragging a street (mouse down).
  • drag is played while the player drags the street.
  • dragBridge is played when a street is dragged as a bridge.
  • dragTunnel is played when a street is dragged as a tunnel.
  • dragEnd is played when the dragging is done (mouse release).
  • dragOffset is an offset between the playback of dragging sounds. If negative, they slightly overlap.
  • fixedSlopeOn is played when the player switches to the fixed level slope mode.
  • fixedSlopeOff is played when the player switches to the free slope mode.
  • slopeUp is played when the player clicks on the button for a steeper slope.
  • slopeDown is played when the player clicks on the button for a less steep slope.
  • build is played when the street section finally is built.
  • cancel is played when the street construction is aborted.

Track Sound Effects

The track.lua file in the res/config/construction_sound/ folder contains the track construction related sound effect mappings:

  • dragStart is played when the player starts dragging a track (mouse down).
  • drag is played while the player drags the track.
  • dragBridge is played when a track is dragged as a bridge.
  • dragTunnel is played when a track is dragged as a tunnel.
  • dragEnd is played when the dragging is done (mouse release).
  • dragOffset is an offset between the playback of dragging sounds. If negative, they slightly overlap.
  • fixedSlopeOn is played when the player switches to the fixed level slope mode.
  • fixedSlopeOff is played when the player switches to the free slope mode.
  • slopeUp is played when the player clicks on the button for a steeper slope.
  • slopeDown is played when the player clicks on the button for a less steep slope.
  • build is played when the track section finally is built.
  • cancel is played when the track construction is aborted.

Terrain Sound Effects

The terrain.lua file in the res/config/construction_sound/ folder contains the terrain tool related sound effect mappings:

  • lower is played while the terrain is lowered.
  • raise is played while the terrain is raised.
  • smooth is played while the terrain is smoothed.


modding/soundeffects.txt · Last modified: 2022/03/07 18:13 by yoshi