OoliteProject/oolite — pull request #109 by cim-- (2014-08-25 20:57:44+00:00)
Title: Non hard-coded commodities

This is probably ready for a bit of testing in a branch.

## Features:

- Looks pretty much like 1.80 without OXPs (a few quantities and prices are slightly different because the new algorithm can't deliberately use overflow)
- prices not restricted to multiples of 0.4 up to 102.0
- per-station and per-trade good buy/sell limits
- secondary stations can optionally mark smugglers as offenders
- import and export legality can be changed by OXP either generally or per-station for each good
- able to add extra goods by OXP (F8 now scrollable if necessary)
- best import/export prices no longer only at RI/PA pairs for OXP goods

Loads 1.80 savegames fine as far as I can tell, though doesn't produce savegames that 1.80 will read properly.

## Still to do

- trade-good scripts for more customisable setting of quantity, price, legality, etc.
- probably need some sorting / filtering capabilities for the F8 screen to keep it usable with 50, 60, etc OXP trade goods.
- 1.80 populator actually adds three subtly different types of rock hermit (varied "allegiance" property). Giving these slightly different markets might be interesting.
- price/quantity algorithm may need a little bit of fine-tuning.

## OXP compatibility:

Fairly bad, at the moment. How much of this matters will need some discussion.

- Old stations will get a default "no trade" market rather than attempting to parse `commodities.plist`
- OXPs which change `illegal-goods.plist` will find that no longer works. That's only New Cargoes, so far as I know, and anyway, the documentation did warn against doing that.
- OXPs expecting a fixed commodity list are probably okay in that the names haven't changed - but the non-canonical names (e.g. `liquorWines` rather than `liquor_wines`) aren't supported
- JS commodity properties from the old pricing algorithm no longer exist
- Cargo contracts should survive the transition, though the JS side of that script needed some updating.
- Currently no way to do `system.info.market = "...";` to completely change the commodity prices from standard. (Nova uses this but doesn't actually need to with these changes)
- Uses new properties and plists, rather than changing meaning of existing ones, so a single OXP which defines the correct properties for both this and 1.80 is possible.