Posted: Tue Dec 30, 2008 12:52 pm
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. Here's what I (very crudely) wrote:
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:
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.
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. 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>
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
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.