Room Bushes - How do they actually work? (from a technical standpoint) - by Mr. Bighead
Mr. Bighead on 23/4/2021 at 13:06
Hi there Taffer's!
Since I got into coding and blueprint scripting in ue4 I wondered how I could achieve a sound propagation system in a way that Thief has it.
Room brushes seem to me a very solid solution but I can't find deep design information on how they really work.
What I know to this point is that sound is propagated to the center of each brush, than to the next and so forth.
If you guys know just a little more about that topic or where I can find even a document it would mean a lot to me :)
Also, if you already experimented with these design's in ue4 let me know your aproach.
Thanks in advance!
R Soul on 23/4/2021 at 20:57
The source code was released a while ago so you could have a look. It doesn't get much deeper than that. It's so deep you'll get the bends if you stop reading the code too quickly.
This thread has a couple of links to try:
(
https://www.ttlg.com/forums/showthread.php?t=134091)
Post #17 is an FTP link which might work (not working for me but I'm not used to ftp myself so I'm not sure if it's a bad link or my settings not being correct).
Mr. Bighead on 24/4/2021 at 07:51
Oh yeah, right!
Having a look into that would be great.
Sadly the FTP links are seem to be down :(
m_h on 24/4/2021 at 08:51
Try the South Quarter link in the wayback machine (
https://web.archive.org/) https://web.archive.org/ - one of the earlier captures should have what you're after.
Mr. Bighead on 24/4/2021 at 12:08
(
https://web.archive.org/web/*/http://www.southquarter.com/*) show's what has been captured but I'm only able to find NewDark zip's which are not I'm looking for (because NewDark is just a patch right?).
But maybe I'm just overlooking what I'm after^^
Also searching the Internet for the code seems not as easy as I thought...
m_h on 24/4/2021 at 13:20
Sorry, should have been a bit clearer. In the linked thread above, the post immediately before the one with the failed ftp site link contains a direct link to the South Quarter archive - so use this (
http://www.southquarter.com/thief_2_service_release.7z) http://www.southquarter.com/thief_2_service_release.7z on the web archive search and it should have the file in one of the earlier captures.
Mr. Bighead on 24/4/2021 at 16:55
Now this looks about right!
Thank you very much :)
PinkDot on 24/4/2021 at 17:36
Quote:
What I know to this point is that sound is propagated to the center of each brush, than to the next and so forth.
During Room DB processing, Dromed calculates so called Room Portals - planes that lie on the border of overlapping rooms. For every room portal, it stores its center point (which also shouldn't lie inside the solid, like the room brush center itself) and it also stores distances from the rooms center to the planes center.
So the actual sound propagation is calculated between the room centers and the room portals centers and then from portals to centers of the adjecent rooms.
Kinda like:
Room --> Portal --> Room --> Portal --> Room
You can visualize the links in Dromed:
Inline Image:
https://i.imgur.com/Dd2iSIr.png
Mr. Bighead on 24/4/2021 at 18:15
Thanks for the visualization!
Okay, so these Portal's are created when a brush overlap's another brush on this specific location? But isn't this most of the time within a solid? (At least that's what I remember from my foolish Dromed mapping attempt's^^)
I guess the PC (player character) or the AI raycast's to these centerpoint's to send and get information about the sound distance, loudness etc.
What I didn't get yet is how these brushes work with a doorway.
If a door is closed the doorway-roombrush has it's centerpoint inside the solid entity, which is the door. So it can't communicate the sound information from the adjecent room's(?)
PinkDot on 24/4/2021 at 20:51
Quote:
Okay, so these Portal's are created when a brush overlap's another brush on this specific location? But isn't this most of the time within a solid?
No, typically room brushes should overlap each other in open spaces, so the portal would lie within it. Exceptions may be, when room brushes are touching by corners (think L shaped room made of 3 room brushes).
You can open up Dromed and check it for yourself - select any room brush and press Show All or Show Sel buttons at the bottom panel with brush properties.
Quote:
If a door is closed the doorway-roombrush has it's centerpoint inside the solid entity, which is the door.
The correct way to handle doorways is to have two roombrushes on each side of the door, touching each other within the bounds of the door model.
By their nature, doorways are always filled with air, or you'd never be able to go through them. If you're thinking of the black polygons that are generated within the door model geometry to block vision - they're only black polygons, but inside is still an air as a medium.
It's the door's physical model, that you collide with - not a temporary solid wall.
I'm not exactly sure how the engine handles door and sound attenuation. But it just must store an information on which links go through the door objects and check for the door closed status. Check 'Door > Rotating' or 'Door > Translating' Property. There are settings 'Blocks Sound %' and 'Lean Blocks Sound %'. Also each property holds IDs of two roombrushes associated with the door. These are probably calculated when you build Room DB.