[K0058]4.0 BUG: Sell order not filling properly

Ask here if you experience technical problems with X4: Foundations.

Moderator: Moderators for English X Forum

Post Reply
PowerPC603
Posts: 937
Joined: Sat, 20. Mar 04, 19:06
xr

[K0058]4.0 BUG: Sell order not filling properly

Post by PowerPC603 » Tue, 22. Jun 21, 14:19

Hi,

I've got a few complexes producing everything a new station requires (claytronics, energy cells and hull parts) so I don't need to keep scanning the entire universe and send ships all over the place and spend alot of credits everytime I want to build a new station.
I've also setup 3 ships to use repeat orders to buy and sell each of those wares to any new complex's build storage.

I've started to build a wharf complex which produces everything in the same complex so it needs alot of resources and time to build.
At some point, I looked at the required resources and saw it still needed 4783 energy cells for example and it has over 20k EC's already in storage. Claytronics and hull parts come in alot slower and construction hasn't come to a halt.

But the ship delivering the energy cells is flying back and forth alot while it has 12k EC's in it's cargohold, so I decided to monitor it's sell order, which is setup to sell everything (sell for min price and keep 0).
The build storage of the wharf has 5m credits (expected production budget is 27m) and has a buy order for 4783 energy cells at max price.

But the ship only sells 600 energy cells while it has 12k EC's onboard.
After delivering those EC's, it heads back to my complex to pickup some more energy cells and fills up his cargohold to 12k EC's again.
After undocking, I check the sell order, now he heads towards the build storage to deliver only +/- 500 EC's, while the build storage still has an open buy order for another 4183 EC's.

Every time that ship wants to sell energy cells to the build storage, the volume it sells decreases after each run.

Is this intended?
Or does he only unload so little because the build storage has enough in stock and therefore doesn't need as much to keep going?

It's just silly to see that ship fly back and forth with 12k EC's, having a sell order which only sells 600 at a time while everything it setup properly.

EDIT:
After monitoring a bit more, the build storage eventually was down to 380 EC's left to buy.
The ship went back and forth with sell orders of only 77 EC's.
Eventuelly there was only a buy order of 250 EC's left.
I increased the build storage's funds to the expected 27m while the ship was underway to refill it's cargohold and suddenly after undocking, the ship got a sell order of the entire remaining 250 EC's instead of about 70 EC's or so.

Is the ship taking into account the percentage of the given funds to the build storage compared to what is expected and deliver only up to that percentage for energy cells? That would be about 20% (5m out of 27m funds).
This can't be it either because claytronics and hull parts deliver a full cargohold every run (510 and 1020 resp).

I can't supply a savegame at this moment because I'm only using the autosave and it has been overwritten already after delivering all the energy cells.
GamePC: 64bit Quad-core i5-3450 @ 3.1GHz, 12GB RAM, nVidia GeForce RTX2070 8GB, 22" LG Full-HD LED-monitor, Windows 7 Home 64bit

CBJ
EGOSOFT
EGOSOFT
Posts: 51923
Joined: Tue, 29. Apr 03, 00:56
x4

Re: 4.0 BUG: Sell order not filling properly

Post by CBJ » Tue, 22. Jun 21, 15:09

I'm afraid that without a savegame, our guess is as good as yours as to why the ship was behaving the way it was. However, you'll be glad to know that there are several trading-related fixes in the 4.10 update which recently started its way through the Public Beta process, and it's quite possible that the problem you encountered may be fixed by one of those.

Feel free to either try the beta yourself, or alternatively if you manage to make a savegame demonstrating the problem and provide a link here, we can check it against those fixes.

PowerPC603
Posts: 937
Joined: Sat, 20. Mar 04, 19:06
xr

Re: 4.0 BUG: Sell order not filling properly

Post by PowerPC603 » Tue, 22. Jun 21, 16:26

I can try to copy the same complex and setup the same energy cell ship to supply the new complex and see if it does do the same.
GamePC: 64bit Quad-core i5-3450 @ 3.1GHz, 12GB RAM, nVidia GeForce RTX2070 8GB, 22" LG Full-HD LED-monitor, Windows 7 Home 64bit

PowerPC603
Posts: 937
Joined: Sat, 20. Mar 04, 19:06
xr

Re: 4.0 BUG: Sell order not filling properly

Post by PowerPC603 » Thu, 24. Jun 21, 23:29

I've managed to reproduce the bug.

I've uploaded my savegame and a screenshot to filemail (files stay there for 1 week):
https://www.filemail.com/d/mpgytxgaphbmahm

My HQ is expecting some more energy cells (it has 11704 EC's onboard and needs 12500 EC's) and the HQ has 4.15m credits in it's account so that should be more than enough. The HQ is also buying some other stuff to research the first HQ-teleport.
The HQ still needs:
- 6651advanced electronics at max price of 1318 = total of 8766018
- 796 energy cells at max price of 22 = total of 17512
- 383 field coils at max price of 576 = total of 220608
Total buyprice of all needed wares is 9004138 credits (just over 9 million).
Since the player's ships sell at your own stations for free, the money needed at your station should take no more than a full load of a ware. So in case of advanced electronics, this is only 408 units at 1318 a piece = 537744 credits.
That's the most expensive run I can do with the ships I have.
And the HQ itself says it only needs 4.15m credits to operate so I just clicked "accept estimate".

The bug is the following:
The ship "Transporter - Energy Cells 1" has repeat orders to buy energy cells at my complex "TS - Construction Mats" and had bought a full load of energy cells there.
The ship also has a sell order to sell energy cells at the HQ, minimum price 10 credits and keep 0.

The HQ is expecting 796 energy cells (it has a buy order to buy 796 energy cells) but the ship is only trying to sell 367 energy cells while having 11666 energy cells onboard.
When I delete the current dock and trade order, he jumps to the buy-order and goes back to the construction mats complex to buy more energy cells.
When you delete those orders again to skip the buy order (or just delete the buy-order), you'll see he'll go back to the HQ and sell 367 energy cells when he's expected to sell 796 energy cells.
Since the energy cells only cost 17512 credits and the HQ has 4.15m credits, this should be more than enough to cover the costs, even if the station should pay for it, which it doesn't.

I just increased the amount of money of the HQ to the total of 9004138 credits and deleted the dock/trade order again and now he tries to sell all 796 energy cells perfectly fine.
But the HQ says it only needs 4.15m credits maximum to operate normally. And since 796 energy cells at max price of 22 credits is only 17512 credits, 4.15m should be more than enough.
Seems there is something wrong with the calculation of the prices or funding or even the sell-order itself.

After setting the buy amount and buy price to manual and max values, the estimate suddenly is 18.6 million credits which is more than twice the total price of all wares that can fit onboard the HQ.
Shouldn't the ship just check how much energy cells it has onboard, how much the station needs, calculate the price and check if the station has that much funds and if all those are valid, go and sell the stuff?
Seems like the sell-order takes into account all other outstanding buy offers on the station and since the estimate was only half of the total credits needed to buy everything (HQ funds 4.15m, total funds needed to buy everything at max price 9m), it seems to set the sell-order to half the volume it can sell or something like that.
No other ships were enroute to the HQ and the outstanding buy orders shouldn't affect every buy order currently underway to reduce the volume for each sell order in case the funds don't cover the total outstanding buy offers.

Shouldn't it just take into account all active sell-orders instead of ALL orders?
The only active sell-order is the energy cells atm which is only 17512 credits.
It should deduct this from the available funds on the station so the station has about 4.13m left after buying the energy cells.
If for example a ship would sell my advanced electronics and let's assume it has all 6651 units onboard which would be 8.76m credits.
Shouldn't only that order be reduced to consume the rest of the 4.13m credits of the station to only be able to sell about 3133 advanced electronics?
Why reduce the amount of the energy cells while it's obvious the station has more than enough funds to cover that buy-order?

Do we really need to calculate the total price of all required wares by ourselves to make the traders work normally as expected?
Accept estimate should do that for us. This should calculate the total price of all required wares.
Seems like the estimate is simply calculating the average price of all wares instead of the max price.

I'm not using any mods, only complete 4.0 vanilla and no DLC's yet.

If I delete the repeat orders, set it to "Hold position" to get out of repeat order mode and issue a "Transfer wares" order or even a manual sell order, this works as intended because I can set the amount manually that way.
It's just a problem when using repeat buy/sell orders while the station doesn't have ALL funds required to buy everything at once, even if there are no incoming ships for all other wares.
It should have filled the HQ"s buy order using only 2 trips but it has gone back and forth alot more due to this while I'm waiting for that research to start.

Suppose you build a trading station with so much cargospace you'll need over 1 billion credits to fill it all and you only give it 1m to work with.
And you setup a M trader with 12000 cargospace to fill it.
That ship would make only very small orders to fill that station if my reasoning is correct.
Since it would need 1 billion and it has only 1 million, that's 1/1000th of the funds.
Then the ship would make sell orders also for 1/1000th and sell about 12 energy cells per run while having 12000 onboard.
1m credits covers a full run of 12000 EC's so it should sell everything every run.

Because when you calculate the percentage of funds available, that would be 4150000 / 9004138 = 0.461 = 46.1%
When you calculate what a ship is allowed to deliver using that percentage based on it's required volume, that would be 796 * 46.1% = 367, and that's exactly what my energy ship is delivering.
On the other hand, if the one and only delivery ship is enroute to the station which has 4m credits available, why isn't the energy ship allowed to deliver the full 796 energy cells? That would be only 17512 credits and should be valid to be sold.

The more I look at this, the more I'm starting to convince myself this is a feature and not a bug.
It seems this is some deliberate feature to allow stations to spread their given funds to buy the wares equally, in case the funds given are not enough to cover everything.
It just feels weird that selling some low-cost item cannot be completed fully with apparently more than enough funds available for that specific trade.
GamePC: 64bit Quad-core i5-3450 @ 3.1GHz, 12GB RAM, nVidia GeForce RTX2070 8GB, 22" LG Full-HD LED-monitor, Windows 7 Home 64bit

Post Reply

Return to “X4: Foundations - Technical Support”