[crossfire] Background music

Mark Wedel mwedel at sonic.net
Sun Apr 22 13:47:45 CDT 2007


Andrew Fuchs wrote:

> 
> How is the client going to get the music?  Is it going to be included,
> or will it download it from the server?  I would prefer that the
> "default" sounds get included, and that custom ones can be downloaded by
> the client.  Though in the case of downloading sounds, we need a way to
> make sure that the client won't mix up two different servers custom
> music (like two files having the same name).  A hash could possibly
> solve this problem.

  Currently, all sounds are managed by the client - the server has no idea what 
sound files are, etc, and can't supply them.

  That keeps things simple and tends to work, since sound isn't a required part 
of the game.

  If servers do start using custom sound files, it'd probably work just fine for 
them to make those available on an ftp server someplace and tell the players to 
download them if they want.

  What I'd suggest for a directory layout, on the client side, is something like 
this:

sounds/music/general/*.wav - sounds files explicitly mentioned by name
sounds/music/<style>/*.wav - when background music is some 'style', it pulls one 
of these files up random.  Symlinks could be used to have a single file show up 
in multiple directories, unfortunately SVN doesn't deal with symlinks so that 
gets messier.

sounds/effects/general/*.wav
sounds/effects/<name>/*.wav - these are like above, but for effect sounds 
(fireballs, trap doors, etc).  Like above, we add support for having multiple 
sounds be used for one effect - client chooses one randomly.

  It may be desirable to have multiple effects directories (sounds/monsters, 
sounds/attacks, sounds/scenery) just to prevent things from getting too 
cluttered.  Or maybe have these sounds/effects/attacks/<name>/*.wav, but that 
seems to be getting pretty long

sounds/<servername>/{music|effects} - sounds specific to a server, so server can 
provide packages for this.  Client would look here first for sounds of the 
matching type, and if it doesn't find them, fall back to the general cases 
above.  The directory structure in here matches the above.  In this way, server 
admins could just provide something that puts in this directory - it avoids 
conflicts, etc.

  While I used *.wav in my examples, I don't mean to say that should/must be the 
format - I just wanted to use something to make the examples a little more readable.

> 
>> IMO we could just get some musics from other free software projets :)
> 
> This can get annoying, since things can get to a state where almost
> every gpled game has the exact same music.  Another place to find music
> would be to get public domain scores, and convert them to midi, then put
> them through a decent interpreter (in terms of sound), though I think a
> few projects might do this already.

  While borrowing from other sources lacks originality, it may not be quite so 
bad - a lot of people probably only play a few linux based games, so would not 
otherwise recognize the sounds (they'd seem unique).




More information about the crossfire mailing list