[CF-Devel] Sounds, continued

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Wed Apr 28 15:36:10 CDT 2004


Been thinking again about sounds, here's what I'm gonna do.

Put .snd files with archetypes, format:
     sound goblin_death
     file goblin_death_1      <- .raw omitted voluntarily
     volume 'normal' volume
     text a goblin die        <- client could display 'you hear <text>'
     <more info if/when needed>
     endsound

.raw files will just stay where they are (in the future maybe client 
could request a sound, but let's first make the big part, improve 
sound support :)).

Those .snd will get collected by collect.pl, and make a sounds_arch file.
This file get parsed by server at startup, assigning a unique 
identifier to each unique name (thus ignoring duplicate names) and 
trashing the rest.

Add sound lines to archetypes:
     Object goblin
     ....
     sound death goblin_death <optional info if/when needed>
     ....

Server at loading links the sound with event ('death', 'apply', ...) 
and makes sure sound actually is defined.
Of course, 'sound' could get 'overriden' in artifacts, like other fields.
Maybe simply be an array of values, mapping event => sound number.

Now this sounds_arch file is parsed by client too, merging info from 
the sounds with same name.

When server sends a sound, giving identifier and volume, client finds 
the group of sounds with that name, and uses one randomly. Each sound 
has its 'nominal' volume, to adjust it correctly.


The choice of putting all info (client and server) into .snd is to 
have only one sounds_arch file shared between client & server.

Also, it wouldn't be hard to have a 'sounds_maps' file, with info from 
special sounds in maps (text to congratulate a player on defeating a 
big bad boss?), and parse it too at client/server startup.

The only link between client & server is the 'sound name'. Server has 
no idea of different sounds for one event.

This could also be used for 'server' events like 'player 
login/logout', and why not background music (special event 'sound 
background'?)


I'm starting to implement that, but of course if you have better ideas 
just fork'em :)

Nicolas 'Ryo'

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list