Open Larzone24 opened 11 months ago
Also, the yellow debug line from player to source dissaperas when this happens, even though the audio keeps playing.
@Larzone24 This is an interesting case that you present.
The first clue about what's going on here is the values coming from the acoustic queries. The value of -3,402823E+38 indicates that the query failed for the source location. This is due to the sound source being unreachable and during the acoustic simulation, the simulator will not produce values for those unreachable locations.
The Unity plugin which does the acoustic queries needs to decide how to treat the error code coming back from the acoustics system. Many times when a sound source is unreachable, it is close a wall that was voxelized (i.e. expanded) and the policy is to retain the last query value and apply that cached value for sources that are now failing. This policy is not a great policy for the circumstances that you desire in your scenario.
Unfortunately, the only workaround that I can recommend for this particular scenario where the rooms aren't connected by a portal/doorway is to detect that the player is in a new room and disable the sound sources from the room that is unreachable acoustically. This should provide the desired effect, although it requires some manual work on your part.
The Unreal plugin has a bit more flexibility given that the source code is accessible so the policy for caching the last value can be replaced with a heuristic that matches your scenario better. Also, the Unreal plugin supports dynamic openings like doors, whereas the Unity plugin does not have that support.
I hope that helps explain what's going on a little better. Thanks for providing the question.
Best regards, Noel
Okay, if I understand you correctly it seams that my design won't work out of the box, i.e. that having closed rooms won't work. However, the strang thing is that PA behaves correctly (as I would expect) for me on the front door. On the front door the audio just cuts of when going outside (see new video below).
I was aware that PA didn't support opening of doors in Unity, but my plan was to maybe lower the occlution multiplier so a little sound goes through walls and doors all the time (if this is how it would work).
Note, right now I don't use NavMesh since this would lead to PA baking my whole scene which would take days, so i instead have Acoustics Navigation scripts on all floor game objects so PA only need to bake the house. This wouldn't cause any problems, right?
If my current design won't work I guess I have the following options:
@Larzone24 the reason why the front door case is working as shown in the video is because there must be, however minimal, a pathway from the listener to the source in that case. If you send us the ACE file, we could inspect it to see where the gap is. Regardless, this "reachability" behavior might be something that you could take advantage of by having at least a bit of the enclosed room having access to the main corridor. This won't be 100% accurate as the portal you create will likely lead to some bleedthrough in a direction that you don't want. If this piercing is done in a spot that results in a long reachability path, then the sound will be attenuated by quite a bit and probably won't be a problem, but you'd have to play with it.
As far as treatment for doors are concerned, yes, we typically recommend baking with the doors open and then doing some real-time hit testing to determine if the door is opened or closed. Since the PA Unity plugin binary handles all of the underlying queries to the acoustics runtime, you don't have the ability to intercept the calls for rendering. The only control that you'd have is either disabling sources dynamically or adjusting the occlusion multiplier for those sources based on the door states and proximity tests. It does require some housekeeping regarding the location and state of each collection of sources which is not ideal.
Handling dynamic doors is a challenging problem with a baked acoustics solution and it is one that we've been working on for some time now with research still ongoing for an optimal solution.
I found that there was a pathway through the second floor. However, in another closed room with front door it somettimes works, and sometimes fails depending on if the audio source if moved up or down inside the room. Closer to the floor, it works. Can't send the ace file hear since it is 35 mb and 26 compressed fully with 7-zip. Github limit is 25 mb in coments (so close 😂).
Also, in the process of testing if PA can be used in my game so have some more questions. Hope that's fine.
In my horror game you need to be able to hide under beds and in closets (would need to make hiden pathways here as well). When testing right now, the bed over the player does not occlude the audio source placed over the bed. Makes no different it seams that the bed is over the player. I should of course hear the sound, which i do, but feels like it should come more from the sides or me a bit more muted. Would this require me to have more probe placements, e.g. one probe under the bed? Not sure if I understand exacly what the probes do.
Maybe goes hand in hand with question 2 but I'm afraid that the voxels will be too big and will interfer when hiding in smaller areas, e.g. voxels from the floor and bed would make the area under the bed without geomerty too small so the audio listener will go inside the geomerty voxels. Right now i'm using Couarse but are baking Fine to test, but not done yet. Can the voxel side be tweaked and how would that effect the bake time?
Does PA have vertical positioning (unsure of the correct terms). But can I notice if a sound comes from above or below. Have tested a bit and to me it's not obvious if the audio source is above or below me.
Lastly, how should I manage forest area. Does PA have much affect on audio inside an forest, enough to be worth baking it? If I where to bake my whole terrain it would take forever. Right now, if I want to bake my 4 floor house on fine, it will take 8 days and 5 hours accourding to Estimated Compute Cost (1240 probe counts). Or is there a better/simpler way of handling forests? I would guess that occlusion from tress isn't that important and that there isn't much reverb. But I'm no sound expert. :)
@NoelCross Just a kind reminder that i'm still waiting on some answers on the questions above. :)
For some reason audio is still heard through walls. However, the main issue seams to be that the audio stops updating or something when I move to another room. It doesn't matter if I change settings in the Acoustics Adjust script, the sounds plays the same way from the first room.
For example, if I go to the other room with the audio source placed to my left ear, it will continoue playing on the left ear even if I turn around. Its now stuck in this position. See video below.
The audio fixes itself when walking back to the first room. This is the same in multiple locations in my house.
Edit: Ignore the Wetness (db) setting. It is usally set to default and I just tried changing it to see if it affected the audio when in the other room and then forgot to change it back. The issue was the same even when it was default.
https://youtu.be/foaywb2oof8