Library
Moderators: winston, another_commander
- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
I've really only used Lib Config, Lib GUI and Lib PAD. Lib PAD events is just a feeder into Lib PAD - it takes some standard game events and records them in the PAD, similar to what I did with the Email System, where I added a whole bunch of automatic emails when the player does certain things. I think I understand Lib GUI pretty well, but it's probably not going to be used very much outside of Xenon UI and BGS.
I have a suspicion Lib Test was in response to Ship Configuration - my logic for that OXP was that, if I'm penalising the player by making their ship slower or harder to steer based on the equipment and weight, then it should be applied to *all* NPC ships as well, otherwise the balance of the game would be skewed. But by applying the changes to things like mission ships, it moves those ships away from a particular performance rating a mission author was aiming for. I might be overthinking it, and it's too late to ask now.
One of the issues I have with the code in Library suite is that it's so *dense*, in that everything is reduced to the smallest possible space. A lot of the code uses single letter variable names, which makes reading it a real chore. Whenever I have to dive into it, I spend a lot of time asking questions like "So, what's 'c' in this context? What's 's'? And 't'? And 'z'?", and having to follow the flow of the code back to the origin to work it out for each one. The code is super clever, and it does some pretty amazing things, but it's written in a way that makes maintaining it, for anyone other that the original author, super hard. And the little documentation left behind is not always very helpful, even for a programmer. Several times I've read the documentation and I'm still left with questions about the implementation, which means the only way to actually work it out is trial and error - feeding data in to see what you get out. And that's for the easy stuff, like PAD. The animator, starmap, those things are several levels up from what we're doing with PAD.
I have a suspicion Lib Test was in response to Ship Configuration - my logic for that OXP was that, if I'm penalising the player by making their ship slower or harder to steer based on the equipment and weight, then it should be applied to *all* NPC ships as well, otherwise the balance of the game would be skewed. But by applying the changes to things like mission ships, it moves those ships away from a particular performance rating a mission author was aiming for. I might be overthinking it, and it's too late to ask now.
One of the issues I have with the code in Library suite is that it's so *dense*, in that everything is reduced to the smallest possible space. A lot of the code uses single letter variable names, which makes reading it a real chore. Whenever I have to dive into it, I spend a lot of time asking questions like "So, what's 'c' in this context? What's 's'? And 't'? And 'z'?", and having to follow the flow of the code back to the origin to work it out for each one. The code is super clever, and it does some pretty amazing things, but it's written in a way that makes maintaining it, for anyone other that the original author, super hard. And the little documentation left behind is not always very helpful, even for a programmer. Several times I've read the documentation and I'm still left with questions about the implementation, which means the only way to actually work it out is trial and error - feeding data in to see what you get out. And that's for the easy stuff, like PAD. The animator, starmap, those things are several levels up from what we're doing with PAD.
Re: Library
For clarity:
the reason I asked the avatar pic location is that PAD allows inputting a filename to select a avatar and I couldn't find out where it expected that file to be located (full path didn't work).
About svengali code
To allow SC to be configurable I had to learn how to use OXPConfig and I gained enough insight to take over OXPConfig maintenance some time later.
I added lots of comments, refactored parts and slowly increased my insight. Ofcourse svengali was still answering questions then.
A v3 was started but hadn't reached testing phase when I left oolite.
My advise :
Identify parts of library that are actively used in oxps, and split the code for that off to separate oxps.
aim for minimalism / form follows function . ONLY split off code if there are people willing to maintain the new oxp (maybe authors of oxps that use that functionality ?)
This should make library code smaller and less complicated over time.
the reason I asked the avatar pic location is that PAD allows inputting a filename to select a avatar and I couldn't find out where it expected that file to be located (full path didn't work).
About svengali code
To allow SC to be configurable I had to learn how to use OXPConfig and I gained enough insight to take over OXPConfig maintenance some time later.
I added lots of comments, refactored parts and slowly increased my insight. Ofcourse svengali was still answering questions then.
A v3 was started but hadn't reached testing phase when I left oolite.
My advise :
Identify parts of library that are actively used in oxps, and split the code for that off to separate oxps.
aim for minimalism / form follows function . ONLY split off code if there are people willing to maintain the new oxp (maybe authors of oxps that use that functionality ?)
This should make library code smaller and less complicated over time.
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
- Cholmondely
- Archivist
- Posts: 6417
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Library
1) Is this really a good idea? The Library.oxp we have at the moment works. As does the OXP Config chunk of it. Why change things? The amount of work involved in rejigging all the various OXP references from Library.Config to yet another OXP is non-trivial. A lot of work for no benefit, meseems. It's not broken, so why "fix" it?Lone_Wolf wrote: ↑Fri Jul 25, 2025 5:43 pmFor clarity:
the reason I asked the avatar pic location is that PAD allows inputting a filename to select a avatar and I couldn't find out where it expected that file to be located (full path didn't work).
About svengali code
To allow SC to be configurable I had to learn how to use OXPConfig and I gained enough insight to take over OXPConfig maintenance some time later.
I added lots of comments, refactored parts and slowly increased my insight. Of course Svengali was still answering questions then.
A v3 was started but hadn't reached testing phase when I left Oolite.
My advice :
Identify parts of library that are actively used in oxps, and split the code for that off to separate oxps.
Aim for minimalism / form follows function . ONLY split off code if there are people willing to maintain the new oxp (maybe authors of oxps that use that functionality ?)
This should make library code smaller and less complicated over time.
Seriously. Library.oxp strikes me as a treasure trove of goodies.
For 7 years all that has happened is that more and more OXPs have used the "OXP Config" bit of it. The rest was ignored.
The misplacement of Galactic Navy due to license issues meant that people were not even aware of how PAD works with it. DGill's version of Feudal States now uses PAD and Phkb has been using it for other missions too.
If one or two of us start using some of the other bits of it, more and more of it will end up being used.
2) So did you manage to get the avatar picture of your choice?
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Re: Library
2) Not yet, to much to do.
CCL started out as a joint project, overtime only svengali remained .
When svengali wanted to retire (2013 ?) he couldn't find anyone willing & capable to take over CCL .
For oxpconfig I was the only candidate .
What will happen with Library if the few people who understand parts of it are no longer available (for whatever reason) and it needs changes ?
refactoring / documenting is much easier for smaller projects then for large ones.
CCL started out as a joint project, overtime only svengali remained .
When svengali wanted to retire (2013 ?) he couldn't find anyone willing & capable to take over CCL .
For oxpconfig I was the only candidate .
What will happen with Library if the few people who understand parts of it are no longer available (for whatever reason) and it needs changes ?
refactoring / documenting is much easier for smaller projects then for large ones.
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
- Cholmondely
- Archivist
- Posts: 6417
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Library
CCL was properly documented from the little I (a non-programmer) can make out. Library isn't.Lone_Wolf wrote: ↑Fri Jul 25, 2025 6:30 pm2) Not yet, to much to do.
CCL started out as a joint project, overtime only svengali remained .
When svengali wanted to retire (2013 ?) he couldn't find anyone willing & capable to take over CCL .
For oxpconfig I was the only candidate .
What will happen with Library if the few people who understand parts of it are no longer available (for whatever reason) and it needs changes ?
refactoring / documenting is much easier for smaller projects then for large ones.
CCL was written while Vector worked with it. There is no equivalent for Library - GN only uses the PAD and is mostly unknown to new players.
CCL was written and re-written while the relevant of chunks of vanilla game code were being re-jigged all the jolly time. Library come out after the vanilla game code stabilised - the major improvements since then have not changed the game's javascript to any great degree from what I can ascertain, just adding a few more things in to tweak, and mostly to do with graphics.
Unless our developers decide to massively rejig things (seems very unlikely) in ways affecting Library, it should be safe.
It would be nice to see it used. So much of what it offers seems to add massively to Oolite - animations, star maps, use of the PAD, analysing the environment to decide whether to do something, allowing the use of codes et cetera.
I did try to give Vector a go on 1.77.1 - but am cack-handed and fluffed the opportunity to take the mission. But did get to try out some of Wildebloods old OXPs! I really need to get back to trying it out again, but am too distracted at present.
Personally I prefer OXPConfig to the Library version. I find it more immersive as it only appears outside the game. But I know have 40+ sets of settings on Library Config!
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
You should never need path info for image files inside OXP's. The only question is whether it should go in "Textures" or "Images". If the file will be used in a shader (which Library uses to display the avatar pics), it goes in Textures. If it will be used as a background or overlay, it goes in Images. And at that point, you just refer to it by the filename.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
If we ever get a 1.92 release on all platforms, I had plans to move Library Config to the F2 screen and accessed with a key combo like Ctrl-L.Cholmondely wrote: ↑Fri Jul 25, 2025 7:12 pmPersonally I prefer OXPConfig to the Library version. I find it more immersive as it only appears outside the game. But I know have 40+ sets of settings on Library Config!
There certainly no reason Library Config couldn't be moved to the F2 screen and accessed as OXPConfig was. Personally I don't like the method used, but if others prefer it I could look at making it an option. Inside Library Config, of course!

- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
One of the benefits of Library Config over OXPConfig is that Library Config doesn't need to be changed in any way to add new config choices, which I think was the major impediment for OXPConfig take up.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
Here you go: an OXP to move Library Config to the F2 Game Options screen. LibraryConfigOnF2.oxz
Edit: If anyone downloaded the first version, I'd suggest downloading it again. Fixed a bug in version 1.1
Edit: If anyone downloaded the first version, I'd suggest downloading it again. Fixed a bug in version 1.1
Re: Library
I was trying to add a custom avatar there and did expect to be able to use a file anywhere on my system by giving an absolute path.phkb wrote: ↑Sat Jul 26, 2025 1:12 amYou should never need path info for image files inside OXP's. The only question is whether it should go in "Textures" or "Images". If the file will be used in a shader (which Library uses to display the avatar pics), it goes in Textures. If it will be used as a background or overlay, it goes in Images. And at that point, you just refer to it by the filename.
This didn't work.
Extracting the oxz, adding my file to Textures , packing the whole bunch and overwriting the oxz in managedaddons did work,
(Using it as an unmanaged addon broke all managedaddons that need Library)
It seems the filename option in PAD > player data > avatar choice is not intended to allow users to ad personal avatar pics.
Maybe remove the option to avoid confusion ?
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
You will only be able to access files that have been physically included in an OXP. It doesn't have to be Library, though. I've added icons for Library that remain in other OXP's. The files just need to be inside an OXP, in the Textures folder.
You can have Library as an unmanaged addon. That's how I have it. OXP's that need Library won't know whether it's a managed add on or not. It just has to be one of the addons Oolite finds when starting up. As soon as all the addons are loaded (managed or unmanaged) they are all in the pool together. If something went wrong with Library while as an unmanaged addon (eg a script error prevented Library Config from loading), *that* would break all the addons that need it. But managed/unmanaged would make no difference.
It's a bit late tonight to do this, but tomorrow I'll dive into the player avatars code and see what I can uncover. I'm sure there's a way to add new ones.
- phkb
- Impressively Grand Sub-Admiral
- Posts: 5395
- Joined: Tue Jan 21, 2014 10:37 pm
- Location: Writing more OXPs, because the world needs more OXPs.
Re: Library
OK, here it is: PADCustomAvatars.oxp.zip. Download the attached file, and extract the OXP folder to your addons folder. Run Oolite, and there should be an additional image in the available options for player avatars. Code is pretty simple:
Hopefully that has all the info you need to make your own!
Code: Select all
this.startUpComplete = function() {
var lib = worldScripts.Lib_PAD;
lib.$config.defImages.push({t1:"my_avatar.png", s:3, g:0, a:[20,50]});
// t1 = "filename.png"
// should be in the "Textures" folder, images should be 128x128 pixels.
// s = species index
// 0 = bird, 1 = feline, 2 = frog, 3 = human, 4 = humanoid, 5 = insect, 6 = lizard, 7 = lobster, 8 = rodent
// g = gender index
// 0 = male, 1 = female, 2 = neutral, 3 = android
// a = age range [low, high]
// age will be a random number in the range low-high.
}
- Attachments
-
- PADCustomAvatars.oxp.zip
- (10.5 KiB) Downloaded 35 times
- Cholmondely
- Archivist
- Posts: 6417
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Library
I've just added these two new OXPs (LibraryConfigOnF2.oxz & PADCustomAvatars.oxp) as "ancillaries" on the
Library OXP wiki page.
![[EliteWiki]](/images/elitewikismall.png)
Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
- Cholmondely
- Archivist
- Posts: 6417
- Joined: Tue Jul 07, 2020 11:00 am
- Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
- Contact:
Re: Library
Heh!phkb wrote: ↑Sat Jul 26, 2025 2:16 amHere you go: an OXP to move Library Config to the F2 Game Options screen. LibraryConfigOnF2.oxz
Edit: If anyone downloaded the first version, I'd suggest downloading it again. Fixed a bug in version 1.1
Just to say, the Agonisingly Miserable AppleMac needs a semicolon after the bracket on line 13 in the manifest.plist

Comments wanted:
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
•Missing OXPs? What do you think is missing?
•Lore: The economics of ship building How many built for Aronar?
•Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Re: Library
Figured out why things broke when I moved Libary to Addons :
It seems only folders that end with .oxp are recognised as containg an oxp and my copy didn't have that.
Will check adding a custom oxp for my personal avatar soon.
It's not square, but resizing it to width 128 seems to be enough to make it work.
It seems only folders that end with .oxp are recognised as containg an oxp and my copy didn't have that.
Will check adding a custom oxp for my personal avatar soon.
It's not square, but resizing it to width 128 seems to be enough to make it work.
OS : Arch Linux 64-bit - rolling release
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active
From: The Netherlands, Europe
OXPs : My user page
(needs updating)
Retired, occasionally active