var adjust = market[commodity].marketEcoAdjustPrice * multiplier * quantity / market[commodity].marketMaskPrice;
But in Oolite 1.81 and following, market[commodity].marketEcoAdjustPrice and market[commodity].marketMaskPrice don't exist any more. Is marketEcoAdjustPrice equivalent to price_economic? I have no idea if marketMaskPrice maps directly to something or not.
var adjust = market[commodity].marketEcoAdjustPrice * multiplier * quantity / market[commodity].marketMaskPrice;
But in Oolite 1.81 and following, market[commodity].marketEcoAdjustPrice and market[commodity].marketMaskPrice don't exist any more. Is marketEcoAdjustPrice equivalent to price_economic? I have no idea if marketMaskPrice maps directly to something or not.
Any suggestions on what this calc should be?
Just in case someone wants to see the line in context, it is visible here.
Unfortunately I have no clue about it's semantics.
var adjust = market[commodity].marketEcoAdjustPrice * multiplier * quantity / market[commodity].marketMaskPrice;
But in Oolite 1.81 and following, market[commodity].marketEcoAdjustPrice and market[commodity].marketMaskPrice don't exist any more. Is marketEcoAdjustPrice equivalent to price_economic? I have no idea if marketMaskPrice maps directly to something or not.
Any suggestions on what this calc should be?
How much do NPCs know about how good their goods sell here?
Probably the closest way to what we have now will be something like this:
var exDiff = Math.abs(system.info.economy - market[commodity].peak_export) * 2;
var imDiff = Math.abs(system.info.economy - market[commodity].peak_import) * 2;
var distance = (exDiff + imDiff) / 2;
// If closer to the importer, the commodity probably is profitable here
var multiplier = exDiff > imDiff? 1 : -1;
var adjust = market[commodity].price_economic * multiplier * quantity;
In the code I suggested, they just look if the economy is closer to the importer (similar to like now they just look at which half of economics they are in) and assume that they will get either maximal or minimal price here.
But if NPCs can estimate the expected profit/loss more accurately to the system's economy, then instead multiplier here should be bias. Note that for price calculation, bias is used with the minus in the game code.