Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

A few questions about OXPs and modding

General discussion for players of Oolite.

Moderators: another_commander, winston

jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

A few questions about OXPs and modding

Post by jackiebean »

I have been taking a break recently to do other things IRL, and i had a few ideas and questions related to altering OXPs, creating new ones, and also how to make one in particular compatible with the current version of OOlite.

First, i would be interested in knowing how one would go about making a new ambient OXP similar to the radio stations OXPs, but one that changes music according to system type, encounters, or even if one was to run along the fringes of a system in say pirate or desolate territory? Can menus have their own music? say for instance the main menu (OXP manager and ship gallery) and also once landed on a station (considering different music for different stations or even according to faction) The reason i was wondering is i found about 6 hours or more of CC attribution music i would love to place in an OXP. Most are ambient, but some would fit a menu much better. I tend to like Sci fi type synth music, so these are a pretty good fit for OOlite. Cinematic even. Free for non commercial creative commons.

The second question refers to altering an existing OXP to replace all models with the existing Griff models and just change the textures to match the OXP textures as closely as possible so there is a difference between stock ships and OXP ships but continuity of some sort.

The third question is how would one go about making the Staer9 shipset compatible with the current version of OOlite, and why would it be incompatible? It is a shame they are not. They used to work and now they are not available.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6557
Joined: Wed Feb 28, 2007 7:54 am

Re: A few questions about OXPs and modding

Post by another_commander »

Event driven music: You may want to check out this thread by Svengali - he has already done what you are looking for (and it is amazing by the way). Look for the Orchestral Demo oxp.

Changing existing OXPs: I would guess it depends on the OXP's license. See under what terms the author(s) have released it and then you can take it from there. Most OXPs are released via some form of the Creative Commns license, which normally allows modifications, provided that credit is given to the original authors. But make sure to check anyway, because not all are released under the same license.

Staer9's models: Are you sure it doesn't work? I just downloaded it from the OXP Manager and it seems to be perfectly fine on the latest nightly. What problems are you seeing?
jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

Re: A few questions about OXPs and modding

Post by jackiebean »

another_commander wrote: Wed Mar 08, 2017 4:21 pm
Event driven music: You may want to check out this thread by Svengali - he has already done what you are looking for (and it is amazing by the way). Look for the Orchestral Demo oxp.

Changing existing OXPs: I would guess it depends on the OXP's license. See under what terms the author(s) have released it and then you can take it from there. Most OXPs are released via some form of the Creative Commns license, which normally allows modifications, provided that credit is given to the original authors. But make sure to check anyway, because not all are released under the same license.

Staer9's models: Are you sure it doesn't work? I just downloaded it from the OXP Manager and it seems to be perfectly fine on the latest nightly. What problems are you seeing?
Not using nightly build, but the manager on my install says it is not compatible. Perhaps i can try manually deleting it and then attempting a reinstall from the manager? EDIT: nope, still greyed out and refuses to install.

Aware of the Svengali OXP but i was more interested in the particulars since i am not familiar with scripting and what controls what. I will check the thread out and see if there is any tutorials on how to build a companion OXP.

Definitely will look over the licenses for respective OXP/OXZs. Most so far are CC attribution but there may be some with stipulations. But what i was referring to was: is it possible to combine elements of one OXP with those of another. Say for instance i wanted to replace all models in an older OXP with ships from the default OOlite (like griffs models) or add a few from a comparable shipset to fill out the rest with the only difference being textures would be new to emulate the color scheme of the older models. How difficult would that be? would it be as easy as renaming the models and textures to match the names in the OXP and overwriting them? or would there need to be some scripting hacks?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6557
Joined: Wed Feb 28, 2007 7:54 am

Re: A few questions about OXPs and modding

Post by another_commander »

jackiebean wrote: Thu Mar 09, 2017 12:40 pm
Not using nightly build, but the manager on my install says it is not compatible. Perhaps i can try manually deleting it and then attempting a reinstall from the manager? EDIT: nope, still greyed out and refuses to install.
What version of the OXP is the Manager giving you? I see a ready to install version 1.4.1 of Staer9's Shipset on my 1.84 install.
Aware of the Svengali OXP but i was more interested in the particulars since i am not familiar with scripting and what controls what. I will check the thread out and see if there is any tutorials on how to build a companion OXP.
I don't think there is any way to do this that does not involve scripting. Do have a look at the scripts in Svengali's work, as he has created a library containing methods for simplifying the task as much as possible.
jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

Re: A few questions about OXPs and modding

Post by jackiebean »

I'm sure there has to be scripting involved for most OXPs but i would like to learn about it, not avoid it lol.

The Staer9 shipset is the same version you are talking about, but greyed out. I tried everything, removing manually, wont work, putting it back and uninstalling from the manager wont work either, it uninstalls but remains greyed out. Must be some holdover in the plists or something that i am not aware of that refuses to let me install the OXP.

Short of erasing the game and starting over i have no clue what to do.
User avatar
spara
---- E L I T E ----
---- E L I T E ----
Posts: 2676
Joined: Wed Aug 15, 2012 4:19 am
Location: Finland

Re: A few questions about OXPs and modding

Post by spara »

Shadered or non-shadered package?
jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

Re: A few questions about OXPs and modding

Post by jackiebean »

it did not say which one, but i assume it was the shadered package. It used to be installed before the upgrade to the new version, but now it will not install no matter what method is used. I only install shader versions. That is why i was wondering about a bug in the plist files or something that wont reset or overwrite to refresh things. if 1.4.1 is supposed to work in OOlite 1.82, then something in the game files is buggered up and i have no idea where to look.

Like i said i may have to uninstall OOlite and reinstall everything from scratch.

Edit: Ok, i think i know what the issue is, there seems to be a discrepancy between the latest version on the OOlite download page and what is available via Synaptic package manager, which could probably be alleviated if there was a way to add a PPA to Synaptic for the latest stable build. That is why Staer9 shipset will not work (more than likely) and my first install was with the more recent build, what confused me was the older build available in Synaptic when i had to reinstall linux a few months ago, which i thought was the same one, but obviously the version number is different. I wonder why it takes so long for them to push updates in the official repositories? So in short, yes i have to reinstall with the dreaded tar.gz method (ugh).

Well the reinstall worked, however the performance of the run version of the install is not as good as the official repository was (not sure why or if there are some config files i can alter to make it better, or if my computer just cant handle it any more, it is getting worn out)

But in the bigger picture, relating to the event driven music, is there an OXP i can examine that uses this extensively or does that not exist yet? I have looked at the wiki entry which goes into it a bit, but it would probably be better to see an actual js file that is complete in that regard and covers all the possible events entries and a corresponding plist file to make sure i do things correctly in the future. Any pointers? So far examining the companion OXPs to the Svengali BGS reveals that there is not really that much event driven music at all, and more of the packs lean toward the playlist approach using the radio instead. I kind of want to ditch the radio playlist and go with the event trigger method (since i have a huge enough CC music selection to do that)

Also I'm still concerned about an idea i would like to learn more about (posted above):
Is it possible to combine elements of one OXP with those of another? Say for instance i wanted to replace all models in an older OXP with ships from the default OOlite (like griffs models) or add a few from a comparable shipset to fill out the rest with the only difference being textures would be new to emulate the color scheme of the older models. How difficult would that be? would it be as easy as renaming the models and textures to match the names in the OXP and overwriting them? or would there need to be some scripting hacks?
User avatar
Stormrider
Deadly
Deadly
Posts: 241
Joined: Sat Jan 25, 2014 2:35 am
Location: At work

Re: A few questions about OXPs and modding

Post by Stormrider »

jackiebean wrote:
Say for instance i wanted to replace all models in an older OXP with ships from the default OOlite (like griffs models) or add a few from a comparable shipset to fill out the rest with the only difference being textures would be new to emulate the color scheme of the older models.
Unless the texture map for the old model is identical to the new model textures this probably won't work, but you can change the color scheme of Griffs models with shader code and you can add custom decals if there are any logos that you would like to add.

Check out the link to the tutorial at the bottom of this page.
http://wiki.alioth.net/index.php/User:S ... _in_Oolite

Have a look at this for more info on decal shader code
https://bb.oolite.space/viewtopic.php?f= ... =60#p42090

[EliteWiki] Station Ads uses the setMaterial code.

I was able to set the color by manipulating the shipdata;plist for one of Griff's ships, I changed:

Code: Select all

PaintColor1 ={type = "randomUnitVector"; scale = 0.8;}
to

Code: Select all

PaintColor1 = { type = vector; value = "0.24 0.0 0.76"; };
The values are red, green, and blue. Not all colors seem to apply very well.

jackiebean wrote:
But in the bigger picture, relating to the event driven music, is there an OXP i can examine that uses this extensively or does that not exist yet?
Yes, in fact, there is one that does exactly that, download the:
Lib_Music_Orchestral+Demo.oxp
  • Extract it, rename it so it ends with .oxp and place it in your home/.Oolite/AddOns directory.
  • Place your desired .ogg sound files in the Music folder in the Demo.oxp. Vorbis is the supported sound format, I use vlc to convert them.
  • Now use xedit or similar text editor to edit the script.js file in the Config folder, you may replace the .ogg filenames with yours.
Changing

Code: Select all

		docked:{
			any:[{snd:"lib_orch_aegis_enter04.ogg",dur:109}]
to

Code: Select all

		docked:{
			any:[{snd:"mycustomsong.ogg",dur:109}]
will result in mycustomsong.ogg being plated at any station you are docked at as long as mycustomsong.ogg is in the music folder.

Make sure you push shift until you see the spinning cobra to reload cache when starting Oolite for testing oxps.
Here is my script so far:

Code: Select all

(function(){
"use strict";
this.name = "Lib_Music_Orchestral_Demo";
this.author = "Svengali";
this.copyright = "(C)2016, License:CC-by-nc-sa-4.0";
this.description = "Small demo for Lib_Music.";
this.version = "0.6";



this.startUpComplete = function(){
	delete this.startUpComplete;
	// Add event music
	var r = this.name;
	worldScripts.Lib_Music._addEventMusic({
		aegis:{
			enter:[{snd:"fandanguillo.ogg",dur:99}]
		},
		alert:{
			red:[{snd:"Schism.ogg",dur:407},
			      {snd:"ThingThatShouldNotBe.ogg",dur:397},
			      {snd:"orion.ogg",dur:508}]
		},
		docked:{
			any:[{snd:"Altiplanos.ogg",dur:158},
			      {snd:"allegrosolemne.ogg",dur:183},
			      {snd:"lamuerte.ogg",dur:231},
			      [snd:"fandanguillo.ogg",dur:99},
			      {snd:"Schism.ogg",dur:407},
			      {snd:"Lateralus.ogg",dur:564},
			      {snd:"orion.ogg",dur:508},
			      {snd:"Sanitarium.ogg",dur:387},
			      {snd:"GuerrillaRadio.ogg",dur:234},
			      {snd:"bluegrass01.ogg",dur:435},
			      {snd:"ymsbNoExpectations.ogg",dur:592},
			      {snd:"ymsbAngel.ogg",dur:122},
			      {snd:"ymsbfollowmedowntotheriverside.ogg",dur:725},
			      {snd:"bluegrass02.ogg",dur:435},
			      {snd:"allegrosolemne.ogg",dur:183}]
		},
		exitWS:{
			inter:[{snd:"fandanguillo.ogg",dur:99}],
			standard:[{snd:"ymsb_followmedowntotheriverside.ogg",dur:725},
				     {snd:"bluegrass02.ogg",dur:435}]
		},
		killed:{
			any:[{snd:"orion.ogg",dur:508}]
		},
		launch:{
			any:[{snd:"EonBlueApocalypse.ogg",dur:64},
			      {snd:"etude.ogg",dur:183}]
		},
		planetIn:{
			enterMain:[{snd:"allegrosolemne.ogg",dur:183}],
			enterSun:[{snd:"lamuerte.ogg",dur:231}]
		},
		rescued:{
			any:[{snd:"farewell.ogg",dur:183}]
		}
	},r);
	worldScripts.Lib_Music._toggleGroup(r); // Turn them on

	// Playlist music
	worldScripts.Lib_Music._addChannel({name:"docking",sounds:[
		{snd:"milonga.ogg",dur:322}
	]});
	worldScripts.Lib_Music._addChannel({name:"fight",sounds:[
		{snd:"orion.ogg",dur:508}
	]});
	worldScripts.Lib_Music._addChannel({name:"generic",sounds:[
		{snd:"allegrosolemne.ogg",dur:183},
		{snd:"lamuerte.ogg",dur:231},
		{snd:"milonga.ogg",dur:322},
		{snd:"Altiplanos.ogg",dur:158},
		{snd:"fandanguillo.ogg",dur:99},
		{snd:"Schism.ogg",dur:407},
		{snd:"Lateralus.ogg",dur:564},
		{snd:"orion.ogg",dur:508},
		{snd:"Sanitarium.ogg",dur:387},
		{snd:"GuerrillaRadio.ogg",dur:234},
		{snd:"bluegrass02.ogg",dur:435},
		{snd:"ymsbNoExpectations.ogg",dur:592},
		{snd:"ymsbAngel.ogg",dur:122},
		{snd:"ymsbfollowmedowntotheriverside.ogg",dur:725},
		{snd:"etude.ogg",dur:183}
	]});
	// Specific station music
	worldScripts.Lib_Music._addChannel({name:"Rock Hermit",sounds:[
		{snd:"fandanguillo.ogg",dur:99}
	]});
};
}).call(this);

Its described as "Unified event driven and generic music handling" and it seems to work really well,.

More you might want to look at on this page:
[EliteWiki] Customsounds
Welcome to the darkside commander, have some cookies.
jackiebean wrote:
Edit: Ok, i think i know what the issue is, there seems to be a discrepancy between the latest version on the OOlite download page and what is available via Synaptic package manager, which could probably be alleviated if there was a way to add a PPA to Synaptic for the latest stable build. That is why Staer9 shipset will not work (more than likely) and my first install was with the more recent build, what confused me was the older build available in Synaptic when i had to reinstall linux a few months ago, which i thought was the same one, but obviously the version number is different. I wonder why it takes so long for them to push updates in the official repositories? So in short, yes i have to reinstall with the dreaded tar.gz method (ugh).
Dreaded? What exactly do you have against tar.gz? I feel this does a great disservice to the developers of independent software. Just because it hasn't be recognized by the repository maintainers doesn't mean its bad, in fact I don't believe everything in the repository is all that good. Much of it is pretty good but some of it is awful.
I don't know if maintaining a PPA makes much sense for the stable release which seems to be released on a yearly schedule. It might make sense for the nightly, but to be honest, I wouldn't use one for that either as I like to update it on my own schedule. Its great that Oolite is available in synaptic but the repository maintainers don't have time to compile every package available to the latest version and Debian/Ubuntu focus specifically on stability. This, unfortunately, leads to most software available from synaptic being a few versions behind what might be currently available even though the latest version may actually be more stable.
jackiebean wrote:
Well the reinstall worked, however the performance of the run version of the install is not as good as the official repository was
I can honestly say I have never noticed anything like this. What kind of performance issues are you experiencing?
Image
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6557
Joined: Wed Feb 28, 2007 7:54 am

Re: A few questions about OXPs and modding

Post by another_commander »

Just wanted to add a quick comment regarding the "dreaded" tar.gz version. There is a reason why we distribute Oolite from the official website in this format. This reason is universal compatibility amongst distros. Keep in mind that the dev team for Oolite is really small and has almost never been more than three or maximum four people active at any given time. We cannot take care of every single Limux distro out there and its particularities, because there are hundreds of distros and new ones are created all the time. To make things even worse, some distros are rolling releases, which means that they use whatever library version is out at the time. That's not nomrally a problem, but Oolite uses a bunch of supporting libraries to run, so in this case it could be. And just to make things even more fun, various distros have their own package formats and rules for distribution. Trying to keep up with all this would mean that we would never have time for the game and we would be spending all our effort in trying to remain compatible with everything, which is an exercise in futility.

So we distribute Oolite on Linux with a selected set of libraries, which we have tested enough to be sure that they work. These libraries are set in such a way so that they do not interfere at all with whatever versions of the same libraries might be installed on the system itself. When Oolite runs on Linux, it creates its own isolated library ecosystem and doesn't touch anything from the system itself. That's why the dreaded tar.gz works in all distros and we get to keep our sanity. If we get a report that something doesn't work, we can be sure that it's most likely in the game code itself and concentrate on fixing that, rather than trying to troubleshoot the supporting libraries. During the years, this method has been proven to work greatly and I would fully recommend using the dreaded tar.gz over any distro repository-specific version.
jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

Re: A few questions about OXPs and modding

Post by jackiebean »

Actually i found that OOlite was a real breeze to install using the tar.gz method, which was a relief compared to other linux games that often times are not as well planned out. So kudos for including those libraries that work in their own segregated install, that is how it should be done.

Now to get back on topic, has anyone got any pointers for ensuring that the scripting is correct for making oxps? is there any example oxps i could copy for what i mentioned above?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4656
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: A few questions about OXPs and modding

Post by phkb »

jackiebean wrote:
has anyone got any pointers for ensuring that the scripting is correct for making oxps? is there any example oxps i could copy for what i mentioned above?
Stormrider's post above covered a lot of what you asked for, at least it seems so to me. He covered off how to manipulate Griff's ships, which are all released under CC so I believe you are fine to copy them to another OXP if you want. I did something similar with my reworked "Dictators" OXP, although I copied the core ship models, rather than Griff's. Svengali's Orchestral Demo shows how you can assign music to different in game events. BGS puts sound effects on different function screens, so you should be able to dive into both those OXP's to get what you want. However, I believe the Orchestral Demo is the only OXP so far that does this sort of thing. So if you want a sample OXP I'm afraid it's either that one or starting from scratch.

Of the items you've raised, which ones do you still need help with?
jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

Re: A few questions about OXPs and modding

Post by jackiebean »

I think you covered all the bases, thanks for clarifying things. I will peek into the orchestral demo instead of the others, since i had not looked there yet. And i am glad griff has a good set of resources to reference. I just downloaded his OBJ format models the other day and noticed he has a lot fo them hogged out, so i will be looking at those in more detail to see what other tricks he applied. Usually i like one piece models, even most of those i have built recently are one solid mesh, (except stations or dockables) but i have noticed a lot of the modders like to make multiple part ships (for damage maybe? or so it is in pieces when you win the fight?) not sure, but most of the ones that are pieces are modular and some im not sure why other than it was a challenge.

i guess the only other thing i would want to know that is new is has someone already applied scripted damage textures? i think in griffs ships he has the alloy texture for that? not sure yet. it would be cool to find out that has been done.

Edit: @ stormrider, i didn't mean any harm by worrying about the tar.gz release, it was just my experience very recently and in the past that they are usually not as well thought out or packaged as the OOlite ones are. This was a welcome relief. I missed your post and didn't see it at first. The performance issues i have are hardware related since this Laptop is either in bad need of replacement or a good professional cleaning and getting the CPU re-pasted. I would do it myself but i have no love for tearing apart laptops and doing repairs, which is why i have an external monitor. Thats my fault for not building my own desktop again, so no worries. I guess i will just have to model for now and try to do what i can with OXP building.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: A few questions about OXPs and modding

Post by Smivs »

jackiebean wrote: Tue Mar 14, 2017 2:00 am
... has someone already applied scripted damage textures?
Yes, I did this a few years ago with my old Smivs'Shipset, the forerunner to The Classic Ships, and also used it in other OXPs of the time.
They showed damaged textures when the hull took damage (low energy) and went derelict (progressively shut down/switched off lights) if an escape pod was launched.
The 'going derelict' feature was carried over into The Classic Ships as it works really well and adds a lot to realism, but the damaged textures were abandoned. Although they worked well and were quite effective, it never really fulfilled its promise due to limitations in the game, mainly the inability to identify where on the hull a ship was being hit. In practice you could shoot the ship in one place but the damage appeared in a different place depending on the texture used. It is not possible to improve on this without NPCs having separate front and rear shields (at least) and the ability to select a damaged texture appropriate to the location of the hits.

Edited to add images:-

A pirate Cobra III frm Smivs'Shipset taking laser fire and showing scoring and damage.

Image

This shot had to be staged to get the laser aligned with the damage for dramatic effect. In reality it never really looked this convincing.
This shot of the Annihilator taking a hit is worth re-posting as well, because it is pretty awesome :)

Image
Last edited by Smivs on Tue Mar 14, 2017 8:13 am, edited 1 time in total.
Commander Smivs, the friendliest Gourd this side of Riedquat.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6557
Joined: Wed Feb 28, 2007 7:54 am

Re: A few questions about OXPs and modding

Post by another_commander »

If you want another example, check out Griff's Griffin MkI. It utilizes modifiable hull textures based on ship maintenance level. The more the ship gets wear and tear the more it looks corroded. You can apply the same techniques used there to simulate damage textures, but it requires shaders to be enabled.
jackiebean
Dangerous
Dangerous
Posts: 112
Joined: Wed Jan 18, 2017 2:01 pm

Re: A few questions about OXPs and modding

Post by jackiebean »

i figured there would be limitations like the ones mentioned, and i examined griffs griffin noting the possible connection back a while, cool to know it is possible. I wonder if breaking the hull up into sections could get it to behave closer to some of the racing games that show damage to a car? If it is not practical then maybe it would be best to let it be. Cool photos BTW.
Post Reply