2017-12-04 11:47:48

Hey all,
I decided to play around with the rotation package released by Sam, and see what good or bad ideas would come of it.
So as of right now I've got a very simple map system and the walking mechanics uses the rotation include. Everything works perfectly well and all, however I noticed one odd thing.
If I am very near or on a sound source, 1 or less tiles, when I turn the player, there is little to no difference in pan/volume. When I'm far away, 2 or more tiles, I do notice some difference.
I've tried modifying the pool attributes with no change to this strange behavior. Is there a reason this is happening?
What could I do to make sounds rotate, even when the player is right on top of them? Since, you know, that's kind of how the human ear works, and besides, as of now, my little game sounds very weird with this strangely behaving system.
Thanks!

2017-12-04 14:01:40

The sound positioning is a fork of BGT's sound_positioning include, which is very much made for more 3rd person perspectives. You'd basically need to rewrite position_sound* functions to be more 1st person.
Aprone put up a guide to this sort of sound positioning several years ago, if you can find it. BGT's lack of atan2 does make this more complicated, but IDR if the rotation package has a way around that problem.
An alternative might be to set your sound_pool's pan_step to a higher value, but this wouldn't solve the problem, just make it slightly nicer. What you really want to do is set it so that pan corresponds to the angle, and volume to the distance. Right now, pan is for horizontal position, which is why it sounds like things are near the center of a field rather than close to your head.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2017-12-05 05:23:39

hi,
I'm an absolute idiot when it comes to math. So, I have very little ideas how this would actually look or what I would have to modify in actual code. I never did make it passed college algebra so....

2017-12-05 09:20:39 (edited by CAE_Jones 2017-12-05 14:08:25)

Aprone's guide to movement and panning
You can skip the movement section, since the rotation package handles that more or less identically.

I don't know how well doing something like pool.pan_step=5 would help, but there's that option, too.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2017-12-05 16:26:55

I think you also have to keep in mind that bgt uses a logarithmic scale for panning and volume, so simply using aprones guide may not work.

Roel
golfing in the kitchen