Page 7 of 50

Posted: Wed Sep 22, 2010 5:05 am
by Kaks
Thargoid wrote:
It just seems odd that everything goes quiet when you go to the mission screen, and then comes straight back afterwards.
Since mission screens can add their own background music, doing anything else would very likely generate some horrible clashing sounds with some missions... You could think of it as going inside a phone box when looking at mission screens, something that would tend to muffle out all external sounds... :)

Posted: Wed Sep 22, 2010 9:52 am
by Svengali
Kaks wrote:
You could think of it as going inside a phone box when looking at mission screens, something that would tend to muffle out all external sounds... :)
Yes, probably the last thing we would like to see hear .-) And I'm already pretty happy that we have the Sound Class at all. It gives us so many options to do things.

Scriptupdate to v1.3.1 is online

Changes:
- Script stops looped ambient sound on GUI_SCREEN_LOAD based on timer interval.
- On entering missionscreen it stops music+looped ambient sound (based on timer interval, one after the other). FX part remains (max 9sec) with fadeout to make the 'break' less feelable.
- Between missionscreens no popping in anymore.
- After leaving missionscreen(s) audio comes back.
- Workaround for player died while on status screen

BGS_ScriptUpdateTo1.3.1.zip (6.4KB)

It would be very interesting to get some feedback, specially about the new missionscreen and LOAD screen handling and about the remaining FX part on missionscreens. The used delay for missionscreens should be big enough (300ms) to avoid the popping in (I've tested it with RandomHits and Thargoids new ship), but I'm not sure if it's the case on all machines.

Patches for other soundpacks are available:
- CustomSounds
- Halsis
- Hawksound

Patches for other soundpacks require the original oxp and BGS-A or BGS-M. They can be installed like any other oxp and will use the mechanism in BGS for the jumpcountdowns with it's own files. The idea behind these patches is that the oxps don't have to be changed, they are still working as standalone oxp and the changes are not necessary anymore when Oolite gets new possibilities, because BGS can detect it (and react on this) then. It's future music (he), but who knows .-)

Posted: Sun Nov 21, 2010 6:52 pm
by SpitJock
All in all - an excellent OXP that adds a lot to my enjoyment of the game. I could use a little assistance in modifying it though - assuming that's OK...

I found the radio chatter got pretty wearing pretty quickly. My own fault, I know - I just find the sound of the English language playing backwards a little bit disturbing (too much Judas Priest as a young'un ;) )
I *think* I could solve it by making copies of bgs-m_silence.ogg and using these to replace bgs-m_ambi_chatter1.ogg and
bgs-m_ambi_chatter2.ogg , but it occurs me I'm now using CPU time to 'play' silence, rather than just not playing anything at all... (OK - maybe not a huge problem on a capable machine) I also thought - if I could create a load more 'chatter' .oggs and have it select at random from a longer list than just the two provided, that might offset the problem.

The difficulty is - looking at the code in script.js, I can't see how it defines the sounds for radio chatter when entering station or planet/moon aegis - only when still in aegis after launch in this code:

Code: Select all

{start:"LAUNCH",type:"withinStationAegis",init:1,muteOn:false,change:0,src:3,sound:["bgs-m_ambi_chatter1.ogg","bgs-m_ambi_chatter2.ogg"]
,cmp:0},

Could Svengali or pagroove help me out? Point me to what I'm missing if nothing else? I'm not a dedicated javascript coder, but I usually find if you stare at a few bits of code long enough, and know how coding works in general, you can figure out most tweaks...

Posted: Sun Nov 21, 2010 7:16 pm
by SpitJock
Forgot to add - on the subject of generating additional sounds for radio chatter - grab a bunch of clips of NASA radio traffic, ATC chatter and the like. Perhaps pass it through some filters to muffle it somewhat and thus make it impossible to pick out any actual words/phrases so as not to ruin the illusion...

Maybe see if I can get some in other languages too if possible (not sure how easy it is to get radio chatter from the Chinese Space Program, but I've always wondered how I'd do in a suspected-espionage-interrogation scenario ;) )

Pepper it all with a few beeps, boops, pings and chunks of static and 'squelch', and it could sound pretty good... Opinions, anyone?

Posted: Sun Nov 21, 2010 8:02 pm
by Svengali
SpitJock wrote:
I could use a little assistance in modifying it though - assuming that's OK...
Yep - here we go.
SpitJock wrote:
The difficulty is - looking at the code in script.js, I can't see how it defines the sounds for radio chatter when entering station or planet/moon aegis - only when still in aegis after launch in this code:

Code: Select all

{start:"LAUNCH",type:"withinStationAegis",init:1,muteOn:false,change:0,src:3,sound:["bgs-m_ambi_chatter1.ogg","bgs-m_ambi_chatter2.ogg"]
,cmp:0},
You've found it already .-)

To make it less like a backward masking technique (rock'n'roll), simply replace the files in, or add your files to that array (e.g. sound:["a.ogg","b.ogg","c.ogg","d.ogg",etc.]).
That's it.

The selection is simply a random selection and happens in this.changePlay = function(obj,mode) (around line 316)

Code: Select all

if(typeof(obj.sound)==='object') sound = obj.sound[Math.floor(Math.random()*obj.sound.length)];
Hope this answers your question.

Posted: Sun Nov 21, 2010 8:34 pm
by Kaks
In other words, to not play anything change that to:

Code: Select all

{start:"LAUNCH",type:"withinStationAegis",init:1,muteOn:false,change:0,src:3,cmp:0},
If it hasn't got any sound: defined it won't play any! :)

Posted: Sun Nov 21, 2010 9:57 pm
by SpitJock
Thanks Svengali and Kaks. I believe I can see it now.

Still thinking I might work up a few sound clips of my own rather than leaving it "dead air". I can see that a bit of ATC chatter will add ambience and make the game even more immersive.

At the risk of just being cheeky now - another question. Does it preload the sound resources files or load/unload on the fly after the random selection? I'm thinking, if I feed it about 20 (or more) 45KB (or larger) soundbites, am I going to start choking the thing up?

And lastly - if I do come up with some clips that I'm happy with - anyone interested in trying them out? They won't exactly be recording-studio quality (in fact, deliberately the reverse) but I'm hoping some messing about with Audacity should generate something that sounds half decent.

Posted: Sun Nov 21, 2010 10:40 pm
by pagroove
Still thinking I might work up a few sound clips of my own rather than leaving it "dead air". I can see that a bit of ATC chatter will add ambience and make the game even more immersive.
The file is in fact ATC Chatter but then can you hear: 'take off from runway 27right"." In space that's not very realistic. :) I therefore suggested to play the sounds backwards.
I know we could do a little more. When I have the time I could edit something with my audio editor but I have no time at this moment and this 'chatter' as is is does the job.

Posted: Mon Nov 22, 2010 6:42 am
by SpitJock
And a jolly fine idea it is too - not anyone's fault but mine that it freaks me out... That's why I wanted to check I wasn't treading on anyone's toes if I worked up my own set and offered it up to anyone who might be interested.

I've just grabbed a bunch of ATC chat and audio clips from NASA and the former Russian Space Agency, and I think when I've taken out any phrases that break realism ("Uhhh... Houston - we have a problem") there'll be plenty left... :D I'll work on them when not working on stuff I get paid for...

I might see if I can generate some less human-sounding chatter too, on the assumption that it's hardly fair to expect our insectoid and feline brethren to speak a language for which they're not physiologically adapted...

Posted: Mon Nov 22, 2010 10:28 am
by Commander McLane
SpitJock wrote:
I've just grabbed a bunch of ATC chat and audio clips from NASA and the former Russian Space Agency, and I think when I've taken out any phrases that break realism ("Uhhh... Houston - we have a problem") there'll be plenty left... :D
Just make sure that the material isn't copyrighted (or, to be more precise, is copyrighted in a way that allows you to use it :wink: ).

Posted: Mon Nov 22, 2010 2:07 pm
by Svengali
SpitJock wrote:
Does it preload the sound resources files or load/unload on the fly after the random selection?
No preload, no unload too, everything on the fly and it doesn't matter if the array contains a few more entries.

But...
...the current version does not change/mix files until a new state is set. And as the chatter sound is looped and the player usually does not stay that long in the station aegis it is a cheap trick. Changing this would not only require to tweak the script, it would also need consistent soundfiles.

But for sure, other oxps can expand the basic set. An example for the chatter could look like:

Code: Select all

this.name = "ExpandBGSChatter_Set01";
this.author = "Me";
this.copyright = "(c)2010-4125 Again Me";
this.description = "Expand BGS chatter";
this.version = "1.0";

this.startUp = function()
{
  delete this.startUp;
  if(!worldScripts["BGS-M"]){
    for(prop in this){if(prop!=='name' && prop!=='version') delete this[prop];}
    log(this.name,this.name+': BGS-A or BGS-M not installed. Disabling...');
    return;
  } else {
    if(worldScripts["BGS-M"].startUp) worldScripts["BGS-M"].startUp();
    var myChatter = ["ExpandBGSChatter_Set01a.ogg","ExpandBGSChatter_Set01b.ogg"]; // Place your files in this array
    var a = worldScripts["BGS-M"].bgsSoundPool;
    for(var i=0;i<a.length;i++){
      if(a[i].start==="LAUNCH" && a[i].type==="withinStationAegis"){
        for(let s=0;s<myChatter.length;s++){
          a[i].sound.push(myChatter[s]);
        }
        break;
      }
    }
  }
}
Oh, and removing the sound property will cause trouble. Kaks would be right if the posted snippet would be the only thing, but the check above is only there to differenciate strings from arrays. Maybe I was a little bit lazy. To disable the chatter, rename the type (e.g. to "thinStationAegis"), or switch off all ambient sounds by setting this.extraA to false or (as you've already stated) use the silent sound.

And I'd really like to 'see' your first OXP. :-)

Posted: Mon Nov 22, 2010 5:36 pm
by Micha
the player usually does not stay that long in the station aegis
He doesn't?? I guess you've never had to wait in line while 15 ships dock before you finally get cleared... :-D For the 'instant-dockers' this might be true, but for the manual-dockers the constantly looping chatter does get a bit old.

A suggested improvement might be to have a whole bunch of individual short chatter, and then occasionally one gets randomly played rather than the continuous looping.
Not sure if you can do it in JS, but is it possible to load files based on a prefix or wildcard? Ie, all files matching "station_aegis_chatter*.ogg" or something? That way you don't have to hard-code them all into the script, and people can easily add/remove them as they please.


Also, on the engine up/down noises, is it possible to only play them -while- the keys are pressed? Or maybe remove them entirely, but affect the volume of the engine noise based on speed? I find the little engine noise quite annoying as I adjust my speed a lot and have currently removed them, but it would still be nice to have some sort of engine feedback. Just a thought.

Apart from these two niggles I really like the way this OXP freshens up the Oolite soundscape, so keep up the nice work :)

Posted: Mon Nov 22, 2010 6:10 pm
by Cody
Micha wrote:
the player usually does not stay that long in the station aegis
He doesn't?? I guess you've never had to wait in line while 15 ships dock before you finally get cleared... :-D For the 'instant-dockers' this might be true, but for the manual-dockers the constantly looping chatter does get a bit old.
Then there's those of us who often loiter in station space, waiting for a free wormhole ride.

Posted: Mon Nov 22, 2010 6:22 pm
by Svengali
Micha wrote:
He doesn't?? I guess you've never had to wait in line while 15 ships dock before you finally get cleared... :-D For the 'instant-dockers' this might be true, but for the manual-dockers the constantly looping chatter does get a bit old.
He, yes. I'm a instant docker and even if I have to dock manually and there are 15 ships before me, I'm pushing the current docker to the side or force him to fly into the station and tweak my ship in the station .-) Ha, waiting until 15 ships have docked...
Micha wrote:
A suggested improvement might be to have a whole bunch of individual short chatter, and then occasionally one gets randomly played rather than the continuous looping.
Sounds like a plan .-)
Micha wrote:
Not sure if you can do it in JS, but is it possible to load files based on a prefix or wildcard? Ie, all files matching "station_aegis_chatter*.ogg" or something? That way you don't have to hard-code them all into the script, and people can easily add/remove them as they please.
Wildcards? Hmm, no. It's not possible, I think. Have tried it a while ago, but will repeat the tests.
Micha wrote:
Also, on the engine up/down noises, is it possible to only play them -while- the keys are pressed? Or maybe remove them entirely, but affect the volume of the engine noise based on speed? I find the little engine noise quite annoying as I adjust my speed a lot and have currently removed them, but it would still be nice to have some sort of engine feedback. Just a thought.
Keypresses? Also not possible. The script does not know anything about keypresses or releases, so everything is based on the timer interval and the length of the soundfile. And altering sounds via pitch or volume is not possible too.

The problem is that we don't have any control about the volume per channel and it would sound pretty uggly if a sound gets restarted over and over or stopped in the middle of playing. This was the biggest headache for me while writing it and gave Pagroove also a few sleepless nights when he was creating sounds and music. In the end I'm pretty pleased with the result - within the possibilities of the SoundSource class.

But this also means that the soundwork was tricky and required some thinking. The length and volume of the file and the timer interval are important and I've tried to set the interval as high as possible to avoid using too much CPU time. The looped sounds required even more work and every cut/fade have had to be as pretty precise.

Ahruman stated a while ago that he was thinking about switching to OpenAL - maybe this will give us some more options.

Posted: Mon Nov 22, 2010 9:46 pm
by Thargoid
Svengali wrote:
Micha wrote:
Not sure if you can do it in JS, but is it possible to load files based on a prefix or wildcard? Ie, all files matching "station_aegis_chatter*.ogg" or something? That way you don't have to hard-code them all into the script, and people can easily add/remove them as they please.
Wildcards? Hmm, no. It's not possible, I think. Have tried it a while ago, but will repeat the tests.
Admittedly I've never tried it with sound files, but I would expect it to be possible by building up the filename ("station_aegis_chatter_" + this.chatterNumber + ".ogg" or somesuch, and then using that in the sound file commands? It certainly works with .png files for textures and such, and I wouldn't expect audio files to work much differently?

You do need the correct filename format, but it should work?