[not a bug] No Z-axis sound-distance calculaton

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

No Z-axis sound-distance calculaton

Post by Hirogen2 »

When I had "noise" CVAR turned on to get the sound debug info I noticed that -- in my case it was an ambient sound -- it the "dist" in the table (and thus the heard volume too) does not fade when I go up in the air, so I conclude that the "dist"ance is calculated by sqrt(deltaX²+deltaY²) only, but should be sqrt(dx²+dy²+dz²).
GameArena
Posts: 182
Joined: Wed Jul 16, 2003 4:35 pm
Location: Outside of a bubble... Looking at all the humans inside.

Post by GameArena »

Yeah it actually is, I noticed this a long time ago. But you're methods wouldn't work as they have no origin and unless you have something with the origin of 0,0,0 it wouldn't be correct. I'm currently using (Px^2-Ox^2)+(Py^2-Oy^2)+(Pz^2-Oz^2) / 2 and then squaring it. It's not just wrong for sound, it's wrong in ApproxDist(), which is used to determine the rate of fading.
GameArena
Posts: 182
Joined: Wed Jul 16, 2003 4:35 pm
Location: Outside of a bubble... Looking at all the humans inside.

Post by GameArena »

Looks like I got carried away with the twos there, I'm really using: (((Px-Ox)^2)+((Py-Oy)^2)+((Pz-Oz)^2))/3 then sqrt
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

The origin of a sound is the average of its places, i.e. if you got a sector which acts as platform, say, at (-512,0) and exactly the same sector (sector id not tag id) at (512,0), then the sound will play at 0,0.
However, I noticed it with an ambient sound, exactly /one/ ambient sound. Fly over it and volume does not change.
GameArena
Posts: 182
Joined: Wed Jul 16, 2003 4:35 pm
Location: Outside of a bubble... Looking at all the humans inside.

Post by GameArena »

I know, it's because of the distance finding function and not directly concerning the sound. I wasn't aware the origin was immediatly played at 0,0 when dealing with ambient sounds. I'll look into it, but am pretty sure the sound emitter should actually be the player while in the sector, then the sector it self upon leaving. It's doubtful time was taken to correct the bug even if there was one, most people probably wouldn't even notice.

Edit: I didn't realize you said it was performed in the average (center) of the sector. There really isn't much wrong with that then, but it'd be pretty simple to attach the sound to the player whenever he is in the sector.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

GameArena wrote:I wasn't aware the origin was immediatly
played at 0,0 when dealing with ambient sounds.
Not only ambient sounds and not always on 0,0.
It was just by chance an ambient sound in my example. And by what ZDoom
produces, 0,0 is the middle of -512x0 and +512x0.
to attach the sound to the player whenever he is in the sector.
Eh, what? Oh well... maybe I was unclear, as I experimented with both usual
soudns and ambient sounds at once.

It is the usual sound (i.e. floor rising) which has the 'average' effect.

Then on top of that, all sounds have no Z-distance checking.
GameArena
Posts: 182
Joined: Wed Jul 16, 2003 4:35 pm
Location: Outside of a bubble... Looking at all the humans inside.

Post by GameArena »

I think this conversation is kind of going around in circles. When I said "to attach the sound to the player whenever he is in the sector", I was refering to editing the source. And yes I no there is no z distance calculation in P_AproxDist(), I said that in my first reply :P
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

I've known about this for years but have not changed it because Doom does it sound attenuation in 2D. Although it's not technically correct, it's not a bug either, because it was obviously designed to be that way.
User avatar
Hirogen2
Posts: 2033
Joined: Sat Jul 19, 2003 6:15 am
Operating System Version (Optional): Tumbleweed x64
Graphics Processor: Intel with Vulkan/Metal Support
Location: Central Germany
Contact:

Post by Hirogen2 »

randy wrote:I've known about this for years but have not changed it because Doom does it sound attenuation in 2D. Although it's not technically correct, it's not a bug either, because it was obviously designed to be that way.
What if an ApproxDist3() function would be added to take the Z axis into account? It will only be used for sound, as otherwise it could affect monster movement and/or similar.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Hey! I'm the first non-coder to make a post in this thread!

(Yeah, like that does any good.)
User avatar
Lexus Alyus
Posts: 4220
Joined: Tue Jul 15, 2003 5:07 pm
Location: Nottingham, UK
Contact:

Post by Lexus Alyus »

I'm working on making ROTGS into a full-new-modern-flashy-game-type-thing! I'm gonna try and do some work on the concept art once I get my drawing up to scratch and I'm developing the story right as I type this (or as you read this... by that time I would have already typed this... so your reading the past... or a post of the past...).

You all seem to be knowledgable in this programming stuff (somethingh that I have never understood and probably never will...) so, maybe we could team up at a later date. It's nothing soon... but I would like to team up with a programmer and get some stuff going... I'm interested in this stuff, even if it's just a new doom engine at the moment...

I'd like to ask randy... but nothing is certain yet as is the case with everything, and:
1) I get the impression that randy hates me...
2) he seems to be quite busy...
3) I can't think of one... but I kinda get the impression that he/(you) wouldn't be too interested in this...

Maybe I'm being really off the ball... but it's worth a shot... ya see, I've really wanted to do something computer game wise, even if it's just to make the music (man, that would be GREAT... if any one is interested... music is my area of expertise) and I always get these really cool story ideas and immiges (which is why i'm attempting to develop my drawing abilities), plus, I enjoy making levels... so I think I could give some rough ideas and great music for a game... then we'd just need the rest of the team (mainly artists and level designers). It would be cool if anyone is even remotely interested... even if it's just for fun... I'd be in it for the creativity... not in any major aim in money or anything... but it's always nice to think about things like that :-).

Maybe a cool team would be Hirogen2, Gameareana and Randy programming, Mouse making all the cool models, Enjay, cyb and TUD (I can't be bothered to type The Ultimate Doomer... so I'm just gonna short hand it instead... nevermind...) making levels and me doing music, sounds and production... maybe even cyb doing some voice talent :-)... ha, that's just a quick one... but yeah, anyone that's a bit intertested, just for fun, it would be cool :-).

:twisted:
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Hey, you forgot to mention me in there somewhere. :P
User avatar
Lexus Alyus
Posts: 4220
Joined: Tue Jul 15, 2003 5:07 pm
Location: Nottingham, UK
Contact:

Post by Lexus Alyus »

Got any special skills?

:twisted:
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

<-- W34k455 c0d3r (I'm sure I could handle ACS quite easily)

No, I'm not especially interested in ROTGS... but... uhh.. I felt left out.
User avatar
Lexus Alyus
Posts: 4220
Joined: Tue Jul 15, 2003 5:07 pm
Location: Nottingham, UK
Contact:

Post by Lexus Alyus »

Left out? I wouldn't say that... afterall, that was just the rantings of some random person... who may or may not be lagging... that my friend is up to you to decide... the path is a hard one... but you will learn... in time...

But sereously, it would be cool to get together with some programmers (and all the rest) and get some ideas rolling... after all, all good things start off somwhere...

:twisted:
Post Reply

Return to “Closed Bugs [GZDoom]”