Page 21 of 50

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 3:39 pm
by Eric Walch
On the mac you just get:

Code: Select all

iMac-DDR2:AddOns ericwalch$ ls -i -f
8620541 .
 982567 ..
8683106 .DS_Store
8620573 .SynologyWorkingDirectory
8621394 accessoriesV2.1.oxp
8622037 aegidian-special.oxp
8622314 Anarchies2.6.oxp
8623231 Aquatics 2.21.oxp
8624055 Armoury 1.08.oxp
8624863 Asteroids3D0.9.oxp
8624929 AsteroidStorm 4.03.oxp
8625877 behemoth 2.6.oxp
8626245 BehemothSpacewar 1.3.oxp
9151469 BGS-A1.6_r66.oxp
8627540 BigShips 1.02.oxp
8627607 BoaClipper.oxp
8627651 BountyScannerv2.0.oxp
8627704 buoyRepair.oxp
....
Indeed alphabetically with the same command.

And I have put my addOns folder onto my own Synology cloud (they synchronise between my computers and are thus identical in content). When I mount that Linux Volume to my mac and do a list of it, I get:

Code: Select all

iMac-DDR2:addOns ericwalch$ ls -i -f
      2 .							3500083 YOUR_AD_HERE_set_C_4.17.oxp
  26139 ..							3500084 griff_viper_normalmapped.oxp
3500001 lambda.oxp						3500085 weeviloid2.oxp
3500002 griff_ferdelance_normalmapped.oxp			3500086 Diso.oxp
3500003 YOUR_AD_HERE_set_A_4.17.oxp				3500087 TOGY_Main 1.2.oxp
3500004 Dock_Assist_System1.1.oxp				3500088 wolfwoods_variants.oxp
3500005 behemoth 2.6.oxp					3500089 System Capitals.rtf
3500006 ixianships 1.2.oxp					3500090 military Fiasco 2.5.2.oxp
3500007 griff_mamba_normalmapped.oxp				3500091 griff_cobraII_subent_missiles.oxp
3500008 nukes0.98.oxp						3500092 liners_v1.4.oxp
3500009 ZygoRoids v1.oxp					3500093 Pods 1.32.oxp
3500010 liberator.oxp						3500094 Commies.oxp
3500011 marett_vol1.oxp						3500095 Orisisv1.3.oxp
3500012 Cabal_Common_Library1.6.oxp				3500096 Shady_blackmonks_v1.42.oxp
The Synology nas operates under Linux and shows the chaotic order, even when called from a mac. Also the listing is now two columns.

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 4:04 pm
by Diziet Sma
@ Eric.. It looks like the Mac is still sorting the list, even though the -f command is telling ls not to sort the files. (Which is kinda naughty of Apple, given the following)

Right. Some checking (using info coreutils 'ls invocation') reveals that the -f option lists the files in the order they were added to the directory. (I'm guessing.. that is still a little unclear) are stored in the directory. What might be termed their 'natural' order.

Code: Select all

`-f'
     Primarily, like `-U'--do not sort; list the files in whatever
     order they are stored in the directory.  But also enable `-a' (list
     all files) and disable `-l', `--color', and `-s' (if they were
     specified before the `-f').
Possibly, this means that if I were to fully delete the halsis directory, and then add it again, things might work again. If not, I will have to go with the suggestion Svengali made.

Edit: corrected the above, based on testing and more research.

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 4:07 pm
by cim
Diziet Sma wrote:
Possibly, this means that if I were to fully delete the halsis directory, and then add it again, things might work again. If not, I will have to go with the suggestion Svengali made.
Delete it, add another directory (to take up that slot), then re-add it. Depending on how much deletion of directories you've already done, that may or may not get it into the right place...

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 4:21 pm
by Diziet Sma

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 4:34 pm
by Diziet Sma
Since Linux treats Halsis and halsis as two separate directories, instead of deleting Halsis.oxp, I just added another halsis.oxp and ran ls -f to see where the new directory appeared. No luck. Still way before BGS.

However, this suggests a simple solution.

Delete both versions of halsis.oxp and BGS. Reinstall BGS-A.oxp. Reinstall halsis.oxp. BGS should now have the slot before halsis, and everything should load in the correct order.

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 6:06 pm
by Diziet Sma
Well, I can report that the above didn't work.

After some experimentation and re-reading of the link I posted in response to cim, I think I understand why, and it's not good.

After the Linux Ext2 filesystem, directory structures were changed from a linear array of directory entries to a hashed, balanced, binary-tree (or htree) to improve performance. In simple terms, this means that for Ext3 and Ext4 filesystems, there are no 'slots' left free when a directory or file is deleted.

Instead, the name of the file or directory is run through an algorithm to produce a "hash" or unique number. The value of this hash then determines which branch and leaf the entry for that file/directory will appear in. No matter how much shuffling around is attempted by adding/deleting files and directories, when you re-install an OXP, it will appear in the same position, relative to the other OXPs, that it had before.

It gets a bit more complicated than that, of course, but the upshot is that there is no way to predict where in the hash-tree a particular entry will appear, and thus currently there is no way to control (or alter) the loading order of OXP files in Linux.

The ramifications for OXPs which modify other OXPs, (such as BGS) will take some thinking about.

Svengali wrote:
The loading order is - as far as I'm aware - OS specific and can't be specified by OXPs and Oolite uses what the OS filemanager tells it. So whatever OXPs are doing it might or might not work.
@ cim.. Is there any way that Oolite can specify to the OS filemanager how it wants things loaded? Is that even necessarily a good idea, or may it lead to other problems? As filesystems continue to evolve, it may well become necessary that Oolite have a standardised method/system of loading OXPs, to maintain consistency across platforms.


The above also explains why Eric's Mac has a sorted list even when the ls -f option is used. Apple's HFS+ uses a simpler binary-tree structure, so the way a directory is stored on disk is quite different. When he lists a Linux Volume, he gets the same hash-sorted list as a Linux user.


In the meantime, guess I'll just have to follow Svengali's advice, and add the Halsis sounds to the BGS customsounds.plist.

Re: BGS - The BackgroundSet

Posted: Fri Jan 11, 2013 9:07 pm
by Svengali
Diziet Sma wrote:
In the meantime, guess I'll just have to follow Svengali's advice, and add the Halsis sounds to the BGS customsounds.plist.
If you take a look at the patch (Halsis_BGS1.2) you'll notice that it contains some fixes.

Code: Select all

	"[cloaking-device-off]" = "bgs-c_cloak_off.ogg";
	"[cloaking-device-on]" = "bgs-c_cloak_on.ogg";
	"[hold-full]" = "cargfull.ogg";
	"[witchdrive-malfunction]" = "witchmal.ogg";
The first two are just the original entry from BGS, because the sounds are simply not existing in Halsis (although declared) and the other two typo fixes.

Re: BGS - The BackgroundSet

Posted: Sat Jan 12, 2013 6:41 pm
by Diziet Sma
Because Halsis_BGS was loading before BGS, it also was not taking effect. In the end I had to make the changes directly to the BGS customsounds.plist to get things to work correctly.

Just in case anyone else using Linux with BGS and Halsis has the same problems, I've zipped up the alternate customsounds.plist along with installation instructions and uploaded it to my box account.

Alternate_BGS_customsounds_for_Halsis.zip

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 12:10 am
by Svengali
Nice, Dizzy.
I guess the link should be placed on the BGS and/or Halsis Wiki page...

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 3:30 am
by MrDorakeen
Finally feel I have something to share. (first time posting) So a BIG Thank You to everyone who puts time and effort into the whole project! I have been nostalgic and happy for many years.

My own tastes like the radio chatter, but don't like that it's constant. I figure that real radio chatter is going to go in bursts, and I wanted a way to simulate that. Not finding a solution in a quick romp through readme files and forums posts, I took a look at the files. Didn't want to take time away from my other coding projects, so here's my quick and dirty solution:

First, I created some .ogg files that were silence for varying amounts of time, from 5 seconds to 45 seconds.

I copied these files into the Sounds directory of the oxp.

Added the following lines to the end of the customsounds.plist:

Code: Select all

"[red_silence05]" = "silence05.ogg";
"[red_silence10]" = "silence10.ogg";
"[red_silence15]" = "silence15.ogg";
"[red_silence20]" = "silence20.ogg";
"[red_silence25]" = "silence25.ogg";
"[red_silence30]" = "silence30.ogg";
"[red_silence35]" = "silence35.ogg";
"[red_silence40]" = "silence40.ogg";
"[red_silence45]" = "silence45.ogg";
And modified the following line in BGS-M.js

Code: Select all

this.chatterPool = ["[bgs_fxChatter0]","[red_silence45]","[bgs_fxChatter1]","[red_silence40]",
		"[bgs_fxChatter2]","[red_silence35]","[bgs_fxChatter3]","[red_silence30]","[bgs_fxChatter4]",
		"[red_silence25]","[bgs_fxChatter5]","[red_silence20]","[bgs_fxChatter6]","[red_silence15]",
		"[bgs_fxChatter7]","[red_silence15]","[bgs_fxChatter8]","[red_silence15]","[bgs_fxChatter9]",
		"[red_silence10]","[bgs_fxChatterA]","[red_silence10]","[bgs_fxChatterB]","[red_silence10]",
		"[bgs_fxChatterC]","[red_silence10]","[bgs_fxChatterD]","[red_silence05]","[bgs_fxChatterE]",
		"[red_silence05]","[bgs_fxChatterF]"];
WooHoo! It's working. Perhaps a bit too sporadic now, but deleting some of the silence entries in the this.chatterPool array should fix that.

If I were to code it, I would take this approach:
Set up two delay ranges, a response time (very short) and a pause time (long).
The response pauses would be between 1 and 10 seconds.
The longer pauses from 10 to 60 seconds.
Optimally, these would be user-settable.
Each burst of chatter would be from 1 to 5 bits of chatter, with a response pause between them, then a long pause.

I sincerely apologize if I have stepped on anyone's toes here. Just wanted to give a little back.

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 4:21 am
by Diziet Sma
I've added a similar patch for BGS-M to the zip, and placed a link on both Wiki pages.

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 12:33 pm
by Svengali
Heyho MrDorakeen,

nice one and welcome onboard .-)

There's a simpler way though. Simply change (BGS-M.js: 579 in this.changePlay):

Code: Select all

this.bgsCounter.chatterScatter = Math.ceil(((Math.random()*24)+1)/(l.length+1));
The array l contains the ships around the station. Just replace the 24 with a higher value, e.g. 150. As you can see the more ships are there the shorter the interval. It is not exactly a 'burst' as it is just a interval between the files, but a lot easier .-)

@Dizzy: Cool. Muchas gracias.

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 12:56 pm
by Diziet Sma
You know what I just realised is missing from BGS? A soundtrack for the F4 screen. Something soft and not too distracting, if you know what I mean, so there isn't just silence. If it also played on any sub-screens as well, that would be great. 8)

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 1:03 pm
by Cody
Diziet Sma wrote:
A soundtrack for the F4 screen. Something soft and not too distracting...
Every time I visit a rock hermit, I hit F4 just to hear the subtle sound effect (even though I know there are no contracts available - one day, I'll design an OXP for that)!

Re: BGS - The BackgroundSet

Posted: Sun Jan 13, 2013 2:45 pm
by MrDorakeen
Ah - much simpler!

Brute-forcing worked ok, but that's what I get for not taking the time to read more.

Thanks!