Ore price
Analysis of the K240 save game file reveals a section that stores ore price data. Data is stored for 10 ores, and each ore has three longs and two words, of which the last word is padding (zero). The significance of each field is conjectured, rather than derived from analysis of disassembly.
Datatype | Description (best guess) |
---|---|
Long | Current price |
Long | Minimum price |
Long | Increment |
Word | Initial fluctuations |
Word | Padding (zero) |
Current price | Minimum price | Increment | Initial fluctuation | Ore name |
---|---|---|---|---|
50 | 20 | 5 | 20 | Selenium |
80 | 30 | 5 | 14 | Asteros |
150 | 100 | 5 | 20 | Barium |
400 | 200 | 10 | 60 | Crystalite |
1200 | 1000 | 5 | 100 | Quazinc |
1300 | 1000 | 5 | 200 | Bytanium |
2300 | 2000 | 10 | 150 | Korellium |
3500 | 3000 | 10 | 200 | Dragonium |
50000 | 50000 | 400 | 250 | Traxium |
150000 | 100000 | 1600 | 250 | Nexos |
Comparison of the game executable with save games suggests that the first field is variable, while the other fields are constant. The second field is thought to be base price or minimum price, as the ore value has never been observed to drop below this value. The third is the step which the price increases or decreases by, as in all save games the current price minus the minimum price is divisible by the value in the third column. As the default price stored in the game doesn't follow this rule, it is probably ignored by the game. It is not specified what causes an increment, although it's probably time-based.
The fourth column is likely the number of price fluctuations applied applied to the minimum price at the start of the game to calculate the starting ore price. The beginning of one game had ore prices at the following number of increments above minimum: Selenium 11, Asteros 4, Barium 18, Crystalite 52, Quazinc 15, Bytanium 78, Korellium 36, Dragonium 26, Traxium 147, Nexos 121. It seems reasonable that this sets initial ore prices.
20 bytes follow the ore price data structure, which may be ten words, and appear in the game executable as follows: 001e 0001 000f 0009 001b 0005 0002 0007 001a 0019. Assuming these refer to the ten ores in order, the values would be as follows:
?? (hex) | ?? (binary) | Ore |
---|---|---|
1 | 00001 | Asteros |
2 | 00010 | Korellium |
5 | 00101 | Bytanium |
7 | 00111 | Dragonium |
9 | 01001 | Crystalite |
15 | 01111 | Barium |
25 | 11001 | Nexos |
26 | 11010 | Traxium |
27 | 11011 | Quazinc |
30 | 11110 | Selenium |