Page 19 of 29

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Thu Nov 05, 2020 1:44 pm
by Reval
I guess I'd have to advise potential downloaders that installing other ship-OXPs might screw with the FE Ships' availability, then. (If no other solutions are found).

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Thu Nov 05, 2020 1:48 pm
by montana05
Reval wrote: Thu Nov 05, 2020 1:44 pm
I guess I'd have to advise potential downloaders that installing other ship-OXPs might screw with the FE Ships' availability, then. (If no other solutions are found).
Well, there are 2 solutions, you offer only at the main station or you scan the system for all stations and update all of them, it could be done with a script.

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Thu Nov 05, 2020 1:49 pm
by Reval
No, I'd rather stick with the Main Station, as that's where every Jameson starts, correct?

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Thu Nov 05, 2020 2:38 pm
by dybal
Reval wrote: Thu Nov 05, 2020 1:49 pm
No, I'd rather stick with the Main Station, as that's where every Jameson starts, correct?
If you want to make sure just at Lave main station at the start of the game, I would advise this test before calling the function to insert the ship(s) in the shipyard at the event handlers I mentioned:

Code: Select all

if (galaxyNumber === 0 && system.ID === 7 && clock.seconds <= 180058007622 + <time window the ship should be available in seconds>) {
	//call the ship insertion code for the main station here
}
That would make sure the ships are available at Lave main station for a given time at the start of the game, and at other stations and times it would follow the normal availability rule in the core game.

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Thu Nov 05, 2020 2:40 pm
by Reval
Great. Muchisimas gracias :)

Edit: Oops, I mean muito obrigado :)

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 12:09 am
by Reval
montana05 wrote: Thu Nov 05, 2020 1:39 pm
However, for ships chance is rolling the dice for you already.
Yes, and from what I've learned today, it seems to be majorly flawed and essentially uncontrollable.

I mean, there doesn't seem to be any logic to it. Whatever values I plug in for chance results in completely unpredictable ship-stock (but I guess that was the purpose). But it would be nice to be able to see consistent changes at the shipyard as you vary the probability. But there's no rhyme or reason.

For example I'm seeing long lists of Pythons and Boas at Tionisla and my geckos, kraits, mambas, adders scarcely get a look in...

Of course, there's the TL to factor in too, so we're essentially juggling plates.

Edit: Maybe someone familiar with the game core could offer a hint or two as to the optimal range of probabilites that would bring one at least close to one's desired shipyard-inventory, and how that relates to the second variable (TL).

Edit2: I suppose what I'm getting at is that it is the distribution that is skewed. We should expect just one or two of the heavies (Boas, Pythons, Anacondas), a good spread of medium-class ships (Cobras, Asps, Morays, Vipers), and a just a sprinkling of smaller craft (Gecko, Krait, Mamba, Sidewinder, Adder), to get the bell-curve right, no?

PS. What PRNG does Oolite use? And is the output uniform or Gaussian?

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 1:33 am
by Reval
Going back to the Frontier-style OXP... I'm thinking that I shall probably need to alter the average commodity quantities to bring the market into line with the overall increased size of the FE Ships cargo holds. Probably a third OXP to handle that. Is there an override for the market entities?

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 4:30 am
by Reval
Update note: Now getting the right mix at Lave after setting chance to 0.5 on all the new ships. This is even without the startUp scripts suggested by montana05 and dybal. Offered were: 3 Adders, 2 Kraits, 1 Cobra Mk I, and 1 Sidewinder.

So am now in two minds as to whether I need the startUp scripts...

What I would like to do, however, is somehow override the game start options and have just Normal and Strict, but giving a clue in the text that the Cobby could profitably be sold. (and also to change the ship name - currently "Cobra Mark III" - in Normal, though of course keep it as a Cobra III).

Edit: Do I assume right that chance=0.5 is a simple heads-or-tails coin toss?

Edit2: If I implement the "must have Adder and Gecko" event handler scripts for Lave, will there also be the standard random selection of ships, as above? ie. will an Adder and Gecko be added to that list, or preclude everything else?

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 6:32 am
by another_commander
Reval wrote: Fri Nov 06, 2020 12:09 am
Yes, and from what I've learned today, it seems to be majorly flawed and essentially uncontrollable.

I mean, there doesn't seem to be any logic to it. Whatever values I plug in for chance results in completely unpredictable ship-stock (but I guess that was the purpose). But it would be nice to be able to see consistent changes at the shipyard as you vary the probability. But there's no rhyme or reason.

For example I'm seeing long lists of Pythons and Boas at Tionisla and my geckos, kraits, mambas, adders scarcely get a look in...

Of course, there's the TL to factor in too, so we're essentially juggling plates.

Edit: Maybe someone familiar with the game core could offer a hint or two as to the optimal range of probabilites that would bring one at least close to one's desired shipyard-inventory, and how that relates to the second variable (TL).

Edit2: I suppose what I'm getting at is that it is the distribution that is skewed. We should expect just one or two of the heavies (Boas, Pythons, Anacondas), a good spread of medium-class ships (Cobras, Asps, Morays, Vipers), and a just a sprinkling of smaller craft (Gecko, Krait, Mamba, Sidewinder, Adder), to get the bell-curve right, no?
chance is not broken, it works as designed. It is not a straightforward implementation though. This is the formula that calculates it:

Code: Select all

double chance = 1.0 - pow(1.0 - [ship_info oo_doubleForKey:KEY_CHANCE], MAX((OOTechLevelID)1, techlevel - ship_techlevel));
Translated into something more easily understandable:

Code: Select all

chance = 1.0 - pow(1.0 - chanceFromShipyardPlist, max(1, systemTechLevel - shipTechlevelFromShipyardPlist)
chance is also used when deciding what optional equipment gets put in the ship, so a chance of 1.0 will load the ship with all possible addons.

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 7:04 am
by Reval
Interesting. Correct me if I'm wrong, but I also notice that Oolite does not seem to randomize the seed on restarting (from the system clock or whatever). We get the same ship selection at Lave every time we start a Jameson. Is this stable for only the player's system, for the Oolite version, or is it permanent? I now see what dybal meant about implementing a dice-roll :)

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 7:33 am
by another_commander
Some things are fully random and some are pseudo-random. The pseudo-random ones are those based on the procedural generation routines we use and have to be so in order to generate the same predictable results every time. Planet textures for example are procedurally generated and always the same and we can't let them be fully random because this would make no sense. Shipyard chances are another such example. In other cases where we don't care about repeatability of results we are free to use truly random generation, e.g. selecting escorts for a trader NPC.

If you want more detail on the (pseudo)randomness in Oolite, have a go at this page: http://wiki.alioth.net/index.php/Random ... _generator
It is very informative, but some of the subjects discussed have become hardcoded in plists since then, like the planet properties.

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Fri Nov 06, 2020 7:44 am
by Reval
Oh cool. Thank you. I shall definitely do that (RNGs are one of my coding obsessions hehe).

BTW, if anyone fancies early, early, early Beta testing FE Ships and FE Ships Player, just shoot me a PM and I'll link you to a zip. I'm particularly keen to know how these little darlings handle in combat (as I don't do so much of that myself). Overall top speeds have been reduced, but not sure it matters since it's been done across the board. It is subject to change and normalization, of course, if enough users request it.

Provisionally, Forward, Aft, Port and Starboard views have been tied to weapons positions (it seemed the easiest way). Again, really don't know how that will affect combat...

The new flyable ships with FE specs are: Gecko, Krait, Mamba, Sidewinder, Viper, Viper 2.

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Sat Nov 07, 2020 6:46 am
by Reval
FE Ships v.0.1 Beta update: All views fixed and laser accuracy tuned to perfection.

Hit me with a PM if you'd like to test-fly the featherweights of the Ooniverse...

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Mon Nov 09, 2020 9:31 am
by Reval
I was wondering if someone could give me a quick example of how to use

Code: Select all

this.playerSoldCargo = function(commodity, units, price)
{
     // Your code here
}
I assume that commodity, units, price are _passed_ to the function by Oolite and can be referenced within it? Or are we expected to supply them ourselves?

(Oh, why is the Wiki so sparse and cryptic?)

Re: Tinkerer's Workshop - OXP tweaking for fun and profit!

Posted: Mon Nov 09, 2020 9:53 am
by montana05
Reval wrote: Mon Nov 09, 2020 9:31 am
I assume that commodity, units, price are _passed_ to the function by Oolite and can be referenced within it? Or are we expected to supply them ourselves?

(Oh, why is the Wiki so sparse and cryptic?)
Yes, this function will return commodity, units and price and therefore you can reference to them.