Raised This Month: $51 Target: $400
 12% 

3D sound math


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 11-05-2012 , 17:45   3D sound math
Reply With Quote #1

Hello,

I want to do my own sound systems using client spk command, some spk tags, pawn code and math.
Only problem right now is:

Red - player
Two red/yellow lines - door
green something in the middle of picture - sound wave

Player hear that like there are no walls.
Basically i can make this with trace line:

Yellow line - trace line

but if there are a small hole in the wall then you can imagine what will happen.
I was thinking and i found no solution, i can do this but the code will use to much cpu.

Doing this by checking if that room is rendering will have also some problems

Dark Yellow - place what is not rendered

The player can not hear a sound but actually he must hear at least something.
Have someone idea how can i do things right?
Thanks!

And PS: my apologies about the last picture, its called laziness
Attached Thumbnails
Click image for larger version

Name:	soundroom.png
Views:	324
Size:	39.8 KB
ID:	111891   Click image for larger version

Name:	soundroom2.png
Views:	352
Size:	57.2 KB
ID:	111892   Click image for larger version

Name:	soundroompaint_ver.png
Views:	308
Size:	13.0 KB
ID:	111893  
.Dare Devil. is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 11-06-2012 , 10:16   Re: 3D sound math
Reply With Quote #2

Have you already some code or do you want to start this from begin now?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
mabaclu
Senior Member
Join Date: Jun 2010
Location: Portugal
Old 11-06-2012 , 11:45   Re: 3D sound math
Reply With Quote #3

Sorry for the off-topic but how do you intend to change the volume according to players' position?
__________________
mabaclu is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 11-14-2012 , 17:10   Re: 3D sound math
Reply With Quote #4

Quote:
Originally Posted by bibu View Post
Have you already some code or do you want to start this from begin now?
True, i made it long time ago but there was that problem so i deleted this, now im trying again but its useless. I think it must be done in client side so i can access to many stuff but we can not go client side road that way what i want.

Quote:
Originally Posted by mabaclu View Post
Sorry for the off-topic but how do you intend to change the volume according to players' position?
With simple math and logic i guess.
Anyway, playing with volume spk command have those things like "s(value)" and "e(value)"
those are % of start and the end of the sound.
0-100% is not very much but i can change volume like 5-10 times per playing.

So i see, that way what i want is ... lets say too hard
Is there possible to check emit correct volume, example i create fake entity and then emit empty sound and check this sound volume for example player index 5 ?
its pretty bad way to do but at least something...
.Dare Devil. is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-15-2012 , 18:08   Re: 3D sound math
Reply With Quote #5

Use fm_is_visible and get_distance(_f).
What do you mean with 3d sound math?
__________________

Last edited by claudiuhks; 11-15-2012 at 18:08.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 11-15-2012 , 20:18   Re: 3D sound math
Reply With Quote #6

Quote:
Originally Posted by claudiuhks View Post
Use fm_is_visible and get_distance(_f).
What do you mean with 3d sound math?
read my main post....

3d sound math, calculating sound volume what depends "player angle", "distance between player and sound point", "if wall is thin then you can hear at least something right?" and so on...
but the major problem is that if there are a wall and a small hole then my sound volume will seems ingame no real.

i need to find that hole somehow if there is one, but big codes are bad because its in serverside and server must handle 32 players + that function is used often "example every player gun shot".
I think this what im trying to do is just too much...
If i can somehow create my own 3d sound system then that sound precache limit "512" is not my problem anymore, because i can put example 3 or 5 sounds into one .wav .
Its pretty hard to example because of my bad english. ( if you noticed... )
.Dare Devil. is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:01.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode