Map Sounds Tutorial

Read tips and guides about teeworlds-related subjects (mapping, compiling, ..).
User avatar
timakro
Posts: 414
Joined: Mon May 05, 2014 6:05 pm
Location: Germany
Player profile: http://ddnet.tw/players/timakro/
Mapper profile: http://ddnet.tw/mappers/timakro/
Clan: unique

Map Sounds Tutorial

Post by timakro »

Map Sounds Tutorial
written by DoNe, slightly edited by Index

As of client version 2.x you can use sounds in maps. The feature was coded by BeaR. His idea was to make little environmental sounds like singing birds or wind possible for maps. You can only hear the sounds if you use DDNet client. You can change the volume of map sounds for your client and even turn them off. Because only players using the DDNet client can hear the sounds you shouldn't use them to give information the players have to know. Map sounds are included to a map in the Opus(.opus) filetype.

How to convert my own sound to Opus?

The most music editing programs support the filetype Wav. Use this programm to convert Wav to Opus: http://www.foveon.de/sonstiges/opusdrop/index.htm. You can also use this online converter which supports almost every format for your input sound: http://audio.online-convert.com/convert-to-opus. Your output file should end with ".opus". Now put this file into your mapres directory.

Read a detailed explanation about opus: http://forum.ddnet.tw/viewtopic.php?p=26734#p26734

How to include my sound to a map?

In editor sounds are handled similar to quads. Klick on the button that switches between images, sounds and layer management until you get to the sounds section. You should see your sound file in the file browser. Add it like you would add a image and don't forget to embedd it. Switch back to layer management and rightclick on any group. Click on "Add sound layer". Rightclick on your new layer and select your sound file as you would do it with a quad layer. After that the "Add Source" button at the top right will be clickable. Click on it and a new sound source will appear. You can move it like a quad by clicking on the green dot. Rightclick on the green dot to modify your sound source. You can decide if the sound will loop or just play when you enter the sound circle. You can change the delay that is waited when you enter the sound circle until the sound is played. The sound will get louder if you get closer to the middle of the sound circle. You can change the radius of the sound circle by changing the distance. A sound source can also have a position envelope. It will work like on quads and just move the sound center around. You can also add a sound envelope if you created one.

How to use sound envelopes?

Sound envelopes control the volume of a sound. They are very similar to the other envelope types. In the envelopes menu you can click "Sound+" to add a sound envelope. The x-axis controls the time and the y-axis the volume of your sound.
Last edited by timakro on Sat Nov 08, 2014 7:18 pm, edited 4 times in total.
User avatar
deen
TECHNICAL Team
Posts: 3575
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: Map Sounds Tutorial by DoNe

Post by deen »

We're switching away from wavpack to opus for map sounds. Have a look at a nice comparison of Opus with some other codecs. Here's how to convert your sound files to opus for using them in DDNet maps:
  • Choose VBR encoding and opus filetype
  • Try out the lowest bitrate
  • Increase the bitrate until it sounds good enough
You can use these tools to do this:
Graphical
  • Use an Online converter
  • Use an all-in-one tool like WinFF, make sure to choose opus as the output codec.
  • First convert the sound to .wav, then use OpusDropMP to convert to opus
Command line
  • Code: Select all

    ffmpeg -i input.wav -b:a 6k output.opus
  • First convert the sound to .wav, then use the commandline tool opusenc like this:

    Code: Select all

    opusenc --bitrate 6 input.wav output.opus
User avatar
Aoe
Posts: 739
Joined: Thu May 29, 2014 10:54 pm
Location: Denmark
Player profile: http://ddnet.tw/players/Aoe/
Mapper profile: http://ddnet.tw/mappers/Aoe/
Clan: Infamous
YouTube: user/ElKlammoElTorso

Re: Map Sounds Tutorial by DoNe

Post by Aoe »

Wow nice, is there any map with this feature yet?
User avatar
imp
Posts: 788
Joined: Mon May 05, 2014 5:56 pm
Player profile: http://ddnet.tw/players/imp/
Mapper profile: http://ddnet.tw/mappers/imp/

Re: Map Sounds Tutorial by DoNe

Post by imp »

lol, I didn't even realise that this feature had been released :D
User avatar
Kintaro*
Posts: 43
Joined: Tue Oct 28, 2014 8:45 pm
Player profile: http://ddnet.tw/players/Kintaro*/
Mapper profile: http://ddnet.tw/mappers/Kintaro/
YouTube: user/mrtiee

Re: Map Sounds Tutorial by DoNe

Post by Kintaro* »

Aoe wrote:Wow nice, is there any map with this feature yet?
Aoe i alreay created a map,
idk if its already on test server or if it will be realeased on ddnet anyway^^
User avatar
Aoe
Posts: 739
Joined: Thu May 29, 2014 10:54 pm
Location: Denmark
Player profile: http://ddnet.tw/players/Aoe/
Mapper profile: http://ddnet.tw/mappers/Aoe/
Clan: Infamous
YouTube: user/ElKlammoElTorso

Re: Map Sounds Tutorial by DoNe

Post by Aoe »

Kintaro* wrote:
Aoe wrote:Wow nice, is there any map with this feature yet?
Aoe i alreay created a map,
idk if its already on test server or if it will be realeased on ddnet anyway^^

https://www.youtube.com/watch?v=kIfOjkB17BA
User avatar
Bossk
Posts: 43
Joined: Thu May 08, 2014 2:54 pm
Player profile: http://ddnet.tw/players/Bossk/
Mapper profile: http://ddnet.tw/mappers/Bossk/

Re: Map Sounds Tutorial by DoNe

Post by Bossk »

I have music in my winning room, but I'm wondering why just looping works.

-loop off
pan off/on nothing happens when entering soundzone

-loop on
pan off/on sound is looping when entering sound zone

I ask me what "pan" is for and why I can't configure that the sound starts playing and stopps afterwards if u enter a zone.
User avatar
Alvin Risk
Posts: 440
Joined: Sat Oct 04, 2014 6:27 am
Player profile: http://ddnet.tw/players/Alvin-32-Risk
Mapper profile: http://ddnet.tw/mappers/Alvin-32-Risk
Website: https://vk.com/ms_zn
YouTube: user/z2mex

Re: Map Sounds Tutorial by DoNe

Post by Alvin Risk »

Pan its panorama.
Ya ebu tvou mamashu.
BeaR
Posts: 54
Joined: Fri May 30, 2014 10:18 am
Player profile: http://ddnet.tw/players/BeaR/

Re: Map Sounds Tutorial by DoNe

Post by BeaR »

Panning: The audio signal will be split into two stereo channels and the volume will be adjusted for each channel according to your position in the audio field.
So e.g if you stand on the left side of the audio source, the right channel will have an higher volume than the left one and vice versa

About your second question: There is no support some sort of event triggering for OnEnter/OnLeave (same for animations)
User avatar
Bossk
Posts: 43
Joined: Thu May 08, 2014 2:54 pm
Player profile: http://ddnet.tw/players/Bossk/
Mapper profile: http://ddnet.tw/mappers/Bossk/

Re: Map Sounds Tutorial by DoNe

Post by Bossk »

Thx for your answer BeaR!

Maybe i missunderstood this
You can decide if the sound will loop or just play when you enter the sound circle.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests