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

Shipyard monotony

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Shipyard monotony

Post by Old Murgh »

I find that the shipyard markets on stations are often dominated by just a few different ship-types for sale, but with great variation in terms of pre-installed equipment –as much as a page and a half of the same model can be available, and the feeling is that this suppresses a potential for variation in ships.

Does anyone know of some bit of code in the open that can be tweaked to say, limit any given model to one or two appearances?
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16073
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Shipyard monotony

Post by Cody »

Dumb pilot's suggestion: could a condition script be adapted?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Shipyard monotony

Post by Old Murgh »

Cody wrote: Mon Mar 28, 2022 8:22 pm
Dumb pilot's suggestion: could a condition script be adapted?
You may well be right, I hope it could be done with the world's smallest OXP. I just have no idea how to dictate such a restriction through the javascript engine. I have this feeling that it's either a very small matter or it can't be done, but no clue as to which.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
montana05
---- E L I T E ----
---- E L I T E ----
Posts: 1166
Joined: Mon May 30, 2016 3:54 am
Location: lurking in The Devils Triangle (G1)

Re: Shipyard monotony

Post by montana05 »

Old Murgh wrote: Mon Mar 28, 2022 10:35 pm
Cody wrote: Mon Mar 28, 2022 8:22 pm
Dumb pilot's suggestion: could a condition script be adapted?
You may well be right, I hope it could be done with the world's smallest OXP. I just have no idea how to dictate such a restriction through the javascript engine. I have this feeling that it's either a very small matter or it can't be done, but no clue as to which.
It probably could be done but, the first idea of mine, would require a modification of the shipyard or a lot of overrides.
Scars remind us where we've been. They don't have to dictate where we're going.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4740
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Shipyard monotony

Post by phkb »

montana05 wrote: Tue Mar 29, 2022 1:32 am
It probably could be done but, the first idea of mine, would require a modification of the shipyard or a lot of overrides.
Agreed. It can be done, as the shipyard is fully accessible to JS now, but it would require a considerable effort. The alternative is to create a large shipyard-overrides.plist file. The benefit here is that you could do it in stages, one ship type at a time, rather than doing some sort of global-every-oxp-ship sort of thing.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Shipyard monotony

Post by Old Murgh »

phkb wrote: Tue Mar 29, 2022 2:11 am
montana05 wrote: Tue Mar 29, 2022 1:32 am
It probably could be done but, the first idea of mine, would require a modification of the shipyard or a lot of overrides.
Agreed. It can be done, as the shipyard is fully accessible to JS now, but it would require a considerable effort. The alternative is to create a large shipyard-overrides.plist file. The benefit here is that you could do it in stages, one ship type at a time, rather than doing some sort of global-every-oxp-ship sort of thing.
Do you mean large as in it would require a copy/paste/adjust line per every potential ship, or the other kind of large?

So, a global offerShip equal or less than 2-script is more complicated..?
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cholmondely
Archivist
Archivist
Posts: 5115
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Shipyard monotony

Post by Cholmondely »

Does anybody know why this monotony prevails? One would presume that the ships appearing would be a random selection. Either the selection is not random, or else the selection of the popular models with widgets is so immense as to drown out everything else.

I've found that Maaarcooose's Odyssey is immensely popular in the shipyards when loaded, zillions appearing with lots of different ooptions.

On the other hand, Killer Wolf's Venom seems never to appear at all!

Shipyard.plists:

Code: Select all

{
	"u31_odyssey-player" =
	{
		chance = 1;
		"optional_equipment" =
		(
			"EQ_ECM",
			"EQ_FUEL_SCOOPS",
			"EQ_ESCAPE_POD",
			"EQ_ENERGY_BOMB",
			"EQ_ENERGY_UNIT",
			"EQ_NAVAL_ENERGY_UNIT",
			"EQ_DOCK_COMP",
			"EQ_WEAPON_PULSE_LASER",
			"EQ_WEAPON_BEAM_LASER",
			"EQ_WEAPON_MILITARY_LASER",
			"EQ_FUEL_INJECTION",
			"EQ_MULTI_TARGET",
			"EQ_SCANNER_SHOW_MISSILE_TARGET",
			"EQ_GAL_DRIVE",
			"EQ_ADVANCED_COMPASS",
			"EQ_SHIELD_BOOSTER",
			"EQ_NAVAL_SHIELD_BOOSTER",
			"EQ_HEAT_SHIELD"
		);
		price = 10000;
		"standard_equipment" =
		{
			extras =
			(
		"EQ_PASSENGER_BERTH",
			);
			"forward_weapon_type" = "EQ_WEAPON_PULSE_LASER";
			missiles = 3;
		};
		techlevel = 1;
		"weapon_facings" = 3;
	};
}

Code: Select all

{
/* Venom*/
	"venomplayer" = {
		"chance" = 1;
		"optional_equipment" = (
			"EQ_ECM",
			"EQ_ESCAPE_POD",
			"EQ_ENERGY_UNIT",
			"EQ_DOCK_COMP",
			"EQ_FUEL_INJECTION",
			"EQ_SCANNER_SHOW_MISSILE_TARGET",
		);
		price = 200500;
		standard_equipment = 
		{
			extras = 
				(
				"EQ_FUEL_SCOOPS",
				"EQ_HEAT_SHIELD"
				);
			forward_weapon_type = "EQ_WEAPON_BEAM_LASER";
			missiles = 1;
		};
		techlevel = 4;
		weapon_facings = 15;
	};
	

}
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?
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Shipyard monotony

Post by Old Murgh »

Cholmondely wrote: Tue Mar 29, 2022 2:14 pm
Does anybody know why..
In this case the ship has given itself a 1 (100% chance) of being included in a yard's selection. Most ships are in the .375 to .05 range and will get dominated out of the pickings.
[edit]
–But so has the other. Then I don''t understand that either.

But a nice script to reduce bullies to only one or two spots would be nice.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Cholmondely
Archivist
Archivist
Posts: 5115
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Shipyard monotony

Post by Cholmondely »

Old Murgh wrote: Tue Mar 29, 2022 4:43 pm
Cholmondely wrote: Tue Mar 29, 2022 2:14 pm
Does anybody know why..
In this case the ship has given itself a 1 (100% chance) of being included in a yard's selection. Most ships are in the .375 to .05 range and will get dominated out of the pickings.
[edit]
–But so has the other. Then I don''t understand that either.

But a nice script to reduce bullies to only one or two spots would be nice.
Umm... I changed the Venom percentage to make it appear. Maaarcooose's bizarre little ship was never quite finished, so I presume he left the percentage high to make it more available to himself. The ship seems to be unique in what I read about the original cartoon strip.

And the Venom finally appeared once I got rid of the Werewolf.oxp! Quite strange!!
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?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4740
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Shipyard monotony

Post by phkb »

Old Murgh wrote: Tue Mar 29, 2022 7:07 am
Do you mean large as in it would require a copy/paste/adjust line per every potential ship, or the other kind of large?
Yes, and yes. The shipyard-overrides file would have an entry per player ship, with whatever tweaks to the percentages and limits as you deem necessary. But it would also ultimately become quite large, given the number of OXP ships out there.

Additional thoughts: If the goal is to make the shipyard more interesting, in a guaranteed kind of way (ie, not relying too much on RNG), then you probably would just override all player ships with a "chance" of 1 (to make sure they are always available), but then have a condition script that kicks it to become the final arbiter of whether a ship appears or not.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4740
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Shipyard monotony

Post by phkb »

Old Murgh wrote: Tue Mar 29, 2022 7:07 am
So, a global offerShip equal or less than 2-script is more complicated..?
You would still need to use shipyard-overrides.plist to change the condition script of each and every player ship to get it to trigger. I don't believe the shipyard condition scripts can be engaged in a global way like you suggest.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Shipyard monotony

Post by Old Murgh »

phkb wrote: Tue Mar 29, 2022 8:47 pm
If the goal is to make the shipyard more interesting, in a guaranteed kind of way (ie, not relying too much on RNG), then you probably would just override all player ships with a "chance" of 1 (to make sure they are always available), but then have a condition script that kicks it to become the final arbiter of whether a ship appears or not.
I like the chance element, and think that some yards should be sparse, and others bountiful. It's only the way it currently gets dominated by a few mass-repeaters that' I'd like to have the power to change
phkb wrote: Tue Mar 29, 2022 8:51 pm
You would still need to use shipyard-overrides.plist to change the condition script of each and every player ship to get it to trigger. I don't believe the shipyard condition scripts can be engaged in a global way like you suggest.
I think I grasp the outline of what you're saying. The prospect of wrangling 30-40 ships isn't as daunting as 300-400.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
tsoj
Deadly
Deadly
Posts: 199
Joined: Wed May 18, 2016 8:19 pm
Location: Berlin
Contact:

Re: Shipyard monotony

Post by tsoj »

In Oolite 1.91 there is the possibility to edit the shipdata.plist of all loaded ships (and thus also edit the shipyard data):

Code: Select all

var shipdata = Ship.shipDataForKey("adder-player");
if(shipdata._oo_shipyard){
    shipdata._oo_shipyard.chance = 0.1;
}
Ship.setShipDataForKey("adder-player", shipdata);
This would set the chance (from originally 0.25) to 0.1.
To make this into a real OXP you could make up some rules, like ships that cost more than 1 000 000 have at most a chance of 0.1, all ships have at most a chance of 0.5 and at least a chance of 0.02, adding hard-coded chances for some ships, ... and then apply these rules to all ships, e.g.:

Code: Select all

this.startUp = function()
{
	var dataKeysArray = Ship.keys();
	for(let i in dataKeysArray)
	{
		let shipdata = Ship.shipDataForKey(dataKeysArray[i]);
		let newShipData = myRuleFunction(shipdata);
		Ship.setShipDataForKey(dataKeysArray[i], newShipData);		
	}
}
But again, this works only in the development version, because the function setShipDataForKey is quite new.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5115
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Shipyard monotony

Post by Cholmondely »

tsoj wrote: Tue Mar 29, 2022 11:27 pm
But again, this works only in the development version, because the function setShipDataForKey is quite new.
So not for Murgh's AppleMac or mine, then. Development version does exist (thanks, Hiran!) but is currently windows only...

Edited in light of a_c's post on the next page! Hurrah!
Last edited by Cholmondely on Wed Mar 30, 2022 8:33 am, edited 1 time in total.
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?
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 639
Joined: Sat Dec 04, 2021 11:01 pm

Re: Shipyard monotony

Post by Old Murgh »

tsoj wrote: Tue Mar 29, 2022 11:27 pm
In Oolite 1.91 there is the possibility to edit the shipdata.plist of all loaded ships (and thus also edit the shipyard data):
..
But again, this works only in the development version, because the function setShipDataForKey is quite new.
Cholmondely wrote: Wed Mar 30, 2022 1:08 am
So not for Murgh's AppleMac or mine, then. Development version does exist (thanks, Hiran!) but is currently windows only...
Yes this does look smart, but the future feels uncertain for us with a Mac.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
Post Reply