Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Memfis

Merged sectors and sound

Recommended Posts

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
×