Re: [Freeciv-Dev] sound architecture
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 15 Feb 1999, Per Mathisen wrote:
> After a fair bit of coding and thinking, I am becoming rather certain
> that client-side only sound architecture is not going to work very well.
>
> The first problem is that the client does not always know when events take
> place, it is too dumb. It receives instructions to do things, but not
> what prior action that caused this to happen.
>
> The second problem is that adding sound in the client will hard-wire a
> certain implementation (mapping certain units, buildings to specific
> sounds), which is exactly the kind of thing what we are moving away from
> with rulesets.
>
> My idea, currently, is to make a new packet, a "sound packet", which
> is simply the number of a sound to play, and then the server can decide
> when a sound should be played. This will, of course, lead to some
> additional increase in the number of packets going over the network, but
> this could be controlled by a server-option (sound packets on/off).
I had the same thoughts myself. However i'm lacking time to help you on
that. Sound packets are definitively the way to go.
The idea is that you would have a sound.h in common/ with something like:
enum{
SND_ARMOR,
SND_ARTILLERY,
SND_ALERT,
.
.
.
}SOUND_TYPE;
And you would use these in your packets.
The server would use a packet for each sound event.
In the client you would have an array or single-linked list with:
SOUND_STRUCT sounds []={
{ "armor.wav", SND_ARMOR },
{ "artillery.wav", SND_ARTILLERY },
.
.
.
};
And then you would have lookup functions for them. Ideally the sounds
could be specified in the client configuration file.
I suggest you look at the number and name of the sound files of Civ2 to
help you on what sounds are required.
> To make sounds "ruleset-able", a new column can be added to improvements
> and units rulesets that refer to a sound. The sound "4" could, for
> instace, refer to an "elephant sound". (Sounds silly, doesn't it?)
Nope, it does not sound silly, just use enums intead :-)
---
Vasco Alexandre da Silva Costa, student @ Instituto Superior Tecnico,
Technical University of Lisbon - Software & Computer Engineering
|
|