Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (howardR, sleakz), 688 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: ent_playsound on moving entities [Re: painkiller] #463716
12/22/16 12:33
12/22/16 12:33
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
I just tried it and for me ent_playsound works as it should ent_playloop(my, beep_snd, 100); or ent_playsound(my, beep_snd, 100); in a loop.

Are you sure you haven't accidently attach the sound to an other object that you forget / or dont move?

ps: I use both Shade-C evo and physx

Last edited by Reconnoiter; 12/22/16 12:36.
Re: ent_playsound on moving entities [Re: Reconnoiter] #463718
12/22/16 13:04
12/22/16 13:04
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: Reconnoiter
I just tried it and for me ent_playsound works as it should ent_playloop(my, beep_snd, 100); or ent_playsound(my, beep_snd, 100); in a loop.

Are you sure you haven't accidently attach the sound to an other object that you forget / or dont move?

ps: I use both Shade-C evo and physx


if you move the entity the sound plays at its new position?

I just play them from the entity's action


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: ent_playsound on moving entities [Re: painkiller] #463720
12/22/16 13:42
12/22/16 13:42
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Yes I move the entity with pXent_move. Also tried several sounds simultaneously. (from entity's action)
Perhaps your camera/view settings are different or such.

Last edited by Reconnoiter; 12/22/16 13:43.
Re: ent_playsound on moving entities [Re: Reconnoiter] #463725
12/22/16 20:26
12/22/16 20:26
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: Reconnoiter
Yes I move the entity with pXent_move. Also tried several sounds simultaneously. (from entity's action)
Perhaps your camera/view settings are different or such.


In my case I move it using forces, not sure if that would make a difference


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: ent_playsound on moving entities [Re: painkiller] #463734
12/23/16 10:47
12/23/16 10:47
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
I've uploaded a small demo based on the shade-c examples showing the problem: http://www.mediafire.com/file/v3bktj65kwn8pld/sound_test.zip
You can move the player with wasd and mouse and play sound with e key.

On my computer on the origin position the sound plays fine, however if I move the player the volume gets lower like if the sound is still played at the origin position.


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: ent_playsound on moving entities [Re: painkiller] #463737
12/23/16 11:49
12/23/16 11:49
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Hey painkiller, I did some tests. I also didn't get any sounds with your script at far distance. The only thing I can think of now is indeed that the force function is the problem, but only the function(s) it seems. Cause e.g. if I move rigid objects (with an attached sound loop) with my character controller they continue to make sounds. So my quess is that its a bug with the physx force function.

-edit: a possible solution might be either just a dummy entity that you move normally with the player and play the sounds on it, or use snd_play and based on distance to camera calculate the right volume.

Merry Christmas

Last edited by Reconnoiter; 12/23/16 11:56.
Re: ent_playsound on moving entities [Re: Reconnoiter] #463738
12/23/16 12:23
12/23/16 12:23
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
hmm this is strange. If I attach a dummy entity to the player or camera it moves with it as it should but the sound problem is still there.

Also tried to change the type to PH_CHAR and use pXent_move but the bug happens also.

ent_playloop seems to move with the entities, but ent_playsound stays at the entity's original position.

using snd_play and changing the volume depending on the position would work, but would loose 3d sounds advantages, for example knowing if an enemy comes from the left or right side.

Merry christmas to you too!

Last edited by painkiller; 12/23/16 12:26.

3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: ent_playsound on moving entities [Re: painkiller] #463739
12/23/16 12:57
12/23/16 12:57
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
I tried your sound + setting the player in my script as rigid + adding this to its action pXent_addforcecentral(me, vector(0,-200,200)); , and the sounds kept working until I commented the original move function out. So perhaps try adding a dummy pXent_move call so something gets updated correctly(?).

Re: ent_playsound on moving entities [Re: painkiller] #463740
12/23/16 13:14
12/23/16 13:14
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Originally Posted By: painkiller
using snd_play and changing the volume depending on the position would work, but would loose 3d sounds advantages, for example knowing if an enemy comes from the left or right side.

You can do that yourself too though, for example as follows (untested, just the idea):

vec_diff(temp,ent.x,camera.x);
temp.z = 0;
vec_normalize(temp,1);
vec_set(temp2,vector(0,-1,0));
vec_rotate(temp2,vector(camera.pan,0,0)); // pan alone should be enough, right?
var balance = vec_dot(temp,temp2)*100;
snd_tune(...,balance);

If the result is super wrong, I'd start with DEBUG_VARing the vec_dot result.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: ent_playsound on moving entities [Re: Reconnoiter] #463741
12/23/16 13:42
12/23/16 13:42
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline OP
Serious User
painkiller  Offline OP
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
Originally Posted By: Reconnoiter
I tried your sound + setting the player in my script as rigid + adding this to its action pXent_addforcecentral(me, vector(0,-200,200)); , and the sounds kept working until I commented the original move function out. So perhaps try adding a dummy pXent_move call so something gets updated correctly(?).


I think that doesn't seem to work, at least on my computer. I tried to add a pXent_move call but still got the problem. Did you try it on the demo I uploaded?

Code:
pXent_move(me,vector(0,0,0.1),nullvector);
		
		vec_set(player_move_vec,nullvector);
		vec_set(player_move_vec,vector(key_w-key_s,key_a-key_d,0));
		vec_normalize(player_move_vec,0.975*time_step);
		vec_rotate(player_move_vec,vector(my.pan,0,0));
		
		pXent_addforcecentral(me, player_move_vec);
		
		pXent_move(me,vector(0,0,-0.1),nullvector);



Originally Posted By: Superku
Originally Posted By: painkiller
using snd_play and changing the volume depending on the position would work, but would loose 3d sounds advantages, for example knowing if an enemy comes from the left or right side.

You can do that yourself too though, for example as follows (untested, just the idea):

vec_diff(temp,ent.x,camera.x);
temp.z = 0;
vec_normalize(temp,1);
vec_set(temp2,vector(0,-1,0));
vec_rotate(temp2,vector(camera.pan,0,0)); // pan alone should be enough, right?
var balance = vec_dot(temp,temp2)*100;
snd_tune(...,balance);

If the result is super wrong, I'd start with DEBUG_VARing the vec_dot result.


That's a good idea, I will take a look at it. Thanks superku


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Page 2 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1