Page 1 of 1

A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 04:58
by lethediver
I think there is a lot of interest in this for crawl and a lot of potential to make the game a more immersive and fun experience. Playing certain mp3s on entering certain parts of the game, being able to associate .wavs with certain in game actions, i would be all over that. I'm sure the community could whip up an open sourced sound pack for the game, if the support structure for sound integration was there.

An option for this in webtiles would be even more awesome, and it looks like on Korean servers this already exists. I suspect at least one member of the dev team may already be working on this, but I just wanted a place for players to voice their support for it. In fact, I would totally be down to put some actual money on it if someone wants to make a kickstarter.

Does Anyone Else share my enthusiasm for sound in crawl? How can we make it happen?

Re: A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 05:38
by duvessa

Re: A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 05:42
by ion_frigate
Can't say I'm all that eager, but in particular two things to keep in mind:

1) This needs to be an option, and it needs to default to off. Few things are more annoying than unexpected audio. I keep my computer muted most of the time because so many news sites have adopted the plague of autoplaying videos with sound.

2) Be very careful of using stock (i.e. open-source) sounds. They're kind of like the Wilhelm screams of video games: so easily recognized that they break immersion instead of adding to it. Don't forget that many TV sound editors use them as well (I've definitely recognized sounds from Buffy in Morrowind, for example), and that many of these sounds have been around for decades, with many predating the digital age.

And one thing that would make me actually want an option for sound: Make it so that the game just plays sound files directly from the drive, as opposed to compiling them into a single file. That way, players could easily swap in files they like. I have no idea how easy this is from a technical standpoint, but being able to put in music from my own library would be a great plus. Also, if possible, it should support midis (a lot of the best video game music will be in that form).

Re: A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 05:49
by lethediver
ion_frigate wrote:Can't say I'm all that eager, but in particular two things to keep in mind:

1) This needs to be an option, and it needs to default to off. Few things are more annoying than unexpected audio. I keep my computer muted most of the time because so many news sites have adopted the plague of autoplaying videos with sound.

2) Be very careful of using stock (i.e. open-source) sounds. They're kind of like the Wilhelm screams of video games: so easily recognized that they break immersion instead of adding to it. Don't forget that many TV sound editors use them as well (I've definitely recognized sounds from Buffy in Morrowind, for example), and that many of these sounds have been around for decades, with many predating the digital age.

And one thing that would make me actually want an option for sound: Make it so that the game just plays sound files directly from the drive, as opposed to compiling them into a single file. That way, players could easily swap in files they like. I have no idea how easy this is from a technical standpoint, but being able to put in music from my own library would be a great plus. Also, if possible, it should support midis (a lot of the best video game music will be in that form).


Agreed with all that, especially #3. One of my favorite games growing up was a 2d MMO, and it had many of its game data files just lying around in directories unarchived. You could swap in your own music and even icons/images and the game would use your custom files. Not sure if this is do-able for webtiles but it would be superb.

Re: A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 06:02
by duvessa
if you use anything other than MO3 for music i will be mad

Re: A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 11:24
by Implojin
If you compile with SOUND=y, Crawl nominally has sound support already. (For offline tiles builds, it explicitly initialises OGG and MP3 support through SDL_mixer, but it can also trivially load FLAC and MOD files.) There's an Lua function in the crawl lib to play a given sound file, crawl.playsound(filename), that you can pass ingame through Lua to play sound files (this of course also enables playing them at appropriate trigger moments through Lua scripting).

Looking at the code, sound support might not work out of the box for all build configurations: It should work fine for offline tiles, but to get sound working for console builds you may need to uncomment a system-specific line in AppHdr.h.


edit: As far as I can tell, nothing in the game currently calls crawl.playsound() by default, but if your game was compiled with SOUND=y, there is an rcfile option sound += pattern:filepath that you can use to play sounds when any given combat log message appears, with a pattern regex match similar to the force_more_message option.
https://github.com/crawl/crawl/blob/master/crawl-ref/docs/options_guide.txt#L394

Scripting sounds to play independently of combat log messages, without editing the game's C++ code, would require hooking into Crawl's Lua somewhere and conditionally calling crawl.playsound(). Replacing your ready() function in your rcfile, to possibly play a sound at the beginning of each new turn similarly to how qw.rc uses ready(), would probably be the easiest way to accomplish this.

Re: A serious discussion about sound support

PostPosted: Friday, 14th October 2016, 15:28
by dowan
lethediver wrote:Agreed with all that, especially #3. One of my favorite games growing up was a 2d MMO, and it had many of its game data files just lying around in directories unarchived. You could swap in your own music and even icons/images and the game would use your custom files. Not sure if this is do-able for webtiles but it would be superb.


Heh, are you talking about meridian 59? That game's still going on various servers you know.