Page 3 of 18

Re: [WIP] New Cargoes OXP (0.4.0 released 25 Feb 2012)

Posted: Sat Mar 03, 2012 1:05 am
by CommonSenseOTB
Smivs wrote:
pagroove wrote:
Yesterday I bought Goatsoup at 20 cr a TC :shock: . Turned out this was an incredible bad deal.
Maybe you would have done beter with Killer Goat Ice-cream 8)
Image
pagroove wrote:
:lol: :lol: :lol:
You creative pumpkin :)
Wait, I thought Smivs was a berry or something, those are much better in ice cream. :P

Re: [WIP] New Cargoes OXP (0.4.0 released 25 Feb 2012)

Posted: Sat Mar 03, 2012 2:42 pm
by JazHaz
I've only tried this at about three planets so far, but each time I try, the Trading Floor is deserted.

I have bought the Trader Net equipment, but not sure what that does.

Re: [WIP] New Cargoes OXP (0.4.0 released 25 Feb 2012)

Posted: Sat Mar 03, 2012 3:19 pm
by cim
JazHaz wrote:
I've only tried this at about three planets so far, but each time I try, the Trading Floor is deserted.

I have bought the Trader Net equipment, but not sure what that does.
The TraderNet subscription (assuming you have Snoopers OXP; it's useless without it) will give you little news bulletins every now and then for the next 30 days about new trading opportunities. It doesn't affect the trading floor directly, but it might give you hints as to where to find people who are on the trading floor.

Trading floor in 0.4.0 can only have two types of people on it - collectors, of whom there are only 13 in the entire 8 charts, so you probably won't run in to one accidentally - and auctioneers. There should be an auctioneer in slightly more than half of the systems with a defined export you visit. You should have lines like:
19:46:59.220 [CargoTypeExtension]: Initialised Local Auctioneer
in your log file. It's not that unlikely to go through 3 systems without meeting one, though, since not every system has a defined export, and you might just get unlucky in those that do.

Also, if you generally take a while - as in hours - to get to the main station, because you're docking at a bunch of OXP stations along the way, it's also possible that they've had the auction and gone home.

If you're in Charts 1 to 4, hang around a few exporting systems. If you're in Charts 5 to 8, then 0.4.0 doesn't have the basic trade goods defined for those charts, and auctioneers will be very rare - perhaps 1 in 5 systems will have one. Announcements on TraderNet (or gossip in the bar) may be your best hope for finding an auctioneer, then.

(0.5.0 will define basic trade goods for Charts 5 and 6, and also add some more people to the trade floor, so it might get a little busier)

Re: [WIP] New Cargoes OXP (0.5.0 released 3 March 2012)

Posted: Sat Mar 03, 2012 5:21 pm
by cim
And here's 0.5.0 now - link in first post updated. Changes are:
- a new "open trade contract" offer available on the trade floor.
- base trade goods added to Charts 5 and 6. Nearly done!
- two more sets of auction rules.
- some tweaks to existing base trade goods, mainly fixing the "goat soup" problem in Charts 1, 3 and 4.
- a background image for the auction screens. More to come later.
- more invisible adjustments, mainly aimed at making OXP station support for New Cargoes possible later.

The aim for 0.6.0 is to finish off the base trade goods for Charts 7 and 8 (and then I want to go back and adjust Charts 1 and 2 slightly, now that I've got a more consistent idea about what trades where), to add some of the usability updates pagroove suggested, and to add another person to the trading floor.

So... what's an "open trade contract", then? An extract from Sarmain's "Economies of Trading", 3rd edition, might help to explain.
We start off with a person in one system who wants to buy something. The nearest suitable seller is some distance away. A typical closed contract would work as follows:
  • the seller finds a trader with sufficient hold space, and gives them the goods.
  • the trader flies to the destination system within an agreed time frame, and sells the goods to the buyer, taking the difference in price as a transportation charge.
The problem with this arrangement is that there is a serious risk of piracy on the route, and the goods may never make it. By the time that the buyer realises the goods aren't coming, it may be too late to rearrange. So the buyer has to pay a significant premium to get a strongly escorted fleet that can break through any dangerous systems, and probably also needs to buy insurance on the goods not arriving. And if the need for the goods is more than financial, the insurance may not compensate for their loss. There's also a strong incentive for the trader to take a roundabout route, to avoid dangerous systems, and to make good use of their remaining hold space, which will slow down delivery. So the buyer needs to be contacting the seller well in advance.

So, the solution is the "open trade contract". Again, the buyer contacts the seller, but the seller this time puts up what is known as an "open trade contract". This name, incidentally, is a slight misnomer: as we shall see, the traders in the arrangement have no contract in a legal sense with either buyer or seller, as they would in a more traditional contract.
  • The seller will sell packages of trade goods to all-comers, and give them information on the buyer. The seller will be selling the packages to the traders at a token profit; basically just enough to cover the cost of obtaining or making the goods, and a bit extra for admin expenses.
  • The multiple traders then head separately to the buyer. Probably none of them know who the others are. Some of these traders will be prevented from reaching the buyer by pirates, of course.
  • Unless the route is exceptionally dangerous, or the seller was unable to find many traders, one of the traders will then reach the buyer, and be able to sell the goods to them, again, making a significant profit on the transportation fee. Generally once the goods arrive the buyer will also make an additional payment directly to the seller.
  • No timeframe for delivery needs to be agreed explicitly, as the second and subsequent traders will be unable to find a buyer, thus making delivery easier.
On this model, the buyer can be virtually assured of getting the goods in time, provided they are willing to offer a suitable price, through all but the thickest blockades. Should they unexpectedly require more of the goods, they can buy these from the second-placed trader without having to arrange a new contract. The traders are responsible for making their own escort arrangements at their own expense, but are encouraged - by the requirement to be first to sell at the destination - to take quicker routes. The seller, meanwhile, can sell several times as much cargo as the buyer requires, making a smaller profit on each unit (which also makes the contract more accessible to traders), and additionally will usually get a bonus when the goods do arrive.

Experience shows that the "suitable price" offered by the seller in this model needs to be at least 10 times the buying price at the source system, to encourage sufficient traders to take the risk of losing a significant investment of time and credits if they arrive second.
For an example of how this works, I bought 50 TC of Modern Art from a seller in Edsodi, for roughly 240Cr/TC, who also gave the name of a buyer in Qucedi. I then had to get to Qucedi before any of the other traders trying the same thing. This involved going through a number of more dangerous systems, and ignoring the "servicing needed" warnings as long as I dared. At Qucedi, I arrived first, and was able to sell the goods to the buyer for around 2500Cr/TC. A nice profit for me, this time...

Looking at the details in the debug log afterwards, another 24 hours and I'd have been the proud owner of 12,000Cr. worth of goods that nobody wanted, not to mention down another 7,500Cr. on fuel and servicing costs, and arguably down at least another 20,000Cr. in opportunity cost for things I could have done with that 50TC of hold space instead. So, yes, risky business.

Re: [WIP] New Cargoes OXP (0.6.0 released 10 March 2012)

Posted: Sat Mar 10, 2012 11:26 am
by cim
0.6.0 is now released, and the download link in the first post has been updated.

Changes in this version:
- basic trade routes are now finally defined for all eight galaxies.
- all eight auction types are now active. Be careful with the Xrata rules auctions...
- a new "detailed manifest" screen to reduce the need for note-taking slightly
- background images for all mission screens
- a few more minor bug fixes
...and the really big changes for this release:
- export permits
- local trading by-laws

Export permits give you a license to export a named good from one system to another. They are offered (sometimes) on the trading floor of systems which export controlled commodities, and allow you to export the specified commodity from Galcop stations without the usual legal penalties - for a price. Whether or not the price is worth it depends on what you're transporting and where.

Permits always have a time limit and only work within the current galaxy, and may come with additional restrictions. Do make sure that your permit seller is legitimate, as there are severe penalties for trading on forged permits.

Local trading by-laws reflect that while Galcop prohibits unlicensed export of certain goods, there are other goods which local governments have reason to restrict the import and/or export of. They're mostly common sense - don't take a hold full of food blenders to Tianve, for instance. Or you could just declare them as generic Machinery and hope the port authorities are too lazy to do a full inspection.

The permit/by-law interface is usable by other OXPs to define their own trade rules. As with the stock Oolite, it only applies to trades at main stations (for now)

...now, a quick warning. To get permits and by-laws to work properly, I had to put a custom illegal_goods.plist in the OXP. The OXP writer documentation says "Better never use this as it might change the game to much.". I'm fairly certain that I've set things up so that trade in the generic illegal goods works exactly as it did before, but if you get unexpected effects on your legal status, please let me know. (If you have any other OXPs installed that change illegal_goods.plist, then you could get all sorts of strange effects; let me know so that I can document the incompatibilities)

Planned for the next version:
- another trade floor inhabitant
- sector-wide trade embargoes
- a little bit of tidying-up of the basic trade goods
- more variation in tradernet messages

Re: [WIP] New Cargoes OXP (0.6.0 released 10 March 2012)

Posted: Sat Mar 10, 2012 8:00 pm
by Gimi
cim, out of curiosity, have you tested this with illegal goods tweak OXP. I'm not familiar with the inner workings of that one , but I suspect a potential conflict.

Re: [WIP] New Cargoes OXP (0.6.0 released 10 March 2012)

Posted: Sat Mar 10, 2012 9:52 pm
by cim
Gimi wrote:
cim, out of curiosity, have you tested this with illegal goods tweak OXP. I'm not familiar with the inner workings of that one , but I suspect a potential conflict.
No technical conflict - Illegal Goods Tweak just assumes the core values for illegal good penalties, and New Cargoes fakes those values in its code, so it continues to work as normal. (In fact, I'm not sure there is any way that OXPs can read the illegal_goods.plist settings)

Of course, there is a practical conflict between the two - if you have a permit for the transport of Vaccines (Narcotics) in New Cargoes, Illegal Goods Tweak will of course ignore that and offer to take them off your hands for 1Cr/TC, and penalise you if you refuse. Similarly, while 5Cr/TC for Slaves (and the chance at an interesting mission) might be a good deal for some generic Slaves you scooped off a pirate, it's a really bad deal if you do the same for your Budget Tourists (also, the tourists will be annoyed at their "rescue").

That conflict, though, has been present since 0.1.0 (it's just a bit more obvious in this version). I don't think it's practically avoidable; the purpose of IGT was to deal with the ease of getting illegal goods at unmonitored OXP stations, and then selling them at a suitable main station without ever exporting them ... but the New Cargoes goods are only available at main stations (or extremely unreliably by scooping), so you don't have that exploit in the first place with them.

Re: [WIP] New Cargoes OXP (0.6.0 released 10 March 2012)

Posted: Sat Mar 10, 2012 11:11 pm
by Gimi
So illegal goods will collide with parts of new cargo. Pity, as illegal goods always made sense to me, but new cargo looks like it will be an essential OXP. Any way illegal goods goods could be made to read the permits from new cargos?

Re: [WIP] New Cargoes OXP (0.6.0 released 10 March 2012)

Posted: Sun Mar 11, 2012 8:27 am
by cim
Gimi wrote:
So illegal goods will collide with parts of new cargo. Pity, as illegal goods always made sense to me, but new cargo looks like it will be an essential OXP. Any way illegal goods goods could be made to read the permits from new cargos?
That's not impossible ... it could find out which special cargoes were carried, and in what quantity easily enough. I'd need to make a couple of modifications to let it straightforwardly check if permits applied, but that wouldn't be hard (and should be part of the New Cargoes API anyway). I'd then need to make the existing permits act on import as well as export; again, not difficult and has no significant effect on gameplay without IGT. Added that to the list for 0.7.

Re: [WIP] New Cargoes OXP (0.7.0 released 25 March 2012)

Posted: Sun Mar 25, 2012 11:27 am
by cim
And 0.7.0 is now out. What's new:
- regional variations. There can be major price rises and falls across entire clusters or spacelanes, as well as import or export embargoes. More risk, but more reward, for trading. Many thanks to Svengali for the copy of the BGS-X regional data, which made setting up the regions much quicker.
- fetch contracts. The trade floor may have people looking for a specific good - bring it to them in the agreed quantity by the agreed date for a guaranteed fair price. No guarantees that it's actually possible to get that much to them in that time, though - that's up to your skill and knowledge as a trader. These tend to appear more in systems with few or no "natural" imports.
- the permit/bylaw screen is now permit/bylaw/contracts so that you can see what you've agreed to do in case you forget.
- doubled the number of Tradernet message templates
- tidied up trade good distribution in Charts 1 and 2 based on experience gained from doing the later charts
- made scooping of special cargo a bit more likely. Scooping up a full cargo hold in a Cobra III is now likely to yield at least something of interest. Also fixed an old bug where you couldn't scoop up cargo of a type you already had.
- permits for import/export of cargo are now slightly cheaper. Previously they were almost never worth buying.
- cleaned up the API a lot, and added a few new functions.

First post updated with download links as usual.

There's only one change planned for 0.8.0, but it's a big one - New Cargoes at OXP stations (and rock hermits). This is quite tricky to get right, for a few reasons (beyond just coding it up), so here's the issues and my plans to deal with them. Please comment if you see a problem or have a better idea:

1) F8 F8 F8 to get to the New Cargoes trade interface won't work at an OXP station, because F8 F8 doesn't work.

I'm going to go for F2 F8 at OXP stations (a combination that's unlikely to get much use normally) instead.

2) The cargo pricing algorithm for selling prices depends in part on the distance to the nearest reliable buyer. Because it's not possible to tell (for most OXP stations) whether a particular OXP station will be in a system (especially a system you aren't currently in), the reliable provision of a particular cargo by OXP stations can cause problems.

What I plan to do about this is to make OXP stations only able to sell cargoes normally exported by the system (but perhaps at a different price or quantity, so still worth going to) and/or a selection of random cargo (like at main stations)

So, for example: Rock hermits would sell special Minerals cargoes only - both ones normally exported by the system in high quantities at a small discount, and occasionally special ones in small quantities where they got lucky and found an unusual asteroid. They wouldn't buy anything special, though.

Another example (but see point 3): Constores would sell only random special cargoes, but in slightly larger quantities than a main station would. They would also import a random cargo or two that the system wouldn't.

3) Where should the OXP station New Cargoes market data live? Rock hermits, as a core station, I'll put in New Cargoes.

OXP station markets should really be defined by the OXP that adds the station (or carrier), in my opinion. There's no technical reason I couldn't do it in New Cargoes, but it does then make things more complicated if the OXP writer wants to add different NC market data instead. And the point of New Cargoes is that it can be used by other OXPs, too.

I will as a demonstration, put some OXP station data in to the next release so people can see how it works and to test the API out, but I'd rather not include it in the final release.

Those of you who maintain station OXPs - how would you like this to work?

Re: [WIP] New Cargoes OXP (0.7.0 released 25 March 2012)

Posted: Sun Mar 25, 2012 10:01 pm
by pagroove
Interesting plan you have with the OXP stations. About The SuperHub. It should specialize in high-tech products only (if possible). Maybe some products that you normally can't get at a main station. Maybe some special trade opportunities.

Re: [WIP] New Cargoes OXP (0.7.0 released 25 March 2012)

Posted: Mon Mar 26, 2012 5:43 pm
by cim
pagroove wrote:
Interesting plan you have with the OXP stations. About The SuperHub. It should specialize in high-tech products only (if possible). Maybe some products that you normally can't get at a main station. Maybe some special trade opportunities.
High-tech products only will be straightforward. You'll have to decide which products are high-tech, of course. I'll set up an example in 0.8.0.

Products you can't get at a main station would be trickier - you'd have to set up the buy systems to be those systems with a SuperHub, but set the export quantity to be negative (which means the main station won't sell them). You could then use the trade floor interface to offer the goods for sale.
(Apart from a bug which writing this paragraph has highlighted, which will be fixed for 0.8.0, this is how the Open Contract trade floor personality works)

Special trade opportunities could be set up through the trade floor interface, though you probably couldn't have any that required the player to return to the SuperHub because it might not be there (or you could adjust the spawn script so that if a system had a SuperHub with an open trading contract, the SuperHub always appeared)

Re: [WIP] New Cargoes OXP (0.6.0 released 10 March 2012)

Posted: Tue Mar 27, 2012 5:54 am
by Capt. Murphy
cim wrote:
Gimi wrote:
So illegal goods will collide with parts of new cargo. Pity, as illegal goods always made sense to me, but new cargo looks like it will be an essential OXP. Any way illegal goods goods could be made to read the permits from new cargos?
That's not impossible ... it could find out which special cargoes were carried, and in what quantity easily enough. I'd need to make a couple of modifications to let it straightforwardly check if permits applied, but that wouldn't be hard (and should be part of the New Cargoes API anyway). I'd then need to make the existing permits act on import as well as export; again, not difficult and has no significant effect on gameplay without IGT. Added that to the list for 0.7.
Hi cim,

Just spotted these posts last night and had a quick look at 0.7 this morning. I think I know what is needed. Am I correct in thinking I can basically rework the the logic/code from this.specialLegalPenalty = function() in CargoTypeExtension.js (with dryrun set to true for the permit checking calls) to create a function in Illegal Goods that will check to see if any detected contraband should be ignored (or have a reduced penalty?) as it is a specialCargo with a valid permit?

Out of interest how does New Cargoes interact with things like HyperCargo and Vortex which create 'virtual' manifests.

Re: [WIP] New Cargoes OXP (0.7.0 released 25 March 2012)

Posted: Tue Mar 27, 2012 8:46 am
by cim
Capt. Murphy wrote:
Just spotted these posts last night and had a quick look at 0.7 this morning. I think I know what is needed. Am I correct in thinking I can basically rework the the logic/code from this.specialLegalPenalty = function() in CargoTypeExtension.js (with dryrun set to true for the permit checking calls) to create a function in Illegal Goods that will check to see if any detected contraband should be ignored (or have a reduced penalty?) as it is a specialCargo with a valid permit?
Yes, pretty much. There are some API functions you can use - but I've realised there's an edge case that you won't be able to detect with them. If you wait until 0.8 I'll add an extra function that you can use.

- specialCargoesCarried will say how many of which cargo IDs are currently carried: returns an array of {type,quantity} objects. (e.g. "CTE_CTS_IN7",10)
- cargoDefinition with the second parameter "genericType" will tell you what the base type of the cargo is (e.g. "narcotics")
- You can then call importPermitLevel for each type of cargo to find out if any permits apply. The number it returns should be added to the per TC import penalty for that cargo. (e.g. -2)

There can be a slight problem sometimes, though. If the player has a permit for Insect Slaves, this will give importPermitLevel of -1. You can then add this to the penalty you would apply.

If the system has a specific ban on importing Insect Slaves, then this will give an importPermitLevel of +1. You then don't need to apply a penalty for that cargo either, because the player will have already taken a legal status hit for them.

If both apply at once, then the net importPermitLevel will be zero, but no penalty should be applied by IGT either.

I think what I'll need to do is add importPermitDetails which gives an array of the legal status modifiers rather than the total, for this situation. You'd then only apply IGT treatment to cargo which had a full array of zeros (and was therefore from the system's perspective identical to generic cargo).

The API is not yet entirely stable - there are some changes needed to accommodate OXP stations, though they shouldn't have much effect here - so I haven't documented it yet. As a general rule, only call functions in the "public" commented block of the cargotypeextension.js script.
Out of interest how does New Cargoes interact with things like HyperCargo and Vortex which create 'virtual' manifests.
Not sure. Very badly, I suspect - if you shove a special cargo into a virtual manifest, and don't have enough generic cargo of the right type in the new real manifest, New Cargoes will assume that the special cargo has been sold or destroyed. If you can rotate the manifests in flight then there would be even stranger effects where some of your cargo mysteriously becomes special cargo (or changes type). It'll also have odd interactions with auctions and other trade floor contracts, because player.ship.cargoSpaceAvailable is no longer reliable.

I suspect the best way to solve it is in HyperCargo/Vortex rather than New Cargoes - when those OXPs rotate the cargo bay, they need to take the New Cargoes data for the cargo with them and put it back when they rotate it back. I can add a couple of API functions to make that straightforward and talk to Thargoid about including them once they're done.

Re: [WIP] New Cargoes OXP (0.7.0 released 25 March 2012)

Posted: Tue Mar 27, 2012 7:41 pm
by Thargoid
cim wrote:
I can add a couple of API functions to make that straightforward and talk to Thargoid about including them once they're done.
No problem from my side - once you're done let me know and I'll update both OXPs to suit.