[SCR] [X3AP] Shopping Assistant 1.2 [UPDATED: 11/08/2014]

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

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

zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

I've been noticing that as well. The efficiency leaves a lot to be desired. I will definately work on giving that a boost this weekend. There is also an issue with purchasing more than one station per type and when using TLs it seems willing to deploy the drones from too far of a distance.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

FishBone_B wrote:Question: How does the shopping assistant decide where to buy resources?
The shopping logic is not very elaborate, but ends up complex due the amount of different types of purchases that can be made. Equipment upgrades have to be handled differently than commodity purchases. Buying from shipyards has its own complexities too.

I am not as concerned with price efficiency or even speed as the Shopping Assistant isn't really meant to be for profitable trading. Its optimized more towards scenarios where you want to be greedy rather than stingy. So lets say you want to buy every last boarding pod in the game. I want the shopping assistant to do a good job of this even buying if there is only 1 to buy at each station.

So in general the SA is going to be a lot less efficient price-wise since it is designed to be Greedy not Stingy. Prior to 1.2 the script assumes significant use of TLs favoring docks universally over factories. The next version will make a small change that should help, favoring factories over docks for smaller transports/fighters (TS class ships). TS ships in 1.2 will be more likely to dock at a BoFu factory rather than a Boron Trading Port. That should help a lot as free trading stations always trade at a fixed price regardless of the amount, but factories will lower the price as supply increases and that should encourage the SA to stop there first..

If 1.2 doesn't make the necessary improvements though I'll look at it more.. Baring any problems 1.2 should be up in a few hours after it has been properly tested.
FishBone_B
Posts: 16
Joined: Tue, 8. Sep 09, 14:18
x4

Post by FishBone_B »

Excellent, I'll test 1.2 this week.

Also personally not fussed too much with the price when you get to the point of having x00 millions, it was mainly the duration: instaed of visiting 3 factories, he spent ages visiting 10 trading docks ^^

But in the end I'm just happy it works and I don't have to do it manually hah :)

P.S.:Is there a particular reason for TL not also getting the factory-priority? (As they can't dock at either anyway).
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

FishBone_B wrote:P.S.:Is there a particular reason for TL not also getting the factory-priority? (As they can't dock at either anyway).
I feel it is preferable to avoid drone trading when possible. If you think TLs are slow, just wait until they deploy freight drones. The drones are slower than some of the TLs and then they have to travel twice as far since they have to go from the TL to the factory and back to the TL. All the while this is happening your TL is waiting in space exposed.

The only thing that makes TL+Drones fast is sometimes you get lucky and there are two or three factories and the TL can buy from all of them at the same time if it has enough drones.

Regarding price, each drone makes a transaction so the first drone that buys gets the best price, the second drone has its price adjusted according to the supply and pays a slightly higher price than the one before it.

I think maybe docks are a little better all around esp when your OOS and your TL moves more than 95 m/s, but I can also see how factories will sometimes work out in the TLs favor. It always feels great to see a TL drop 40 drones that scatter in all directions buying various wares from several different stations. But the TL can also get penalized as the last drone to buy the last ware from the factory pays the most per unit. So TL with drones should end up paying around average price anyway if it completely buys out a factory. That is why docks are sometimes a good bet for a TL. Limited exposure, average prices, and not having to wait for the slow drones.

The TL penalties when trading with factories are all related to the use of drones so they don't apply to the TS at all. Right now the SA only has special logic for upgrades and purchasing stations from shipyards, and everything else is handled generically. Boarding pods are equal to bofu as far as the SA is concerned. That may need to change at some point.
FishBone_B
Posts: 16
Joined: Tue, 8. Sep 09, 14:18
x4

Post by FishBone_B »

That... makes a whole lot of sense now. Thanks for the explanation.

And must agree, the first time I used your script and saw 20 Shopping Drones fly all over the sector was a magic moment :)
Deveyus
Posts: 51
Joined: Tue, 2. Sep 14, 23:43
x3ap

Post by Deveyus »

This is really cool and is now in my load, though I don't have many ships that can usefully use it at the moment, I'm sure it will see lots of use as I get my HQ up and such.

Is there anyway we could make this a global command though? Ideally I'd like to have several ships using their additional command slots to run "Shopping Mode" and when a new shopping order comes in they attempt to split the order between them (a simple "split, purchase, update of intended purchase versus actual, repeat" pattern should work well here.). This would allow me to parallelize automatically instead of trying to send out multiples to shop for things quickly and having them fight each other for product.

I know this is a pretty beefy request, and I know your time isn't free, and hell it may not even be within something you consider to be the vision of your script, but at the same time, you ship browser has become a sexy beast and I hope to see this become one too. Plus, if your 'additional command' is robust enough it opens the door to other mods making use of it to conscript ships on the fly as well.
zanzal
Posts: 309
Joined: Sat, 15. Sep 12, 07:42
x3tc

Post by zanzal »

It sounds like an interesting concept. I wanted to make a version that just does refueling and reloading for missiles, but the script logic is a little weak on smaller ships and its more organized around TS/TLs at the moment. Right now the best use is:

1. Having a ship hoard missiles early in the game before you have a massive missile plex.
2. Completing tedious "fetch ware" plot missions.
3. Buying stuff that you're just too lazy to look around for.

I don't know how much use the SA will get in the late game where you solve your ware shortage problems by building massive plexes, but in the early game it is handy.

The current mod I'm working on is a behemoth and its going to include fully reworked versions of the Drone Miner, Ship Browser, and Shopping Assistant and those are just the footnotes.
Deveyus
Posts: 51
Joined: Tue, 2. Sep 14, 23:43
x3ap

Post by Deveyus »

Sounds massively interesting among other things, and judging by your advice in other posts to others, I can make educated guesses as to how you got to what you're doing.

Yeah, the individual ship control gets very hairy after you reach a critical number of ships, and if other scripts can ask them to do things that opens up things like having an HQ go "I'm out of Mosquitos, go get me more mosquitos, Shopping Assistant Drones."

Not everyone solves all problems with massive complexes, and especially not if you're trying something.

I'm not going to build a plex for a missile type if I'm not sure how good it will be on this carrier's fighters until it's had a trial, but that trial requires hundreds or thousands of missiles, I'm not going to want to go get them manually, and a plex is overkill.

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