[SCR] OK Traders v1.7.1 (04-12-14)

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
Krogort
Posts: 176
Joined: Sat, 3. Apr 04, 14:30
x4

Post by Krogort »

Shimrod wrote:I've uploaded 1.3.0.

1.3.0
- Homebased traders now buy jumpdrives in addition to free traders.
- Traders repair hull damage at shipyard
Excellent, those 2 issue were bothering me a bit.
Your script is awesome, a welcome upgrade from the regular MK3 and CAG.
They are efficient, have quite a good survivability and are as "fire and forget" as you can get.
They are almost too good considering they don't need a MK3 software (I won't complain as I am playing XRM with the MK3 at 2 millions ).

Keep up the good work !
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Great, I'd love to hear how it does against the UT. 1.3.0 is chock full of enhancement, in some cases trivial or low level, and I didn't want to bog down the changelist with trivia. For example:
- When buying a ware ships reserve space to top up their fuel reserve, in case they need to jump to a consumer outside of their current range
- 'best chance' station search turns out to be unreliable, free traders should now make more profitable trades as they always search by 'best price'
- Homebased traders now refuel outside of their homebase. This supports cases where the trader operates out of a station with no energy, and allows it to refuel at a place closer at hand than the homebase which potentially enables more trading before refuelling.

The countermeasures change was pretty effective at least in-sector at holding up incoming hostiles. The trader launches up to 3 drones at each attacker depending on stock level, and makes sure each attacker within missile range has an incoming missile. My test ship did blow itself up once launching a hammerhead, but I'm hoping that's the exception rather than the rule. It works with all 3 drone types.

I agree they're pretty effective. I stopped at about 30 free traders, and after 1d 16h game time the collective total shows 196 million profit. That's not including any traders that were killed off, but on the other hand some of that was reinvested in buying and equipping the traders themselves. So it adds a reliable background income, and I don't think twice about spending a few million here and there, but I'm still falling back to trade missions to fund my factory building (all weapon, shield, ammo complex, for equipping my future fleet of sector patrol M7!)

Glad to hear it's being put to use. I don't even get a download counter on BT cloud. Maybe it's time to swap back into x1tp for hosting; been waiting for the dust to settle on it's site migration stuff.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Oooh... Hammerheads are extremely effective OOS. Dangerous IS. But, mostly, hard for the AI to obtain, because they only exist as drops. They cannot be bought anywhere.
  • (Oh, and most TS ships cannot mount them, you cheater.) ;)


Since you are on the path to perfecting traders, I will mention one more possible future refinement: an "economy-booster" mode. If a factory is stalled (0% production) then it should get priority over "profitable" trades. In some cases, the required amount of wares to begin a production cycle is more than 50% of the factory's capacity. That means that the trade may be "unprofitable" for your trader (because buy price will be lower than average).

The problem is that, if your traders only ever do profitable trades, then they may overlook the stalled factory forever. The cure is to occasionally look for stalled factories instead of "best sell" opportunities.
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

When using this I noticed there is something telling me about a collective balance, is this telling me how much money overall the traders have made?
In Flames We Trust
Listening to Whitechapel soothes the soul!! :D     ¹ ¤ ¹      But, the nuns are watching...
Samuel Creshal wrote:Keyboards: What separates the men from the boys.
XRM Trailer - XRM Installation Guide Video
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Yes. Note that it's just trivially implemented by having the menu search through player ships adding up their balance variables. A more robust future implementation might use a global counter which could be reset, taking into account trades performed by ships since destroyed, and allowing for derived profit over time statistics. Perhaps I can even use the AP graph UI :)
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

Ok because if it was accurate then all of the ships are making some serious dent in my wallet and not putting any back. The current balance is something like -10000000
In Flames We Trust
Listening to Whitechapel soothes the soul!! :D     ¹ ¤ ¹      But, the nuns are watching...
Samuel Creshal wrote:Keyboards: What separates the men from the boys.
XRM Trailer - XRM Installation Guide Video
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

I guess the signed integer will wrap around after 2^31 (2 billion). Not inconceivable if my traders have made 200 million under 2 game days.
pingkiller
Posts: 39
Joined: Mon, 11. Jul 11, 16:42
x3tc

Post by pingkiller »

Can i use this to get my TS to buy missiles for my HQ? I added to missiles to the ware list, upped the price and started the trader. Problem is, he isn't buying anything.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

I've uploaded 1.3.1 which should hopefully address this.

Since the HQ has large stock levels, when I tested it my Mistral SF was checking if it could afford to buy 12k dragonfly missiles (its available cargo space) before performing a trade, an expensive proposition.

1.3.1
- Homebased traders now only test the homebase can afford 1 unit of a ware rather than an amount equal to min(free space ship, free space station).
pingkiller
Posts: 39
Joined: Mon, 11. Jul 11, 16:42
x3tc

Post by pingkiller »

Shimrod wrote:I've uploaded 1.3.1 which should hopefully address this.
Problem fixed now, thanks.
pingkiller
Posts: 39
Joined: Mon, 11. Jul 11, 16:42
x3tc

Post by pingkiller »

Another question:
Is there any way to limit the amount of goods the trader brings to the PHQ? The limit from the Dock ware manager doesn't seem to work.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

There isn't, it'll buy until the 'min trade level %' config settig is met, so stopping at 90% stock. Unfortunately that's a global setting.

I never knew the PHQ had such large stock levels. I can see why you'd want to limit the amount of stock.

I wonder if a station command to configure % stock levels would be the best way forward. This might default to tracking the global 'min trade level %' setting, but could be overridden for each ware.
User avatar
DrBullwinkle
Posts: 5715
Joined: Sat, 17. Dec 11, 01:44
x3tc

Post by DrBullwinkle »

Shimrod wrote:I wonder if a station command to configure % stock levels would be the best way forward.
The Dockware Manager is a station command. From the player POV, the Dockware Manager would be more valuable if more trade scripts obeyed it. Adding a new command that does the same thing but requires duplicate setup seems burdensome rather than helpful.

Of course, if you were to replace the Dockware Manager with something that works for your traders as well as Lucike's and the Bonus Pack's traders, then that would be a nice alternative.

Since most players already have the Dockware Manager (Bonus Pack), wouldn't the easiest route (easy for you and easy for players) be to just support the existing DM?
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Reading up on dockware manager I agree it seems better to integrate with that than to make a custom menu. Subject to taking a closer look at it.
Fnord Lightbringer
Posts: 57
Joined: Sun, 25. Dec 11, 16:04
x4

If it had a sector trader mode like Trade Mk3, this script would be perfect

Post by Fnord Lightbringer »

Currenty running 1.2.3, will upgrade ASAP. I only have two gripes with the script.

The first one is that I start a trader at Argon Prime so that it keeps the surrounding sectors going, but it wanders off. If I wanted it to wander into Terran territory, I would have started it there. Now I can see the benefit of universe traders, but what I really need more often than universe traders is things like the EST from Lucike. Take Twisted Skies, for example. I would like to deploy an OK trader there so that it keeps everybody supplied with Energy, moves the Chelt Meat to the Rastar Refinery and sells Rastar Oil to the surrounding factories, maybe moves a little Ore every now and then, and then possibly sells the missiles and weapons to the Military Base. You know, fire and forget. I don't want it to wander off, get a jump drive and then Twisted Skies is again falling into paralysis. I think the easiest way to do this would be to have an option like with the sector trader, to specify a start sector and a trade radius. I could work with that.

The most annoying part of this problem is probably going away now that you have an option to avoid war sectors, but still. In Twisted Skies the trader does not need shields, missiles or weapons for that matter.

The second issue is that sometimes the traders appear to stall. Let's say I build a Sun Oil Refinery in PTNI Headquarters, and manually fill its hold with Energy Cells and Flowers, then homebase an OK trader to it. I expect it to sell off the wares that the station produces, but every now and then I see it just sitting there. Then I briefly switch to sell ware for best price and come back a while later to notice I had forgotten to switch back to OK trader and the station ran out if raw materials.

I have replaced all my CAG with OK traders, and I would really like to also replace all my EST with OK traders. I need my traders to make use of docking computers and jump beacons!
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

A tethering option can certainly be considered for free traders in future. An economy boosting option has also been suggested, and both seem doable.

If the stalling issue isn't resolved by upgrading to 1.3.1, then enable verbose (level 9 or 10) logging on the trader, PM me the relevant segment, and I can offer analsysis. Log generated in documents\egosoft\x3ap\9055*.txt.

Did I read right that traders don't use jump beacons? OK uses the same stock move scripts as every other, so that suggests another reason I should implement a custom jump/move action.

I like the docking computer idea. I can certainly have the trader purchase and make use of one.

Note that I'm AFK until next week for making any changes, and even then I need to finish up ones I have in the works before can progress other stuff. In-progress:-
- Fix - Integer wraparound in profit display. Track trader profits using approximately 60 bits, tallying billions in a separate integer. Format output with commas for readability.
- Fix - make non-jumpable sector blacklisting aware of jump beacons
- Fix - non-jumpable sector backlisting could add duplicate sectors into the blacklist.
User avatar
vukica
Posts: 1744
Joined: Sun, 10. Aug 08, 18:05
x4

Post by vukica »

@Shimrod

question regarding legal or illegal wares.
if i don't allow my traders trading of illegal wares, to they check ware legality per sector basis or more generaly?

for example, will they trade space fuel in pirate sectors and space weed in teladi sectors? or will they never trade such wares?
Split say NEED MORE FIREPOWER!!
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

If a ware is illegal for any 1 race it's added to a global illegal ware list. The list is recalculated at game load to absorb gamedata modifications, and if a ware is on the list it won't get traded.

It doesn't do fine grained checking on a sector ownership basis, because move pathing could still carry the trader through a sector where the ware is illegal.
Fnord Lightbringer
Posts: 57
Joined: Sun, 25. Dec 11, 16:04
x4

Jump Beacons

Post by Fnord Lightbringer »

No, I think OK Trader uses Jump Beacons, but the Lucike scripts do not.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

I've uploaded 1.3.2.

1.3.2
- Balance statistics are now resettable and display with comma separators. Collective balance now tracked in a global rather than summing trader values.
- Fix: balance statistics rollover when exceeding signed int max. Now tracks billions (thousand millions) in a separate integer.
- Fix: blacklisting non jumpable sectors could add duplicate list entries, and would blacklist sectors with jump beacons

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”