X4: Foundations

X4: Foundations

546 ratings
TaterTrade
14
2
2
2
2
7
3
3
4
4
2
3
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
412.096 KB
2 May, 2020 @ 5:41pm
28 Dec, 2024 @ 7:16am
20 Change Notes ( view )

Subscribe to download
TaterTrade

Description
This mod includes two scripts: Tatertrader and DeadTater.
DeadTater is a completely rewritten script from scratch by me, and it uses the logic of comparing trade offers from Ludsoe. The name is a nod to the work from both of us and even as less of his code remains, it would not be possible without his work.
TaterTrader is the original script updated by me with permission from Ludsoe.

If you ask me which you should use: DeadTater would be my answer. It is designed to be as efficient and reliable as I could code. Just like the original, it does not use any information unavailable to the vanilla autotrader. It has a built in logistics mode in the option of my faction first that is still "profit based."

Why is TaterTrader still included? While I have not maintained all the options (homebound, assign to station), it still provides valuable options to the users who prefer it. It is still head and shoulders above vanilla autotrader. I have zero plans to add more factions to the ban section as long as it requires hardcoding factions.

Check the images for explanations on the features of both scripts.

Both DeadTater and TaterTrader use buy/sell offers to function. This means that stations must have funds in their account or they will not generate buy offers.

Both DeadTater and TaterTrader have mimic support built in. You can create trading fleets that each individually perform their respective script.

Both DeadTater and TaterTrader do not cheat information. They use the same information available as the vanilla trade script.

Both DeadTater and TaterTrader respect blacklist and traderule settings, unless overridden.

DeadTater features:

Profit based trader.
Adjustable distance penalty calculation.
My faction first - simplified logistics between player owned stations in range.
Prefer my buy offers - simplified logistics for supplying player owned stations in range.
Prefer my sell offers - simplified exporting of wares from player owned stations in range.
Auto wares - Automatically adjusts ware basket based on trades available in range.
Illegal wares - Allows trading in illegal goods.
Minimum fill - Traders will no longer accept trades below cargo capacity percentage.
Ignore Carrier / Auxillary - Prevents trading with the often buggy ship buyers.
Logbook entries - Enable or disable log entries showing estimated profit and the traders performance up to that point.
Global tater queue - Spreads performance impact and prevents individual traders from grabbing the same trade at the same time. Allows large numbers of traders to have near zero performance impact since only one is running intensive logic at a time.

The three prefer options are run in sequence in the order they are presented.

Author: DeadAir

TaterTrader Features:
Attempts to find the best profit based on the configurations of the order given.
A bunch of settings you change to tweak how and where it trades.
Only trades with trade offers known to the player.
Uses the games own built in trade orders to conduct its trades.
When the Traders home is set to a station, the station becomes the traders commander.
Traders use their commanders money if they have one.
The Traders follow faction trade restrictions, unless told otherwise.
There's ware list presets you can copy within the configuration options.
Fancy outputting to the player log.
Station Trader Mode allows you to focus the trader onto a station, to handle all its trade offers. Can be used on both player and NPC owned stations, even accounts for the stations build storage.

Configuration Options:
You can define a home sector or station.
Can set the trader to always return "Home" before attempting to seek another trade.
You can configure which wares the trader attempts to find trade deals for.
The maximum distance from home the trader can buy or sell at.
Change the Price the Traders perceive wares are set at your own stations. (Doesn't actually affect the cost)
You can set the Traders to bypass faction trade restrictions.
You can exclude sectors from the trade offer search.
You can use preset ware lists, I copied the ones used by the game itself.
You can set the Trader to compare distances between stations when searching for deals.
Enabling Station Trader Mode allows you to focus a stations offers, allowing you to automate your own stations or even NPC owned ones.

(Updating details might cause issues with my steam workshop update procedure, yay!)

Author: Ludsoe
Maintainer: DeadAir

Patch notes available on:
https://github.com/DeadAirRT

Best place to contact me:
Egosoft discord X4 Modding channel
Popular Discussions View All (5)
1
2 Sep, 2024 @ 1:31pm
Tide & TaterTrade
Komodowaran
4
1
7 Jul @ 9:12am
PINNED: Explanation of TaterTrade options
DeadAirRT
3
26 May, 2022 @ 6:36pm
PINNED: Patch notes
DeadAirRT
712 Comments
Reclaimer 117 7 hours ago 
NVM, I went so heavy on the blacklist exclusions that I also excluded the free families territories. Made the freighter go through a matrix sector because there was literally no other way lol
Reclaimer 117 8 hours ago 
I appreciate you trying to explain it to me, but I still don't really get it. I was kinda hoping more for something along the lines of "If Johnny has 100 apples in his freighter, and he makes ten jumps..." lol
No worries though, I've just left it at the default setting. That seems to work fine.

Oh, I do have another question though. Have you run into any problems with this mod respecting blacklists? I've got a problem where I'm trying to stop a freighter passing through one of the matrix sectors, and it just keeps heading through it every time.
I think I've set up the blacklists properly. I made one for activity, travel, and trade, gave them all the same hostile factions and the same dangerous sectors, ticked the "civilian" box, and then set the fleet commander to use those three blacklists, with the rest of fleet set to "use commanders settings."
Is there something I'm doing wrong? The game is so complex, I keep thinking I must have missed something or done something wrong.
DeadAirRT  [author] 5 Sep @ 6:33pm 
@Mr_Anivex - a small diff of parameters.xml will make the failed orders not annoying but I've also never seen the behavior your mentioned (maybe due to other changes, not sure)
<replace sel="/parameters/orders/failures/@queuemax">0</replace>

@Reithan - it would require making some changes to order.trade.routine but I'm no longer modding x4.

@Reclaimer 117 - Projected profit * (1.0 - %Penalty_Per_Jump / 100.0) ^ Gate_Distance
Gate distance is amount of jumps between the ship and the station to buy at PLUS the amount of jumps between the station to buy at and the station to sell at.
Reclaimer 117 5 Sep @ 6:18pm 
Ok, so I'm feeling rather dumb... Can someone explain the distance penalty to me?...
Preferably using in game trade examples. I can't wrap my head around it.
Reithan 30 Aug @ 8:09pm 
As far as I can tell station managers use the default auto-trade logic. Would it be possible to add some way to swap these to use DeadTater?
Mr_Anivex 10 Aug @ 3:23pm 
Would it be possible to add a function to clear failed orders? Perhaps one that runs on an adjustable timer?

Whenever I load into a game, if the commander of my trade fleet was mid-trade(as in, already picked up the materials and is on the way to sell), any ships in that fleet will get an order queued up to mimic the commander's sell order. It doesn't really interrupt too much as far as I can tell, as the order simply fails and they go back to deadtater once the commander completes the order they had queued up. However, this ends up stacking and I end up with a ton of traders with 5 failed orders each.

This is more of request for the sake of keeping things looking clean. All the orange icons just look like a mess to me, and it makes it difficult to tell when something is actually broken with my orders for fleets not using deadtater.

Love the mod btw. You solved many of my trade issues, and saved me so much time.
deltaCorben 10 Jul @ 2:12pm 
Adding money to the station budgets has solved it. Sorry for not seeing that earlier.
deltaCorben 9 Jul @ 12:39pm 
When I set a station trade rule to only trade with my faction at a factory, my dead tater fleet will completely ignore that factory.
sgtspock 4 Jul @ 12:49pm 
Hi DeadAirRT. I love your mods! I have a feature request for Deadtater: It would be nice if I could assign an Auxiliary ship to supply my Deadtater fleet and have ships that take damage automatically repair themselves when damaged after their current trades are finished.
DeadAirRT  [author] 27 Jun @ 6:46pm 
@Kater - I have never once seen that in all my testing, or received any reports of it. You most likely have something messing with your trade offers (a different mod) or there is some information missing in your description of the problem.

If you have queue spreading turned on, there is no way for multiple ships to get the same trade at the same time. If you are using SETA or something then that would cause issues because this game can barely run smoothly at 1x speed with all the objects in the galaxy, let alone 4-6x