News:

Welcome to World of Banished!

Main Menu

A Sound Idea

Started by Abandoned, May 26, 2017, 06:55:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Abandoned

oh my gosh @Bartender sounds like a giant leap in the right direction.  :)  Is it limited to the time length of the sound?  if the sound is repeated more often, than a longer length of sound might be better, if that makes any sense.  Can the range be made smaller, that would limit the length of time the sound would be heard, less chance of it being annoying and if placeable by the player even better.  To occasionally hear a favorite sound would be an enjoyable treat.  :)

brads3

what part of the code causes it to decide when a forester hits a tree and make the sound or a bs hits the anvil? can that part be manipulated. i understnad this will mean a worker is required to do it but there must a trigger in that part.

Bartender

#17
@Abandoned The things you mention should all be possible in theory indeed ;). The sounds have to be looped, otherwise it stops after playing once and then never comes back. Making the sounds long enough could keep it from getting annoying indeed. Theoretically the random selection could give us more freedom to decide how often the sound is played, though it does depend on the camera behaviour of the player so it's not ideal. I'll do some further testing to see how well it all works in practice :P.

@brads3 All those 'occasional' sounds are linked to the animations. unfortunately the code that links the ingame events (for example a citizen starting to work in the blacksmith) to the animation (hammering animation and sound) is not available to us. We would be able to change the sounds for the currently existing animations, but we wouldn't be able to create new animation events ourselves.

Abandoned

@Bartender  :) that sounds very promising, thank you so much.  Random selection less often may be better than longer.  No stop start to loop, that would have made it easier.  If indeed possible I think the player will need to use sparingly with caution, less is more theory.   I will have to check my music editor to see if it can convert mp3 sound to that wav format, problem is I've been know to disappear when I go near my desktop.

brads3

ok i'll brainstorm for a minute. i will take it that the sound for a forester  does not have to be the same for all foresters? like RED's fodder forester has adifferent sound than a normal forester.therefore, we could create a gatherer who runs around the map working at 20 different places and make sound.can the sound be different for each "work-place" or does it always have to be the same sound?how far apart can work places be? say you make a mod that is invisiable that has a worker go 30 spaces apart doing work at 4 compass points.he runs to the north point makes 1 sound. runs to the south point and makes a different sound?not practicle but possable?

Abandoned

@brads3 , I don't want a worker making sounds, the suggestion here is to have an invisible spot that will make it appear as if a sound is coming from an object like a church bell for a church, a train sound for a choo choo, a frog for a pond, a fog horn for a lighthouse, a spooky sound for a graveyard, since no sound can be added to those buildings or items.  There is no worker and shouldn't be a worker, workers and workplace already make there own sounds.

brads3

don't bite me. i know. i did say it wasn't "practical". i was trying to think of a way to force the game to do that. a work-around to the coding.

Bartender

#22
In the code the sounds are connected to the animations (so the actions), not to the specific professions. Any worker that uses an axe will make the same sounds while doing so, regardless of what their profession is. Ofcourse we can change the sounds of those existing animations, but we can't add any new ones of our own.

I'm currently trying to figure out how to get different types of buildings to play the sounds.. for the moment I've managed to change the sound of the houses, but those already have a looping sound in vanilla. I've found an old thread over at BL where the almighty ShockPuppet claimed that all buildings could play looped sounds using the same code, but I didn't get that to work yet. If anyone knows the trick ( @RedKetchup and @The Pilgrim might remember that thread), I could use some help ;).

EDIT: nevermind, I got it ;). Apparently buildings other than residency buildings can only play sound if it starts at the moment they are created. This does confirm that ghosted sound emitters are a possibility.

RedKetchup

if you read that thread over BL , i think i explained about i changed the temple one to put a bell + long silence and every 2 mins, cause there was 1min57 of silence... you could hear a church bell.

but like we said, it is a loop that continually run
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

building has :

AmbientEmitterDescription ambientemitter
{
bool _addOnCreate = true;
SoundEffect _soundEffects
[
"Audio/Effects/BellEffect.rsc"
]
}


belleffect.rsc has:

SoundBuffer version0
{
bool _looping = true;
String _wave = "Audio\Effects\Bell30D1.wav";
}

SoundBuffer version1
{
bool _looping = true;
String _wave = "Audio\Effects\Bell60D2.wav";
}

SoundBuffer version2
{
bool _looping = true;
String _wave = "Audio\Effects\Bell120D3.wav";
}

SoundEffect resource
{
float _radius = 15.0;
float _innerRadius = 12.0;

Sound _sounds
[
{
//float _startOffset = 0.000000;
Buffer _buffers
[
{ SoundBuffer _soundBuffer = "version0"; float _volume = 0.8;  }
{ SoundBuffer _soundBuffer = "version1"; float _volume = 0.8;  }
{ SoundBuffer _soundBuffer = "version2"; float _volume = 0.8;  }
]
}
]
}

ComponentDescription ambient
{
// how often to update
UpdatePriority _updatePriority = 1;

// declare types that will be used
Description _descriptions
[
"ambientemitter",
]
}

//AnimAudioEvent event
//{
//SoundEffect _soundEffect = "resource";
//float _chance = 0.02;
//}

AmbientEmitterDescription ambientemitter
{
SoundEffect _soundEffects [ "resource" ]
}



the .waves are in the .zip
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Gatherer

But can it be heard if the game window is not in the area? I think that is the main question here and the one that @Abandoend is asking as well. It should work the same as pasture sounds, only if the game window is on top of it.
There's never enough deco stuff!!!
Fiat panis.

RedKetchup

bell30D1.wav is 30 sec , in the end it DONG 1 time.
bell60D2.wav is 60 sec , in the end it DONG 2 times.
bell120D3.wav is 120 sec , in the end it DONG 3 times.

when in the area of the building like under the 50-80 tiles, you can hear it (of course when it dong lol although the silence too you hear it .... it is silence lol)

it was my variants made with SoundForge 11.0
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Bartender

Thanks @RedKetchup ! I made some simple tunes for my tests, but it will be nice to have some fitting sounds to try :)! Your code looks pretty similar to mine, I just noticed that you changed the updatePriority to 1. Did you find any effect of that?

@Gatherer Yes, these sounds also fade out if you move away from the object. We can even control how far the sound carries, though I'm not quite sure how the game determines the 'center point' of this radius. For some reason the buildings I've tried seem to have their sound center point somewhere floating above the mesh, because zooming in on the building actually made the sound softer.

RedKetchup

Quote from: Bartender on May 27, 2017, 02:43:48 PM
I just noticed that you changed the updatePriority to 1. Did you find any effect of that?

i have no idea where it is from
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Abandoned

@Bartender I checked my sound effects files and they are all mp3 format, my converter convert to mp3 not to wav.  Sound to me like you are making progress.  :)