Misunderstood-Wookiee/Mules-and-Warehouses-Extended

Muling Solid and Gas wares

fefe17 opened this issue · 20 comments

I'm trying to use this mod to create ore warehouses.
I have a big station complex in Getsu Fune. The miners in that sector are struggling to move enough silicon and ore.
So I built a warehouse in Asteroid Belt and one in Segaris and assigned miners there.

Now I would like to move the ore from those warehouses to the production complex in Getsu Fune.

I built some XL mining ships (so they can have solid store and can carry the ore).

Then I configured it as a station mule and told it to supply the Getsu Fune base from the warehouses.
It won't budge.

use supply mules, it'll work much better.

also huge ships will require a lot of wares to move, better off starting with medium mules until you're sure everything is working as intended

Trust me, I had more than enough ore in the source station to fill several XL ships, and I had more than enough storage in the target station to consume all the ore. It's not about ship size.

I did not use supply mules because I am daisy chaining these warehouses. The consumer is in Getsu Fune but there is a ton of ore in The Reach. I put a warehouse in The Reach and one halfway. I was planning to have one per sector on the way. Then have one mule per step of the way, so I can pipeline the transport.

Look, all I need is something like the simplest case of CLS2.
Here is my source station, there is my target station, this is the ware I want you to forward. Go.
If I could use repeat command to do transfer wares I wouldn't even be here.

I have not really attempted to use station mules with mining wares, and we haven't really touched the code since we took over. I will take a quick look as I have some mining warehouses of my own, but if the fix isn't super easy, I'm not likely to go doing major refactors in this code.

In order to accomplish this with supply mules, you can set a trade rule to only allow player trades, and put a supply mule on both the factory and the intermediate transfer warehouse, with max jumps set to just allow it to reach the place it's supposed to pull from. So the factory will pull from the intermediate warehouse, and the intermediate warehouse will pull from the source. Basically it's a pull instead of a push, as you've been imagining it.

If you're worried about the supply mule picking the right trades, you can hack it into picking the exact one you want by upping the buy price at the target and dropping the sell price at the warehouse, to give the mule the impression that stock levels need to be equalized.

Ah, it looks like the original author did not want the station mule moving wares around between warehouses instead of acting on behalf of at least some factory somewhere:

<!--never trade between warehouses -->

If we were to relax that constraint, it could have pretty broad unintended consequences, basically making the station mule sometimes ignore it's duties for funneling wares from a factory to a warehouse and then bringing back anything the factory needs.

However, I will say this, I certainly can't stop you from installing mules from github directly and changing line 392 of station mule to
<do_if value="true">

and then your station mules will allow you to do this ;)

OK I looked at Supply Mule.
I can't specify sources and targets. I can specify a home. That does not appear to help me at all.

So let's say I want ore moved from the middle warehouse to the factory.
The other warehouse would also be in range.

I want to build an ore pipeline.

Sec A warehouse -> Sec B warehouse -> Sec C warehouse -> Sec D warehouse -> Sec E factory

I want a mule that I can tell: Carry Ore from Sec A warehouse to Sec B warehouse.
I don't want no looking for trades, no artificial intelligence, no variability.
I want it to go to station A, load ore, then go to station B, and unload the ore. GOTO 10.

I don't want you to worry about the source station running out of ore. Just wait for ore to show up then.
I don't want you to worry about the destination station running out of space. Just dock and wait until you have dropped off all the ore.

Frankly it's unfathomable to me how that is not part of the base game.
Sorry that you are bearing the brunt of my frustration now, but ... you have four mules? And none of them do this simplest of things? What is going on here?!

Believe me, I tried!
Vanilla repeat orders only accepts trade wares, not transfer wares.

I want no money changing hands in my internal supply chain.
The end of my supply chain is making station building materials so I can expand my empire. I don't want to have to think about refilling station accounts.
I want a station that magically refills its stock with claytronics and hull parts while I do something else.

Station mule appears to be stuck. I tried it.
Does it only operate if it can fill the mule's cargo 100% or 75% or so?
That would be very unfortunate.

supply mule will work fine, I think, if you set it to home where you want the good to end up. You just have to sort of retrain your mind for how the chain works. Let's say you have
A: warehouse
B: warehouse 3 jumps away from A
C: factory 3 jumps from B, 6 from A

Set an XL supply mule (mule 1) on B with max jumps of 3. Set him to serve source only and only allow player supply.
Set another XL supply mule (mule 2) on C with max jumps of 3. Also serve source only and only allow player supply.

Mule 1 will go to warehouse A and bring wares to warehouse B
Mule 2 will go to warehouse B and bring wares to factory

If you want to get really fancy, you can ensure the behavior you want by manually setting the buy/sell prices to trick the mule into finding the biggest "profit"; which really doesn't mean profit, profit for the supply mule is simply a proxy for storage levels. So if
warehouse A: sell prices LOW
warehouse B: buy prices HIGH, sell prices LOW
factory C: buy prices HIGH, no sell

That will ensure that mule 1 always moves from warehouse A to B as long as he can fill up his hold to 75%

It is also a good idea in general to set up player-only trade rules.

The supply mule is now fixed to require 75% full cargo hold to find a valid trade. I'm not totally happy with that but it's a workaround for a different bug.

Wait do you mean no money will change hands and I don't have to supply the receiving station with cash so the mule can "buy" the wares?

No money changes hands but unfortunately the game does require funding for the manager to create orders; trying to overrule the manager and do whatever we wanted was horribly unreliable and caused all kinds of bugs.

I have been considering revisiting that with 4.0 but that is not coming any time soon, I am swamped with work, which is a lot of software dev, and I'm not really very motivated to spend my small amount of free time on major mules dev projects...

Hmm but that sounds like I can just create a trade rule that says only trade with my own faction and that would work around that.

I figured it wouldn't matter what the manager says if I don't assign the mule to the station, but apparently that's not how things work.

right, I always set all buy/sell to player-only via a trade rule, then simply open up the few trades that I want to allow out to the AI with a separate trade rule.

Supply mules and travel mules completely obey trade rules whether they're assigned to the station or not.

I just tried and it turns out that Repeat Command with Buy doesn't accept Ore and Silicon.
So I'm still stuck with mules. :-)

interesting, actually I'm seeing supply mules work fine even when there's no funding at all, as long as the trades are player to player. That definitely wasn't the case pre-4.0