[crossfire] sound2 protocol and issues: sound_chance

Nicolas Weeger nicolas.weeger at laposte.net
Wed Sep 29 11:26:05 CDT 2010


>   Looking at the code, it also seems suspect for all the hard coded sound
> values (most all sounds), in that they are looking at an object that does
> not have any sound information defined - it is looking at skill values,
> monsters, etc, as for the chance of the sound being generated.
> 
>   In the ideal world, all those hard coded sound values go away - all sound
> information comes from objects, so only objects that have sounds defined
> generate noise, and in those cases, if the object does not have the sound
> information defined, that would be a bug in the object.
> 
>   However, the current code does not really seem to support sounds coming
> from the objects - there is no 'sound_type' or 'sound_name' field in the
> object.


The idea was to have sound for many actions, so instead of having fields, the 
server would just send the action - "cast", "move", and such.
That name is indeed hard-coded.

The sound is then completed by the item's name, from which derives the final 
sound.
Server sends action and item's name.


So you'd have:
- action "move" on a monster "goblin", client could find the "move_goblin" 
sound ; if not found, find the global "move" sound
- to disable sound for an item, set the "sound_chance" (that one is a field) to 
0

I choose to send the action's name, because a string is the easiest to extend 
- pretend it's a filename, add new files, here you do, you can have any sound.




>   As far of better sound support, I think sound information needs to be an
> object attribute, but that would likely require a different sound playing
> mechanism (I'd favor a string approach, or if integers are going to get
> used, they should probably get moved to shared/newclient.h)

That was the idea I had, but maybe the implementation lacks things :)



Nicolas
-- 
Mon p'tit coin du web - http://nicolas.weeger.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
Url : http://mailman.metalforge.org/pipermail/crossfire/attachments/20100929/cbcab1ee/attachment.pgp 


More information about the crossfire mailing list