audio position + layout rotation 2

Bugs will be moved here once resolved.

Post » Wed Jul 03, 2013 11:13 pm

It seems that the closer the layer angle is to 180 degrees, the more the sounds are relative to the scroll position , rather than the listener object.

edit: i notice this might sound like i'm wanting an inconsistency, where really it should either:
follow the layer angle and the layer scroll position
or
follow the listener angle and the listener position
.. so i should probably give it context, the idea is that, the camera is mouse controlled, centred a varying distance inbetween the player and mouse cursor, as if the player character is 'looking' over in that direction.. but not 'listening' over in that direction, and the rotation is still locked to the players rotation.. hope that makes sense.

But I imagine a lot of people would want to set the the listener coord to the scroll position actually.. so it could be an option? just an idea.

Here's the same .capx with scrolling

Link to .capx file (required!):
https://dl.dropboxusercontent.com/u/53374990/Forum/bugs/AudioRotation2.capx


Steps to reproduce:
1. rotate to 180 degrees with arrow keys
2. scroll away from sound emitting object
3.


Observed result:
volume gets quieter

Expected result:
should stay relative to listener object

thanks again

Browsers affected:
Chrome: yes/no
Firefox: yes/no
Internet Explorer: yes/no

Operating system & service pack:

Construct 2 version:
    137keepee2013-07-03 23:27:28
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Jul 04, 2013 3:23 pm

Noticed another bug, or a related factor to the same bug?

As listener and sound emitter are moved away from the diagonal line, the volume decreases

you don't need to rotate layer towards 180 degrees, but it does need to be rotated *some* amount for this bug to happen.. So the layer is angled to 1 on startup

easier to show inside a .capx

https://www.dropbox.com/s/fo234q7wdrcy2gj/AudioRotation3.capx
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Mon Jul 08, 2013 12:02 pm

I've made a change for the next build to make the sounds always rotate relative to the listener, but it's pretty difficult to make it take in to account parallax. Do you really need that?

Your second example uses a reference distance of 0, which doesn't really make any sense and probably causes the problem. You shouldn't change the values unless you know what you're after.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Mon Jul 08, 2013 5:30 pm

I turned the properties down in general so you didn't have to move out as far.
I know what all the properties do, there's no reason ref distance of 0 should create this effect..

sounds full at 0,0 and 500,500
but down at 0,500 and 500,0

it's gotta be a bug, some broken coords somewhere.

Turn everything back to default and it still happens, you just have to move further out.


>Do you really need that?

Do i really need the audio to work with scrolling..?

of course!

honestly though I wasn't expecting an advanced audio engine anyway, so the whole thing was a bonus that i don't really need.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Tue Jul 09, 2013 9:35 am

The reference distance is used to measure attenuation over distance. If the reference distance is 100, then it means the sound will be reduced by a factor of two (or different depending on the particular formula) at a distance of 200, a factor of four at 400, and so on. If you set it to 0, it means infinite attenuation happens after 1 pixel, so the audio engine probably won't do anything reasonable or sensible in that case.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Tue Jul 09, 2013 8:01 pm

I see.. the manual makes it sound like it is a plateau -a distance before the attenuation starts.

but regardless, the bug is still there if you leave it as the default values. So it's not what's causing it.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Tue Jul 16, 2013 2:35 pm

@keepee - just a heads up, turns out there was another mistake in the calculation of panning for positioned sounds on rotated layers. Oops! It should be fixed in the next build, and it makes your AudioRotation3.capx example work correctly. Sorry for the confusion.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Tue Jul 16, 2013 7:43 pm

@ashley, excellent! thanks, and for notifying also
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Thu Jul 18, 2013 6:12 am

bad news,

Now, the left/right panning is correct at 0 and 180, but as it is angled towards 90 or 270, it gets entirely flipped.

This is not noticeable in AudioRotation2.capx (in OP), because at angle 90/270, the speaker appears above or below you.

So, here's another. It's the same as AudioRotation2.capx but with the speaker moved, and without the scrolling as that all seems to be good now.

https://www.dropbox.com/s/goj8x69w2sm8nv2/AudioRotation4.capx

@ashley

B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Fri Jul 26, 2013 9:44 pm

@keepee did you find a workaround for this issue?
B
34
S
8
G
5
Posts: 32
Reputation: 5,404

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 9 guests