Sign in to follow this  
Followers 0

Merged sectors and sound

Suppose I have two (or more) sectors and I merge them (so they become one sector). If that sector starts to move, which part of it will make a sound? Is it nodebuilder dependant? Does it work the same way in Boom and Vanilla?

Share this post


Link to post
Memfis said:

Suppose I have two (or more) sectors and I merge them (so they become one sector). If that sector starts to move, which part of it will make a sound? Is it nodebuilder dependant? Does it work the same way in Boom and Vanilla?


The sound originates from the center of the sector (as computed by being in the center of the sector's bounding box). This is a special dummy mobj called soundorg whose position is computed during map initialization, in p_setup.c

//
// P_GroupLines
// Builds sector line lists and subsector sector numbers.
// Finds block bounding boxes for sectors.
//
void P_GroupLines (void)
{
 <snip lots of code>
	// set the degenmobj_t to the middle of the bounding box
	sector->soundorg.x = (bbox[BOXRIGHT]+bbox[BOXLEFT])/2;
	sector->soundorg.y = (bbox[BOXTOP]+bbox[BOXBOTTOM])/2;
<snip more code>
}

It's not changed in Boom. However, it's changed in ZDoom, which instead uses in real time the point in the sector which is the closest to the camera position; unless you use the compat_sectorsounds compatibility option. (You can add it to MAPINFO.) This option was added so that Suspended in Dusk's silent sector movement be silent again.

Share this post


Link to post

Interesting, I thought it was related to the lowest linedef number. Thanks!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0