Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Science in trading  (Read 1364 times)

Doktoro Reichard

  • Bay Watcher
  • Lunatic formerly known as Escaped
    • View Profile
Science in trading
« on: January 23, 2014, 02:58:04 pm »

I ask if anyone has given any serious thought or tested or understood the mechanics behind trading.

Not much more to say, actually...
Logged
I have to write something... well here goes:
"A dwarf isn't a dwarf unless he dies the most !!FUN!! of ways", Quote unknown, possibly Armok.

Doktoro Reichard is quite pleased with making a Great Carbonite Trap

Why shouldn't you write with a broken pencil? Because it's pointless!

Larix

  • Bay Watcher
    • View Profile
Re: Science in trading
« Reply #1 on: January 23, 2014, 04:13:44 pm »

Which mechanics are you thinking about? The trading process itself (profits offered, resultant trader mood etc.) could probably be quantified thoroughly, but the practical value would be nil - offer 50% profit and you're golden, and getting enough exportable wares for that much profit is quite easy.

The size and item selection of caravans would be more interesting, but much harder to do any research on. After all, it does seem that caravan size depends on several parameters like presumably fortress size, wealth, exports, last trades with that civilisation and possibly random chance. Normalising the conditions to check for single factors would be near impossible.

The mechanics of "needed provisions" and ordered items aren't thoroughly measured, but fairly well understood. If a fort has little clothes and cloth, cloth and leather will be brought, if the fort has less than its headcount in unforbidden logs of wood, the caravan will try to load enough wood to cover the difference. Ordered items are loaded preferentially, to the point that they can crowd out other wares - most apparent when you order a lot of (heavy) stuff from the dwarfs and then block wagon access so that only a pack animal caravan with its much smaller carrying capacity gets through.
Logged

They Got Leader

  • Bay Watcher
  • Current Fortress:
    • View Profile
    • Steam Profile
Re: Science in trading
« Reply #2 on: January 23, 2014, 04:17:39 pm »

Also, I have done with editing on horses, wagons and other trading animals to see the affects. If you change the load weight of a pack animal, this will increase the carry factor by a lot. If you order cloth at 100% price with 10x carrying capacity, you will see an insane amount of clothing come in.

If you are trading close to the buying price they ask for, but you are receiving a lot of goods and paying with only a few, the trader will give you the response "what are you going to do with all of these goods" (or something to that affect). This means that they are unhappy with the profit they will be receiving.
Logged
Quote from: Urist McDwarfFortress
You do not understand the ways of Toady One. He is not a business, he's just a guy trying to make a fun game. He's invited people to come along and experience the journey with him (and help him test it out as he goes along). At the end of the day, I don't think his main goal is to sell Dwarf Fortress, its just to create the best game possible.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Science in trading
« Reply #3 on: January 23, 2014, 08:57:35 pm »

Quietust did a post somewhere, where he mentioned how the game checks for minimum amounts of stuff of certain types, per dwarf. Traders will bring less cloth or clothing if you already own lots of it (per capita). Similar for wood, food, other items.

SixOfSpades

  • Bay Watcher
  • likes flesh balls for their calming roundness
    • View Profile
Re: Science in trading
« Reply #4 on: January 23, 2014, 09:24:38 pm »

Known Bugs / Issues / "Problems":

Merchants (usually humans) will sometimes bring barrels of "liquid." Each barrel of liquid contains 10 liquid. This liquid is utterly useless (just like blood).

Items ordered through the liason are capped at 4. It doesn't matter how badly you need tin, or how much you are willing to pay for tin, the dwarven caravan will never bring more than 4 bars of tin per year, unless a 5th one appears by pure random chance.

Nobles will NEVER act as broker. Make sure your baron(ess) & your broker (not sure about the mayor) are different dwarves.

If you like to engage in mass forbidding through the Stocks menu, try to construct your Trade Depot out of materials that you are unlikely to ever want to mass forbid. This will prevent the merchants from leaving in disgust because the trade depot suddenly "disappeared."

Stealing from the merchants is very, very bad. The whole point of trading is to move piles of useless crap OUT of the fortress.

AFAIK, it is still impossible to sell caged animals/hostiles. The hauler will simply carry the caged creature to the trade depot, and then open the cage.
Logged
Dwarf Fortress -- kind of like Minecraft, but for people who hate themselves.

firsal

  • Bay Watcher
  • A thin creature prone to great ambition
    • View Profile
Re: Science in trading
« Reply #5 on: January 24, 2014, 01:54:48 am »

Actually, nobles can can act as a broker, bookkeeper and manager. My countess was our fort's manager, broker and bookkeeper since my fortress was started, and was promoted to baroness at around year 5 and countess at year 6. I'm not sure if the case is that her previous occupations override nobility.
Logged

Doktoro Reichard

  • Bay Watcher
  • Lunatic formerly known as Escaped
    • View Profile
Re: Science in trading
« Reply #6 on: January 24, 2014, 06:51:46 am »

Actually, nobles can can act as a broker, bookkeeper and manager. My countess was our fort's manager, broker and bookkeeper since my fortress was started, and was promoted to baroness at around year 5 and countess at year 6. I'm not sure if the case is that her previous occupations override nobility.

Technically, a bookeeper and a broker are nobles. Would strike me as odd if they didn't interchange their roles, although a bookeeper can stand on a chair forever trying to update records.

Quietust did a post somewhere, where he mentioned how the game checks for minimum amounts of stuff of certain types, per dwarf. Traders will bring less cloth or clothing if you already own lots of it (per capita). Similar for wood, food, other items.

Will look for it in the future. Quietust does seem like one of the few to disassemble and divulge the game's mechanics.

Which mechanics are you thinking about?

I had a problem in the beginning years (mostly because I hadn't yet realized how much wealth a 20-dwarf fortress can produce in a year) and I wanted to understand the mechanics behind demand (e.g. how much more are you willing to pay for, when you speak to the liaison) and offer (what they actually bring the following year).

There was nothing in the wiki (that I regard to be one of the main resources for information in the game) about this or how demand and quality of items brought are related.

I was able to test and find some things resorting to DFHack and some scripts I found here:

 - If the caravan doesn't bring item x then even with demand upped to 200% they will at most bring 5 items. I didn't actually checked for intermediate values, as the value didn't allow to distinguish from an exponential or a linear relationship.
 - After upping the demand the first time, they seemed to bring a lot more items regardless of only upping the demand for one item, as they took more time to unload.
 - I suppose that upping demand for something the caravan brings the first time will bring more items (more than the 5 items I assume).

All this was done with a virgin, unmodified fortress, where the dwarves just sit and waited for the caravans that were coming roughly every month.

As usual in any scientific process, one goes around to find out what was already done, so that one does not repeat needlessly what has been done. I felt like this would be of some value (particularly in the beginning years), hence the question.
Logged
I have to write something... well here goes:
"A dwarf isn't a dwarf unless he dies the most !!FUN!! of ways", Quote unknown, possibly Armok.

Doktoro Reichard is quite pleased with making a Great Carbonite Trap

Why shouldn't you write with a broken pencil? Because it's pointless!

Tomsod

  • Bay Watcher
    • View Profile
Re: Science in trading
« Reply #7 on: January 24, 2014, 07:45:02 am »

If the caravan doesn't bring item x then even with demand upped to 200% they will at most bring 5 items. I didn't actually checked for intermediate values, as the value didn't allow to distinguish from an exponential or a linear relationship.
Items ordered through the liaison are capped at 4. It doesn't matter how badly you need tin, or how much you are willing to pay for tin, the dwarven caravan will never bring more than 4 bars of tin per year, unless a 5th one appears by pure random chance.
I haven't been able to find this at the bugtracker. Has it been reported yet? Sounds like a serious problem, especially if you want to trade for some ore en masse.
Logged

XXSockXX

  • Bay Watcher
    • View Profile
Re: Science in trading
« Reply #8 on: January 24, 2014, 08:16:55 am »

If the caravan doesn't bring item x then even with demand upped to 200% they will at most bring 5 items. I didn't actually checked for intermediate values, as the value didn't allow to distinguish from an exponential or a linear relationship.
Items ordered through the liaison are capped at 4. It doesn't matter how badly you need tin, or how much you are willing to pay for tin, the dwarven caravan will never bring more than 4 bars of tin per year, unless a 5th one appears by pure random chance.
I haven't been able to find this at the bugtracker. Has it been reported yet? Sounds like a serious problem, especially if you want to trade for some ore en masse.
Not sure if it's to be considered a bug per se, just an arbitrary limitation.
Many people probably loose the liaison early on anyway, by becoming the mountainhome. That is more problematic, since it makes - for me at least - trade relatively useless in the later game.

Nobles will NEVER act as broker. Make sure your baron(ess) & your broker (not sure about the mayor) are different dwarves.
There is a job conflict, if your baron has the "conduct meeting" job with the liaison, he cannot trade at the depot. Apart from that Nobles can act fine as brokers, though having a separate broker is the best way to avoid job conflicts.
People generally seem to see the broker more important than he is, I just switch to "anyone can trade" if the broker is unavailable.
« Last Edit: January 24, 2014, 08:21:55 am by XXSockXX »
Logged

Larix

  • Bay Watcher
    • View Profile
Re: Science in trading
« Reply #9 on: January 24, 2014, 08:32:27 am »

That'd be more of a suggestion than a bug report. Four guaranteed items currently is the intended max, but things might change with later versions.

Requesting one ore at maximum priority means an extra 16 bars of the metal in question (discounting the "chance of silver" ores tetrahedrite and galenite). When looking at alloys, especially when you have the other required metals on your site, that can easily become quite a bit more - maximum requested cassiterite, combined with local copper ores and bismuthinite, can give 64 bars of bismuth bronze per year.

Quote from: Doktoro Reichard
I had a problem in the beginning years (mostly because I hadn't yet realized how much wealth a 20-dwarf fortress can produce in a year) and I wanted to understand the mechanics behind demand (e.g. how much more are you willing to pay for, when you speak to the liaison) and offer (what they actually bring the following year).

From what i see, each 'tick' on the demand slider translates to one guaranteed item of the type, as long as the caravan has enough capacity. If you demand all types of leather and stone at maximum priority, you _can_ run a wagon-train out of carrying capacity; they'll carry only demanded stuff, and not even all you requested. If you demand items that come in stacks or packed into containers, you'll get the demanded number of stacks or filled containers - four bins of leather, four barrels full of (one type of) milk, but also four solitary pig tail fibre threads (that's especially pointless, since each caravan tends to bring a dozen of those anyway, so four extra don't make much difference).

There appears to be a lot of scatter in the price adjustments for requested items - the price adjustments for +1 prioritised items can range from 100% (i.e. normal, unadjusted price) to 120%, +4 (max) is in the 170-200% range typically.
Priority settings of the civilisation result in much sharper markups, from 140% at +1 to 230+% at +4 (exact numbers will vary). That markup applies to _all_ items handled by that civ's traders the next time their caravan manages to make it onto your map. I.e. if their demand for both trousers and unworked cloth is high enough for a 150% modifier, they'll pay 50% extra for the old trousers you give them, but the bins of cloth they offer for sale are also 50% more expensive. I haven't looked into this closely, but think that markups for both import and export (say, you requested more brown recluse spider silk cloth _and_ cloth has been marked up by the civ) are cumulative.

If both caravan and liaison don't show up in a year - generally due to a siege - the old agreement will remain in force and the next caravan will carry the demanded wares. Things are likely a bit weirder when only one of them makes it - but since they appear at the same or nearly the same time normally, a siege would have to be announced in the few game steps between the arrival of caravan and liaison, not a common occurrence.
Logged

SixOfSpades

  • Bay Watcher
  • likes flesh balls for their calming roundness
    • View Profile
Re: Science in trading
« Reply #10 on: January 26, 2014, 12:56:30 pm »

Actually, nobles can can act as a broker, bookkeeper and manager. My countess was our fort's manager, broker and bookkeeper since my fortress was started, and was promoted to baroness at around year 5 and countess at year 6. I'm not sure if the case is that her previous occupations override nobility.
There is a job conflict, if your baron has the "conduct meeting" job with the liaison, he cannot trade at the depot. Apart from that Nobles can act fine as brokers, though having a separate broker is the best way to avoid job conflicts.
People generally seem to see the broker more important than he is, I just switch to "anyone can trade" if the broker is unavailable.
That's odd--my broker/manager/bookkeeper was perfectly happy to carry on his duties as the expedition leader, and (IIRC) after becoming mayor, but once he became baron he would never go near the Trade Depot again, not even for the elves or humans (who obviously have no Mountainhome liason to Conduct Meetings with).


As far as requesting larger amounts of desired goods, I for one am 100% in favor of it--as long as the Mountainhome has access to the desired materials, of course. I would also like to see permanent price markups for materials which the fortress has access to, but the Mountainhome does not (and vice versa). For example, my current fort's home civilization does not have any iron at all (although they do, strangely, have pig iron & steel). But my fort is sitting right on top of huge quantities of hematite & magnetite. Heck, the fort could have been founded for the specific purpose of being an iron mine. There should be at least a 50% markup in the worth of iron being shipped to the Mountainhome--and no limit of being only to sell 4 units of it per year. That's just unrealistic.
Logged
Dwarf Fortress -- kind of like Minecraft, but for people who hate themselves.

fractalman

  • Bay Watcher
    • View Profile
Re: Science in trading
« Reply #11 on: January 26, 2014, 04:59:39 pm »

"There appears to be a lot of scatter in the price adjustments for requested items - the price adjustments for +1 prioritised items can range from 100% (i.e. normal, unadjusted price) to 120%, +4 (max) is in the 170-200% range typically. "

As your noble (mayor/baron/whatever) gets more experienced at trading, they'll be able to haggle up a better deal.
It's most noticeable if you rig your mayorial elections to give you the same non-mandate-dwarf every year, and keep them away from unfortunate accidents.   
Logged
This is a masterwork ledger.  It contains 3719356 pages on the topic of the precise number and location of stones in Spindlybrooks.  In the text, the dwarves are hauling.
"And here is where we get the undead unicorns. Stop looking at me that way, you should have seen the zombie deer running around last week!"

Tribea

  • Escaped Lunatic
  • Im from nationstates, so i bring brain fungi!!!
    • View Profile
Re: Science in trading
« Reply #12 on: January 27, 2014, 06:48:00 pm »

Known Bugs / Issues / "Problems":

Merchants (usually humans) will sometimes bring barrels of "liquid." Each barrel of liquid contains 10 liquid. This liquid is utterly useless (just like blood).

Items ordered through the liason are capped at 4. It doesn't matter how badly you need tin, or how much you are willing to pay for tin, the dwarven caravan will never bring more than 4 bars of tin per year, unless a 5th one appears by pure random chance.

Nobles will NEVER act as broker. Make sure your baron(ess) & your broker (not sure about the mayor) are different dwarves.

If you like to engage in mass forbidding through the Stocks menu, try to construct your Trade Depot out of materials that you are unlikely to ever want to mass forbid. This will prevent the merchants from leaving in disgust because the trade depot suddenly "disappeared."

Stealing from the merchants is very, very bad. The whole point of trading is to move piles of useless crap OUT of the fortress.

AFAIK, it is still impossible to sell caged animals/hostiles. The hauler will simply carry the caged creature to the trade depot, and then open the cage.
On the one fortress i actually did, i got three barrels of liquid and used them to throw down at gobbos.
Did as much carnage as you'd expect.
Logged