Hi Thomas,
This exact problem struck me also when I started developing my current 2d
game. The way I'm solving it is to have the distance calculations that stop
sounds, but also to divide things into regions as you say. Then, I use
pathfinding to see if there is an audible path between the player's current
region and region x. If there is, play the sound based off of that source
such as a doorway, or all over the stereo image if you find that there are
plenty of open space between the two such as a large coridor leading into
another. Pathfinding is obviously quite expensive so you will need to buffer
and reuse rather than recalculate except when absolutely necessary, but I
think you get the idea. I do not know whether you consider this to be too
much of a time investment, but that's the approach that I'm going with in
order to get both nice overlapping and efficient CPU usage.
Kind regards,
Philip Bennefall
----- Original Message -----
From: "Thomas Ward" <[email protected]>
To: "Gamers Discussion list" <[email protected]>
Sent: Monday, December 06, 2010 7:57 AM
Subject: Re: [Audyssey] Creating game levels to scale?
Hi Phil,
Hmmm...I see. Well, you are right it is definitely too late for
something like that. We are talking a massive rewrite of the engine to
make the rooms and the sound regions separate objects. The way it
works now if you asign an item or enemy to room x sounds are not
triggered until the player enters that room. The code to randomly
place items and monsters, create the rooms, and the sounds all use the
same region objects for various purposes. One is tied to the other so
that it would take a massive rewrite of everything to undo all that.
The easiest solution would be to rewrite the UpdateBackgroundAudio()
function to stop sounds based on distance rather than sound region.
Problem is that there are times when this could be and would be
undesirable. If you happen to be walking under a room with stuff in it
you will here levers, torches, etc from the room above the one you are
in. Not cool at all seeing as you would want that stuff to be silent
until you entered the room. So perhaps a compromise would be to have
a boolean flag that says in effect if sound region is not visited keep
sounds silence, and if it is visited play the sounds. That way even
though you entered a new room the fire pit whatever still could be
heard from the previous room where sounds in the new room wouldn't be
triggered until you entered it.
On 12/5/10, Phil Vlasak <[email protected]> wrote:
Hi Thomas,
It is definitely too late to do this for MOTA, but I would have the door
designated as a sound region itself.
It could be about 4 foot thick, and the door between room 1 and 2 would
play
the sounds of both room 1 and 2 but at 40 percent volume.
Phil
---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to
[email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the
list,
please send E-mail to [email protected].
---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to
[email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].
---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].