.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   EMIT_SOUND and sound levels >1 ? (http://forums.bots-united.com/showthread.php?t=667)

Pierre-Marie Baty 09-02-2004 02:31

EMIT_SOUND and sound levels >1 ?
 
Hi,

I was trying to make a little improvment to my bleeding plugin so that the plugin plays a "body splat" sound when one gets his head burst away, but I can't seem to be able to play sounds louder than their default sound level. WTF ? I thought the engine had an integrated DSP ? I can only range the volume from 0 to VOL_NORM which is 1, and it's not sufficient since I want to use game sounds but just make them louder. Either using pfnEmitSound or pfnEmitAmbientSound it does not work. I must be doing something wrong but what ?

botmeister 09-02-2004 08:42

Re: EMIT_SOUND and sound levels >1 ?
 
I always use "1" which has been good enough for me, so I don't have a specific solution for you. I did however notice this odd comment in the SDK

Code:

void pfnEmitSound (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
It looks like the volume used to be specified as an int instead of a float.

Try specifying the volume in increments that are whole numbers?

Pierre-Marie Baty 09-02-2004 12:15

Re: EMIT_SOUND and sound levels >1 ?
 
yes I noticed that too, that would explain why when I raise the volume above 1, I get error messageboxes "EMIT_SOUND: volume: 4096" or numbers like that.

Anyway, I keep searching...

stefanhendriks 18-02-2004 09:58

Re: EMIT_SOUND and sound levels >1 ?
 
This may sound stupid, but i know in HL itself you can set the actual volume on the console:

volume 0 is silent
volume 1 is loud
volume 0.8 is default

now, perhaps you can pass that through the EmitSound function, you simply specify a float there, like 0.5 and you know it is 'half as loud'?

Pierre-Marie Baty 18-02-2004 11:59

Re: EMIT_SOUND and sound levels >1 ?
 
This works, Stefan... I'm just disappointed that there seems to be no way of passing EmitSoud volume levels that are GREATER to 1.

I'd have loved to hear a loud "CRUNCH" when players get headshot and the plugin displays large blood streams coming out of their head... too bad :)

I could make my custom sounds but that would mean all players would have to download them (just for a blood FX plugin), so it's useless...

Terran 18-02-2004 13:15

Re: EMIT_SOUND and sound levels >1 ?
 
Why useless? Other plugins like statsme make heavy usage of custom sounds and all players have to download them and nobody really complained :-)

Terran 18-02-2004 13:19

Re: EMIT_SOUND and sound levels >1 ?
 
Since one of the last steam updates a nice new feature was introduced: automatic download of resources from a webserver (sv_downloadurl "<your url>"!
With this feature enabled downloads are processed with full wire speed without the engines limitations.

And I guess that your custom sound won't be a big file at all...

stefanhendriks 18-02-2004 13:49

Re: EMIT_SOUND and sound levels >1 ?
 
Well, its not unlogical you can't pass the volume higher then 1. I mean, when the glass is full, it is full! it can;t get more full! :D

Anyway, if your purpose is to let other players hear the sound harder, then you can try to let the sound emit closer to the player yo uwant to hear it. Because, also the closer the louder the volume right? I bet the engine handles that, so if yo ureally want the max of the max, you should do a 'play' command at that player and play the exact same sound as the player who gets killed.

DO i make sense now? :)

Pierre-Marie Baty 18-02-2004 15:53

Re: EMIT_SOUND and sound levels >1 ?
 
...so on a 32 player server, if a player is killed, you tell me not to play ONE sound (using one network message), but 32 SOUNDS at different amplitudes, using 32 NETWORK MESSAGES ?

Stefan !... 9_9 :D

botmeister 18-02-2004 19:21

Re: EMIT_SOUND and sound levels >1 ?
 
Quote:

Originally Posted by Terran
Since one of the last steam updates a nice new feature was introduced: automatic download of resources from a webserver (sv_downloadurl "<your url>"!
With this feature enabled downloads are processed with full wire speed without the engines limitations.

And I guess that your custom sound won't be a big file at all...

Where can I get more information on how to use this feature? This is exactly what I need for my server!

botmeister 18-02-2004 19:23

Re: EMIT_SOUND and sound levels >1 ?
 
Quote:

Originally Posted by Pierre-Marie Baty
...so on a 32 player server, if a player is killed, you tell me not to play ONE sound (using one network message), but 32 SOUNDS at different amplitudes, using 32 NETWORK MESSAGES ?

Stefan !... 9_9 :D

I think it will make the sound seem like it came from the person hearing it and won't give you the desired effect.

I'd say your best bet is to add custom sounds. If they are small in size and only a few, then it won't take very long to download.

Terran 18-02-2004 19:32

Re: EMIT_SOUND and sound levels >1 ?
 
Quote:

Originally Posted by botmeister
Where can I get more information on how to use this feature? This is exactly what I need for my server!

It was posted by Alfred Reynolds at the hlds_linux mailing list (and maybe others).

Quote:

Originally Posted by Alfred Reynolds
Here is the README about the HTTP downloading function.


Half-Life Fast HTTP Asset Downloading Instructions
V1.02 January 22, 2004


SUMMARY
-------

Half-Life now supports the download of custom content (maps,
skins, sounds,
and so on) from a HTTP server (ie: webserver) when connecting,
instead of
downloading directly from the game server itself.

HTTP downloading has three major benefits:

1) There is no impact on the game server when downloading
custom content, as
a completely separate HTTP content server does the transfer

2) Players will download custom content at their maximum
transfer rate,
resulting in *much* faster downloads

3) Players who are downloading custom content do not take up a
player slot
on the server while they wait



WHAT PLAYERS CONNECTING TO A SERVER WITH CUSTOM CONTENT WILL SEE
----------------------------------------------------------------

When a player connects to a server utilizing custom content, one
of two
things will occur:

1) If the server is not configured for HTTP download, the game
server
will use the normal "trickle" download mechanism

2) If the server is configured for HTTP downloading, the player
will
see an enhanced download dialog, and much faster downloads.
While
this content is downloading, they are not connected to the
game
server. Once the download finishes, they are automatically
reconnected to the game server, and ready to play.



CONFIGURING YOUR SERVER TO USE FAST HTTP ASSET DOWNLOADING
----------------------------------------------------------

1) Make a list of all the custom files (bsp, wav, mdl, etc)
used on your server

2) Put these files on a HTTP server (ie: webserver), keeping
the folder
layout intact

3) OPTIONAL: To display a "banner image" to players that
download content,
place a 340x56 pixel image in the file <custom content
directory>/gfx/banner.gif

4) Set the sv_downloadurl cvar to
"http://yourserver/custom_content_directory/"


Example:

Your server uses the non-standard map "de_generic", which
requires the following files:

C:\Program
Files\Steam\SteamCache\your@email.address\Counter-Strike\cstrike\maps\de
_generic.map
C:\Program
Files\Steam\SteamCache\your@email.address\Counter-Strike\cstrike\de_gene
ric.wad
C:\Program
Files\Steam\SteamCache\your@email.address\Counter-Strike\cstrike\sound\a
mbience\de_generic_a.wav
C:\Program
Files\Steam\SteamCache\your@email.address\Counter-Strike\cstrike\sound\a
mbience\de_generic_b.wav
C:\Program
Files\Steam\SteamCache\your@email.address\Counter-Strike\cstrike\sound\a
mbience\de_generic_c.wav


You have web space (perhaps through your ISP) with the URL
"http://www.turtlerockstudios.com/~matt" that you will use to
host your
custom content.

To do this, you copy the files needed for "de_generic" to your
webspace,
placing them in a folder called "my_cstrike" in your webspace
top-level directory,
keeping their directory layout intact.

You now have the following files in your webspace:


http://www.turtlerockstudios.com/~ma...de_generic.map

http://www.turtlerockstudios.com/~ma...de_generic.wad

http://www.turtlerockstudios.com/~ma...bience/de_gene
ric_a.wav

http://www.turtlerockstudios.com/~ma...bience/de_gene
ric_b.wav

http://www.turtlerockstudios.com/~ma...bience/de_gene
ric_c.wav

You now set the "sv_downloadurl" cvar on your game server to
"http://www.turtlerockstudios.com/~matt/my_cstrike/". Now,
players who connect
to your server will automatically download the map "de_generic"
and its required
files from your webspace when they connect (unless they already
have it, of course).


TECHNICAL DETAILS
-----------------

* The maximum length of the sv_downloadurl is 127 characters

* A username and password can be specified for the HTTP server
by embedding
them in the sv_downloadurl like so:

http://username:password@www.somewhere.com/

( Note - recent IE patches make disable this functionality )

* If a connecting player has an existing file of the same name,
it will not
be overwritten. The download file will be skipped.

* Certain game-crtical and/or dangerous files cannot be
downloaded (ie: *.exe, *.vbs, etc)





_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailma...nfo/hlds_linux


Terran 18-02-2004 19:35

Re: EMIT_SOUND and sound levels >1 ?
 
But be careful, I run into some problems using this feature, below is my report to Alfred:

Quote:

Originally Posted by Terran
I've configured my linux CS Server to use this great new feature and
encountered some problems:

I'm running an apache webserver at the same box as the game server and
simply linked the necessary files to the webservers document tree.
I'm making heavy usage of .res files (generated by resgen).

Sadly most of the map makers ignore that linux differentiate upper and
lowercase letters in filenames. And they include resources in their maps
which they actually don't use. E.g. de_inferno requests a file named
"corvette.wad" which doesn't exist anywhere. Or de_train uses
gfx/env/trainyardbk.tga but the file is actually named
gfx/env/TrainYardBk.tga.

The old transfer method compensated those problem (ignoring missing but
unneccessary files, converting upper/lower case) but with the deligation of
the transfers to a webserver this is/can no longer be handled
automatically. Serveradmins have to check those problems on their own and
fix them by hand.

I don't know of a simple solution to this but at least a short "readme"
which records those problems should be provided.


Best regards, Dieter


stefanhendriks 18-02-2004 23:32

Re: EMIT_SOUND and sound levels >1 ?
 
Quote:

Originally Posted by Pierre-Marie Baty
...so on a 32 player server, if a player is killed, you tell me not to play ONE sound (using one network message), but 32 SOUNDS at different amplitudes, using 32 NETWORK MESSAGES ?

Stefan !... 9_9 :D

hey, you pay the price for such a feature :P

Btw, 32 times sending a 'play' message does not hurt that much. About how many bytes are we talking about? I bet its nothing compared to the amount of packages sent anyway.

botmeister 18-02-2004 23:44

Re: EMIT_SOUND and sound levels >1 ?
 
Thanks for the info Terran :) Looks like I have to get on a mailing list.


All times are GMT +2. The time now is 02:01.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.