Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sounds (various ideas - long)



I think it's better to put all replies to the messages about sounds in a
single thread, so here we go...

----------
> From: Tero Haatanen <Tero.Haatanen@tel.vtt.fi>
> Date: Mon, 11 Dec 1995 13:15:56 +0200 (EET)
> 
> I think that sounds don't need any special archetypes, but just build-in
> support in objects like faces are now.  [...]

This would be a problem for ambient sounds, because you need to know at
least two things:
- the type of sound that should be played: "wind", "water dripping", "owls"...
- how often the sound should be played (ambient sounds are repeated at
  random, but some of the should be played more often)
These parameters have to be stored somewhere on the map.  Thats why I suggest
adding some (invisible) objects to the map, that are only playing sounds.

----------
> Date: Mon, 11 Dec 1995 11:11:22 -0500 (EST)
> From: Tadah <link@alpha.pulsar.net>
> 
> Yes, I have played Hexen.  Its a pretty cool game and I love the idea of 
> atmosphere type sounds.  What would be nice though is to also have some 
> music perhaps?  .MIDs are great but I have never seen a midi player for 
> unix, so I don't know.  [...]

The easiest way to have background music would be to play a (long) .au
file at a low level and mix it with other sound effects, because MIDI is
not available on all systems.  But the music files would of course take
a few Mb...

----------
> From: "tuan (t.) doan" <tdoan@bnr.ca>
> Date:  Mon, 11 Dec 1995 19:45:00 -0600 
> 
> I would like to added to the format the number of times (or looping).  For
> example,
> 
> magic missiles = 3, Whoosh.au, 50
> 
> or better yet, able to specified as many sounds to a particular action
> 
> comet = Whoosh.au, 70; Boom.au, 100

Good idea.  I prefer the second version: if you want to play the same
sound several times, you could of course include the same .au file more
than once.  I don't think you will ever want to play more than four or
five times the same sound (unless it's background music, but it should
be handled separately), so it shouldn't be a problem.

> >Another improvement would be to use "environmental" sounds; that would add
> >a lot to the atmosphere.  Those who have played games like Hexen know what I
> 
> This would be great; but make sure that the volume is low (or at least
> settable by the user)

The sounds should be handled on the client side, so the user will be able
to change the volume.

> It's great to see that proposals for "better" crossfire comes in many 
> directions.

Yes, but these proposals will only become interesting once someone starts
implementing them.  <grin>

----------
> Date: Wed, 13 Dec 95 10:29:46 GMT
> From: mwedel@pyramid.com (Mark Wedel)
> 
> Sound Improvement:
> 
>  Raphael mentioned that he would like to improve sound code, but wait for
> client/server to do it.  A few thoughts:
> 
>  IT seems to me that rewriting the sounds config file isn't really dependant
> on client server.  [...]

I could of course re-write the part of the code that reads the config file
without waiting for the client/server split.  But I also want to be able to
play these sounds, and this is where the problems begin...  It would be nice
if each user could choose to enable or disable some sounds, for example.
Thus each player would need his/her own config file.  Adding such features to
the current code would be a nightmare.

>  I guess Raphael's thought is more that the server will send truly symbolic
> commands to the client (ie, "play hit door" sound, vs "play bash.au" sound

Right.  Although I am starting to change my mind...  In some cases, the
people who run a server may want to add a special sound effect and the best
way to do this would be to send the sound file directly.  Hmmm...

----------
> From: Tero Haatanen <Tero.Haatanen@tel.vtt.fi>
> Date: Wed, 13 Dec 1995 17:04:11 +0200 (EET)
> 
> I think that server should offer all sounds and refer them as symbolic
> names (or numbers), but how much protocol support is needed to play them?
> Some that comes to mind are sound, volume, how many times sound is played, 
> and is this a background music?  Maybe Raphael can offer some thoughts 
> about this?

OK, I'm thinking...

The parameters which should be sent by the server are:
- Sound type (i.e. "hit door", "arrow", "large lightning", ...)
- Attenuation.  This tells how much the maximum volume of the sound (set by
  the client) should be reduced because of the distance between the source
  of the sound and the player.
- Priority.  Some machines will only be able to mix a limited number of
  sounds, so there should be a way to specify which ones are the most
  important.  For example, the sound of the player being hit should have a
  high priority, even if it doesn't have a high volume.

The client does the mapping between sound types and file names, sets the
volume, etc.  As I explained previously (and with the suggestion from Tuan),
the format of the file should look like this:

hit door      = tap2.au, 50                # Silly comments are allowed too
hit player    = clunk.au, 30; ouch.au, 50  # Comments start with "#"
player hurt   = ouch.au, 100
magic missile = Whoosh.au, 50
comet         = Whoosh.au, 70; Boom.au, 100

There is one entry for each spell (using the spell name) and several entries
for other events.  Each sound is played only once, but it is possible to
repeat a sound effect by inserting the same file name several times on the
line.

Among the "other events" should be the ambient sounds, such as the sound of
the leaves of a tree in the wind, or water dripping.  I will have to find
new names for these, such as:

ambient water drip  = drip.au, 10
ambient waterfall   = waterfall.au, 20
ambient leaves      =                   # Empty entries are allowed too
ambient wind        = wind.au, 10
ambient storm       = wind.au, 20; lightning.au, 50; wind.au, 20; wind.au, 10
ambient silly example = chill.au, 100

If we want to have lots of sounds in the game, we should also have sounds
for the monsters:

troll idle    = growl.au, 20
troll attack  = clunk.au, 100
troll die     = crumble.au, 80
dragon idle   = growl.au, 40
dragon attack =      # The firestorm spell will already make some noise
dragon die    = sally.au, 100

This should only be done for high-level monsters.  I don't want to imagine
what could happen when you enter a room with 100 kobolds and 50 goblins and
they all start making noises...

There are still a few problems: I'm sure that people would like to be able
to play specific sounds on the client machine, for an event that is unique
to some map or server.  I don't know how to handle this.  This is the
biggest problem in this proposal.

Also, more and more machines support stereo sound.  Would this be interesting
for Crossfire?  Should "left" and "right" be associated with "west" and "east"
on the map, or should they change according to the direction the player is
facing?

There should be a way to have background music too, although I don't think
this is so important.  One way to do it would be to have more entries in
the config file (for example, "music 1", "music 2" and so on).  All sound
types beginning with "music" would be played in a loop instead of being
played only once.  And only one of them can be played at a time.  But using
simple numbers for background music would not help people to set the right
atmosphere for their map.

-Raphael