BetterPortals

BetterPortals

1M Downloads

You don't hear any sound through the Portal

NoachiCode opened this issue ยท 2 comments

commented

For example if you have a piston on the other side you can see it extend and retract but you can't actualy hear it

commented

This is surprisingly difficult to get right once you consider all the details e.g. given a large portal with a sound source right behind it (i.e. in the other dimension on the side of the portal you cannot see), where should the sound come from?
Things don't get much simpler once you consider more than one portal (and recursive ones).

commented

With BP 0.2, sound on the other side of the portal now plays mostly as expected.
The current solution still has a ton of shortcomings which should be fixed at some point but it'll do for now.

Feel free to open new issues for any of the following shortcomings if you feel like they're too significant to ignore.

// Current shortcomings:
// - If the sound can be heard through more than one portal, one is chosen at random
// - Assumes portals to be stationary (sound system has only one listener, so this is hard to solve)
// - Recursion never goes through the same view twice (e.g. no infinite echos)
// - Passing through a portal will cause some sounds to suddenly switch direction. Really more of a shortcoming of
//     non-euclidean spaces with the lack of physics-based sound in MC (and games in general), not sure if we can do
//     anything about it.
// - Doesn't currently bother with repositioning sounds after initial calculation anyway (should be fine for
//     short sounds, don't care enough about long sounds) (really noticable only when the player goes through the portal themselves)
// - Clamping sounds to portals is currently done in the most simple way possible (and not accurate at all)
// - New portals don't create new sound sources (limitation of sound system lack of source cloning)
// - Closing portals doesn't stop sounds