Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Trade depot takes months to pack up  (Read 1188 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Trade depot takes months to pack up
« on: May 20, 2013, 02:01:20 am »

Two problems noticed at my current fort:

a) The Human and Dwarven caravans take 2 months to pack up all of the crap that they bring that I don't want to buy, plus the stuff that I sell them. It is getting worse as the value of my fort increases - they just bring more and more stuff, and I can't speed up their packing. There used to be a bug with the mouse and pause that could pack them instantly, but that was fixed.

b) Haulers will bring a bin from a stockpile just to collect one item from the trade depot, and then haul the bin back even though there are multiple items that belong in that bin that would fit.

Anyone have workarounds for either problem?

Larix

  • Bay Watcher
    • View Profile
Re: Trade depot takes months to pack up
« Reply #1 on: May 20, 2013, 02:25:28 am »

There's not much you can do about them packing up, it will take ridiculously long. And there's always the risk of the human caravan leaving the depot when the dwarfs are coming in, which can easily result in wagons colliding, which in turn means gridlock until a wagon breaks. If it's a human wagon, that'll dump a lot of unwanted stuff and some of your trade junk back on you, if it's a dwarf wagon, it'll lose you the trading opportunity for the year.

You can mitigate it somewhat by selling only few items to the humans - bins full of stuff, single high-value items like gold statues or food pots. - and buying many individual items - all the gems and thread they bring, and lots and lots of food. With a wealthy fortress, the humans leaving will still be dangerously close to the dwarven arrival.

You can game it the other way by selling pages upon pages of individual items to the humans. This can hold them up so long that they'll only actually leave in early winter or so, by which time the dwarfs are already there and trading. A caravan can enter, unload and trade without problems while the previous caravan is still sitting in the depot packing up.

Edit - as to the second, it's a massively annoying problem with the current hauling code. I _think_ it could be modified by fiddling with the combining items settings in d_init, but i haven't dared touch that yet. In the normal settings, putting an item in a container has such a high priority that it overrides saner options, like bringing the item to the container or picking up several items at once. A clumsy and messy workaround would be disallowing containers on stockpiles for items that are problematic with single-pickup, like armour and weapon stockpiles far from the forges, or food stockpiles for plants picked by herbalists.
« Last Edit: May 20, 2013, 02:36:31 am by Larix »
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Trade depot takes months to pack up
« Reply #2 on: May 20, 2013, 02:35:29 am »

There are two sort of not so good ways I can think of to help mitigate the first problem.  The obvious one is to kill merchants and hope they send less next year, but it also has obvious downsides.  The other option is to try and reduce the number of food, logs, boxes of cloth and boxes of leather that they bring.  Quietust disassembled the code responsible for determining how these were brought along with merchants, and though I don't have a link to the thread, they were all based on your current stock levels.  I believe it tried to bring enough cloth so that each member of your fort could have 5 changes of clothes, and enough food for 5 meals (and maybe 5 drinks?).  I forget how many logs they brought.  Keeping a lot of those items in your stockpiles might help reduce the spam they bring with them, and the subsequent load and unload times.

No idea on the last one, sorry.  I've not noticed any such behavior myself.
Logged
Through pain, I find wisdom.

Hamiltonz

  • Bay Watcher
    • View Profile
Re: Trade depot takes months to pack up
« Reply #3 on: May 20, 2013, 04:11:59 am »

Make two depots.  Disable the one that is being blocked by traders that are taking too long to pack up.

This thread talks about two depots and how to redirect wagons to the one you want.  It also talks about the pitfalls to avoid.

http://www.bay12forums.com/smf/index.php?topic=126045.msg4247391#msg4247391
Logged

Aquathug

  • Bay Watcher
  • This text is personal.
    • View Profile
Re: Trade depot takes months to pack up
« Reply #4 on: May 20, 2013, 07:51:03 am »

Clever use of drawbridges and !!Hawaiian Punch!! should solve your problem.
Logged

Larix

  • Bay Watcher
    • View Profile
Re: Trade depot takes months to pack up
« Reply #5 on: May 20, 2013, 08:12:41 am »

Make two depots.  Disable the one that is being blocked by traders that are taking too long to pack up.

This thread talks about two depots and how to redirect wagons to the one you want.  It also talks about the pitfalls to avoid.

http://www.bay12forums.com/smf/index.php?topic=126045.msg4247391#msg4247391

I've messed around with multiple depots and i'd say the main pitfall with double depots is having them in the first place. The game really doesn't expect you to have more than one and behaves very very poorly when having to deal with several. 'Deactivating' a currently occupied depot means forbidding it, which will mess up the traders currently there. I've done it once or twice and can't remember what exactly happened, only that it wasn't pretty. I think i ended up with lots of unwanted trader junk on my hands and the civ thinking i stole their shit.

I just keep in mind that the humans can collide with the dwarfs and make sure to sell them few high-value items while buying a lot of low-value individual items off them. Gets them off the map in time and keeps them happy (because they're still alive - i just _knew_ half of the suggestions would be all about murdering the humans and loading down your fort with even more annoying trader junk).
Logged

Ace_Warbringer

  • Bay Watcher
  • Swords For Everybody!
    • View Profile
Re: Trade depot takes months to pack up
« Reply #6 on: May 20, 2013, 06:22:36 pm »

Here's an idea, make two corridors that are wagon accessible that are long enough to contain a trade caravan, but separated by a wall and some bridges. if you run into the problem of one going out as one comes in swap one of the corridors out and trap or force the caravans to use just one corridor at a time. what I know about pathing suggests these would need to be very long to force the wagons to the right area. but once you have the outgoing caravan airlocked, you should be all set.
Logged
Though maybe that's the issue. The concept is just too simple for the dwarven mind to grasp!

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Trade depot takes months to pack up
« Reply #7 on: May 20, 2013, 06:47:40 pm »

Some science may be necessary on this.

I would suggest poking the carry capacity of wagons, so that they hold less weight. This will force the caravan to send more physical wagons, thus reducing the time that individual wagons take to get loaded again, in theory.

There is the possibility that this will worsen the problem, if the actual issue is one of sorting which wagon will get what good on closeup time.  (Inefficient sort algo, now with MOAR lists to sort!) In that case, INCREASING the size, so that fewer wagons are needed would speed up the sort algo processing, by reducing the complexity of the sort.

Since I don't know what the actual underlying pathology is, I can't really say which way it should be poked. It would take science to find out.

There is also the potential issue of a timing loop controlling rate of packing, such that only X items per clock interval are allowed to be packed, resulting in more time being alloted than is possible before the next caravan arrives. In that case, short of a dfhack lua script to poke the timing value, I don't see a solution. (There are a number of compelling reasons for toady to implement such a timing mechanism; it makes the caravan and trade depot more vulnerable to seasonal invaders, if they take forever to leave the depot, increasing the chances of !FUN!. Again, I don't know if such a feature exists... but it would have made a nice, clever fix for the "pause, wait, unpause-- caravan magically loaded!" Bug.)

Initial science to see if wagon capacity has any influence first, then looking for numerical constant to poke second.

« Last Edit: May 20, 2013, 06:55:23 pm by wierd »
Logged

Hamiltonz

  • Bay Watcher
    • View Profile
Re: Trade depot takes months to pack up
« Reply #8 on: May 20, 2013, 11:42:02 pm »

[...] 'Deactivating' a currently occupied depot means forbidding it, which will mess up the traders currently there.[...]

If you raise a drawbridge and close the only exit/entrance to the occupied depot the wagons for the next trader will path to the only available depot.  The pack animals will always path to the first built depot (according to that other thread).

You can leave open a 1 tile wide path to the first depot and trade independantly with both if the pack animals go there.  This will double the rate of gain of experience for your trader.

The only downside as I see it is that you cannot do both trades at the same time.  This is true even if you set one or both depots for anyone to trade there.
Logged

VerdantSF

  • Bay Watcher
    • View Profile
Re: Trade depot takes months to pack up
« Reply #9 on: May 28, 2013, 12:54:21 pm »

By the time this gets to be a problem, you really don't need wagons anymore.  I just block wagon access completely now.  The single file pack animals and traders still bring plenty of goods AND they're a lot better about avoiding/escaping from ambushes.