Page 2 of 9

Posted: Tue Dec 30, 2008 12:52 pm
by Commander McLane
Sorry, there are still some errors in the pricelist.

So I decided to settle it once and for all. As Oolite is transitioning to JS, it seemed appropriate to me to do it in JS as well. :wink: Here's what I (very crudely) wrote:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
var commodity_name = new Array("Food", "Textiles", "Radioactives", "Slaves", "Liquor\/Wines", "Luxuries", "Narcotics", "Computers", "Machinery", "Alloys", "Firearms", "Furs", "Minerals", "Gold", "Platinum", "Gem-Stones", "Alien Items");
var base_price = new Array(19, 20, 65, 40, 83, 196, 235, 154, 117, 78, 124, 176, 32, 97, 171, 45, 53);
var price_adjust = new Array(-2, -1, -3, -5, -5, 8, 29, 14, 6, 1, 13, -9, -1, -1, -2, -1, 15);
var price_mask = new Array(1, 3, 7, 31, 15, 3, 120, 3, 7, 31, 7, 63, 3, 7, 31, 15, 7);
var economy_string = new Array("Poor Agricultural", "Average Agricultural", "Rich Agricultural", "Mainly Agricultural", "Mainly Industrial", "Poor Industrial", "Average Industrial", "Rich Industrial");
var economy_number = new Array(7, 6, 5, 4, 3, 2, 1, 0);

function writeHead()
{
	document.write("<tr>");
	writeCell("<b>Commodity Name<\/b>");
	for(var i=0;i<=7;i++)
	{
		document.write('<td align="center" colspan="2" valign="middle"><b>');
		document.write(economy_string[i]);
		document.write("<\/b><\/td>");
	}
	document.write("<\/tr>");
}

function writeRows()
{
	document.write("<tr>");
	writeCell(commodity_name[i]);
	for(var j=0;j<=7;j++)
	{
		writeCell(Math.round(((base_price[i] + (0) + (economy_number[j] * price_adjust[i])) & 255) * 4) / 10);
		writeCell(Math.round(((base_price[i] + (price_mask[i]) + (economy_number[j] * price_adjust[i])) & 255) * 4) / 10);
	}
	document.write("<\/tr>");
}

function writeCell(Inhalt)
{
	document.write('<td align="center" valign="middle">');
	document.write(Inhalt);
	document.write("<\/td>");
}

document.write('<table border="3" cellpadding="1" cellspacing="1">');
document.write(writeHead());
for(var i=0;i<=16;i++)
	document.write(writeRows());
document.write("<\/table>");
// -->
</SCRIPT>

</HEAD>
<BODY>

</BODY>
</HTML>
Just put into a html-file and open with your browser of choice. Voilà, an exhaustive list of minimum and maximum prices of every commodity in any economy. And it is done with Oolite's own price calculation routine (as documented in the wiki).

If you take the highest and lowest value of every row, and calculate the average, you get this:

Code: Select all

Name          AVERAGE    MIN    MAX
Food              5.0    2.0    8.0
Textiles          7.2    5.2    9.2
Radioactives     23.2   17.6   28.8
Slaves           15.2    2.0   28.4
Liquor/Wines     29.2   19.2   39.2
Luxuries         90.2   78.4  102.0
Narcotics        51.0    0.4  101.6
Computers        81.8   61.6  102.0
Machinery        56.6   46.8   66.4
Alloys           38.8   31.2   46.4
Firearms         69.2   49.6   88.8
Furs             70.4   45.2   95.6
Minerals         12.0   10.0   14.0
Gold             38.8   36.0   41.6
Platinum         71.8   62.8   80.8
Gem-Stones       19.6   15.2   24.0
Alien Items      43.6   66.0   21.2
And this can be copied and pasted into the table in the Reference Sheet, just as it is.

Note that some of the average values are not actually possible as prices, because of the 0.4-credits steps used by the algorithm.

Note also the—often discussed—anomaly with Narcotics. Their price can roll over the 0.0-102.0 range, making it a little unpredictable. However, if you study the values given by the html-table, you will notice that they only roll over at both ends of the table: in Poor and Average Agriculturials, and in Rich Industrials. Apart from that they follow the Computers-pattern: cheap in high-end economies, expensive at the low end. Probably this is intended behaviour: After all drugs could be cultivated at some agricultures, so they would be cheap (I guess Afghanistan is a good place to get cheap drugs). And the demand could be out of the roof in some very developed worlds, so they would get expensive again.

According to the calculation formula the lowest and highest price actually calculated in-game are 0.4 cr and 101.6 cr respectively, so I've chosen these to calculate the average: 51 cr.

General note (should probably go on the sheet as well): these prices are the averages, mins and maxs which are available on Main Stations. Other stations (like Rock Hermits) can and do add a greater variety.

*****

Other issue: The ship specs table could get some reworking as well. Apart from the possible addition of more ships there are some obvious errors in it. The size of the BCC is particularly sticking out at first glance. But without cross-checking I wouldn't trust the rest of the infos as well.

Posted: Tue Dec 30, 2008 1:00 pm
by another_commander
It sounds pretty reasonable to add the prices as you have calculated them and I really did not like very much the empty cells for min and max values. So these will go in.

For the ships, it might be tricky. I only have the tables in image format, so applying extensive changes to them is out of the question. But I could probably make a few adjustments, if someone will be kind enough to point me to what exactly needs changing.

Posted: Tue Dec 30, 2008 1:47 pm
by Eric Walch
It are the same min, max, avg prices I calculated with a spreadsheet. But in this case I am not sure if the average of the old sheet is better. The calculated prices assume an even distribution of the economies in a galaxy.
Maybe they are, but when not you also have to consider the spread of economies for the avg calculation. Comparing the two lists I see that stuff that has a positive economic adjust has a higher avg in the old list while the stuff with a negative economic adjust has a lower avg in the old list. This suggest an uneven distribution when the old list was based on actual prices.

I think this table was made by someone (darkbee?) writing down real values and calculated its own avg in a system with relative more lower economies. And as the old and new don't differ to far, I would leave them as they are. It just looks strange to suddenly change the published average prices.

However on the min or max there is no discussion. They must be correct when using oolite base data.

Posted: Tue Dec 30, 2008 2:08 pm
by Commander McLane
I still would vote for a chance, because in reality players don't care for distribution of economies. It's the maximal profits on RichInd-PoorAgr milk runs which count for all practical purposes. And these are reflected in the arithmetical average between the highest and the lowest price.

And the player knows that in AverInd or AverAgr the prices are not as far from the average as in RichInd/PoorAgr. That's the basics of game mechanics.

Posted: Tue Dec 30, 2008 2:13 pm
by DaddyHoggy
Why are the mins and maxs for Luxuries, Computers, Machinery, Firearms and Alloys the wrong way round? Nobody else has mentioned it...

Posted: Tue Dec 30, 2008 2:55 pm
by Commander McLane
The most obvious reason of all: Stupidity on my side. I just copied the items from the left side of my table to the left column. As the items you mentioned get cheaper with rising economy, these happened to be the expensive ones. And then I didn't just swap them.

So you may well do it yourself. (Changing the post now.) :wink:

Posted: Tue Dec 30, 2008 5:35 pm
by Eric Walch
Commander McLane wrote:
I still would vote for a chance, because in reality players don't care for distribution of economies. It's the maximal profits on RichInd-PoorAgr milk runs which count for all practical purposes.
I took the trouble to do the calculation with the real economy distribution of galaxy 1. (Averaging over 256 minimum and 256 maximum prices) All results were within 1 credit difference of your values. Only narcotics differed 1.2 credits. So I would say yes to your list. The old one is probably a bad average made with a wrong station selection.

Posted: Tue Dec 30, 2008 9:25 pm
by Screet
Eric Walch wrote:
There are more keys but they are only interesting for debugging,
Is there a "debug keys" reference sheet? I'd like to have one...the shift-h I read about recently is a very nice thing to know...

Screet

Posted: Tue Dec 30, 2008 11:17 pm
by Svengali
Screet wrote:
Is there a "debug keys" reference sheet? I'd like to have one...the shift-h I read about recently is a very nice thing to know...
http://wiki.alioth.net/index.php/Oolite ... d_Controls

Posted: Wed Dec 31, 2008 2:41 pm
by JensAyton
Svengali wrote:
Maybe a hint that this key-table is referring to US-keycode(?) would make sense. New players don't know it and will be confused if a key is not working on their computer.
A problem with this is that it’s not consistently true: for Mac OS X, the keys are bound by character value, for other platforms they’re bound by key code (i.e. position on the keyboard).

Posted: Wed Dec 31, 2008 3:11 pm
by Svengali
Welcome back, Ahruman. Hope your holiday was nice.

Posted: Wed Dec 31, 2008 5:17 pm
by another_commander
One more update has been uploaded to the usual link. Added Commander McLane's prices in the commodity lists and CmL himself in the "Compiled by" section of the list for his help with said prices.

Posted: Sun Jan 04, 2009 3:46 pm
by Commander McLane
another_commander wrote:
One more update has been uploaded to the usual link. Added Commander McLane's prices in the commodity lists and CmL himself in the "Compiled by" section of the list for his help with said prices.
:lol:

But sad that the wiki is down again...

Posted: Tue Jan 13, 2009 8:24 pm
by Eric Walch
I think the list has another fault. All the tech levels are minimum levels equipment can be bought at. However, the equipment can only be bought at this levels in about 10% of the time. To have a level were it is always available the levels in the table must be raised by 1.

I think it should give the level were it is always available and let the player find for themselves that it is sometimes available at one level lower.
I just thought about this when I wanted a Galactic Hyperdrive at a level 10 system: it was not available today.

Posted: Wed Jan 14, 2009 7:28 am
by Commander McLane
Eric Walch wrote:
However, the equipment can only be bought at this levels in about 10% of the time.
Didn't know that!

Still every day there is something new to learn... :D

Thanks, Eric!