[SUGGESTION] Being able to Set Properties to Regions

Started by subspark, Fri 12/03/2010 02:31:31

Previous topic - Next topic

subspark

While I'm not going to post all my code in here (too long), I've got a great module for Footstep Sounds that can be changed dynamically per region & per room.
What I can't change easily is the volume of these footstep sets. I've got three sounds.
1 = the stopping sound (Idle). 2 = walking variation A. 3 = walking variation B. I'll be adding more sounds to this variation later on.

I suggest properties become avaliable for regions so we can assign things like dynamic volume adjustments for footsteps based on character location etc.
There are other benefits of this idea pointed out below.

Cheers,
Sparky.

monkey0506

I actually don't know about this suggestion. Binding a volume attribute to an audio clip seems sort of like binding (X, Y) coordinates to a sprite. It doesn't really make sense IMO. Just as the sprite has to be displayed on something, the audio clip gets played on an audio channel (regardless of whether the sound is played automatically or manually, and whether or not you actually keep track of which channel it's being played on yourself).

Now seeing as this suggestion is deriving from your question regarding footstep sounds, it might be possible there is a better method to get the channel when a linked audio clip is played versus looping through the various channels in the system.

Upon some further digging around, I found the Game.SetAudioTypeVolume command..that is probably of some interest to you. I'll post an example in the appropriate location.

CShelton

I agree with Monkey on all accounts. For the functionality you're requesting, you could easily make an indexed struct that would allow you to match a specific sound define to a specific volume.

What would be nice though is if you could store a sound type and volume as a custom property of a region. (Gravel/60) or (Concrete, 85). That's how it's usually done in commercial game development. That way you just lay down a region and tell it what it's made off. You could even use the volume property as a max volume and use the character scale to raise and lower the volume.

Only problem is, looks like you can't add custom props to regions!

Khris

This can be done using a module easily. Thanks to extender functions, this could be as easy as
  rConcrete.SetSound(eRSGravel, 60);


my two cents on this and similar suggestions:
I'd rather have stuff implemented that isn't possible at all right now. Adding new commands to the engine for convenience's sake seems like a bit of a waste of time when they can easily be worked around.

SpacePaw

Like I wrote in other thread:
volume in the AudioClip would be appropriate if it was dependant on current volume. So if you set volume to 50% in audio clip it would be 50% for SoundVolume 100% and 25% for SoundVolume 50%. If you get my drift

subspark

I really like the idea of being able to set properties for regions. Yessirree!
I've changed the suggestion as so.

Cheers,
Sparky.

SMF spam blocked by CleanTalk