[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

Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

The design I posted includes an Ignore mode which will sell and not retain lasers, that should be covered already.

I won't give a date as my spare time is limited, and the implementation pipeline is occupied with economy boosting and tethered traders, which will require an extended period of regression testing due to some supporting design changes.
littleliliput
Posts: 11
Joined: Thu, 24. Nov 11, 17:51
x3ap

Post by littleliliput »

I misunderstood the Ignore option, sorry for that.

Thank you for this script I really like it and can't wait for the update!
IAmSomeone
Posts: 1
Joined: Tue, 24. Jan 12, 22:07
x3ap

Post by IAmSomeone »

I believe I have found a bug.
Traders will gladly go into blacklisted sectors to repair the ship they are flying.
Opy
Posts: 5
Joined: Fri, 29. Oct 10, 13:16
x4

Post by Opy »

Not noticed it before installing this mod, but it may be just coincidence;
I use and old MS ForceFeedback 2 joystick and after Alt-Tabbing out and coming back into X3:TC/AB the throttle no longer works properly. Any throttle movement sets ingame throttle to zero.

*Edit - After uninstalling the mod (run uninstall in game, save game, close game, remove all associated files, start game and reload from save) I'm getting the same issue, so perhaps it is just coincidence that it happened after installing this mod.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Traders will gladly go into blacklisted sectors to repair the ship they are flying.
Confirmed from looking at the code, I'll include a fix for next release.
Any throttle movement sets ingame throttle to zero
Unlikely to be related to OK traders. The script just affects npc ship behaviour, won't touch the player ship unless the command is running on it. Seems more like a bug in the game itself, or with the driver. If reproducible on a vanilla install I'd raise it in the tech support section.
Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde »

@Opy

The throttle on the joystick issue is already known about and hopefully will be patched in 3.1.
Still life in the old dog yet...
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

I have a large amount of slowdown in my current game and am just wondering if it may be due to me having about 60 traders using this on the go free roaming. Could that cause a lot of slowdown? I'm just trying to find the culprit.
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 expect you'd start feeling it at 60 free traders yeah. You can easily confirm it by running the uninstall option from the menu, if lag goes away then there's the root cause.

I've done some performance optimization work in 1.4 that I hope will help with large numbers of free traders. The main optimization adds a lookup table for traders to check whether a particular trade route is already claimed, replacing a simple loop where each trader would scan every other trader running the script. This would get slower as number of traders increased. This triggers lots of times while at trader is determining the best ware to trade.

I've also reduced the frequency free traders test whether they can sell a ware they're en route to buy, and split out some core functions into an optimized library.

1.4 is code complete but still in testing.
User avatar
InFlamesForEver
Posts: 2266
Joined: Fri, 22. Jul 11, 13:42
x3tc

Post by InFlamesForEver »

That sounds excellent :)

I'll do some testing now but I'll wait to make a judgement on whether I should cut down the number of traders after 1.4 is released.
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've uploaded 1.4.0.

I made a further optimization to remove any wares with selling price lower than 5cr from the tradeable ware list. This excludes various trash wares like coloured crystals which are hard to generically remove and reduces amount of work performed when searching for a ware to trade. If anyone is running a mod where 1,2,3 or 4 credit wares need to be legitimately traded, do let me know...

1.4.0
- Add an economy boost mode for free traders, where they prioritize trading at stalled factories.
- Add free trader tether sector and tether range options to restrict free trader movement
- Have homebased traders observe dockware manager stock level limits configured on player docks.
- Traders now make use of docking computers when installed, and will buy a docking computer if they happen to dock at a place that sells one.
- Performance optimizations.
- Fix: repair shipyard selection was failing to respect blacklist
- Fix: homebased trader ware settings were not updated when wares were added/removed from the homebase tradeable ware list.
User avatar
alt3rn1ty
Posts: 3797
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

Shimrod wrote:- Add free trader tether sector and tether range options to restrict free trader movement
Similar to the old Local Traders ?
http://forum.egosoft.com/viewtopic.php?t=158869

If so, nice idea to include that ability.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Yes, just like that, though credit for the idea goes to Fnord Lightbringer.

Setting a zero tether range will make it behave just like a sector trader.
User avatar
alt3rn1ty
Posts: 3797
Joined: Thu, 26. Jan 06, 19:45
x4

Post by alt3rn1ty »

Man I love your scripts :), thank you
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Thanks :) I think I'll let the dust settle on 1.4 for a while, play the game and flush out any bugs, before working on another feature release.

Future areas of enhancement might include:

- Equipping configuration
- Huge ship trading using fright drones
- Setting ships as homebases
- Special modes in addition to the eco boosting mode: collect flying wares, mining (maybe)
Vayde
Posts: 850
Joined: Fri, 6. Feb 04, 21:02
x3tc

Post by Vayde »

Hi Shimrod, Absolutely love tethered mode :)

Couple of questions for you.

When starting a new free trader the first thing it does is head off for a jump drive.

When doing this does it check to see if the sector is known to the player?

Does it respect the Blacklist and avoid dangerous sectors when doing this?

Can any new release only include buying a jump drive if the player wants this?

Thanks

Vayde
Still life in the old dog yet...
User avatar
Krogort
Posts: 176
Joined: Sat, 3. Apr 04, 14:30
x4

Post by Krogort »

Awesome mod becoming even better !

I'm especially happy with the performance optimisation and eco boost mode and look forward to try them.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

Thanks guys. I hope the performance gain will be noticeable. I'll continue to look at this in subsequent releases.

@Vayde: It checks the destination sector is known and not blacklisted. However the move-pathing is performed by the stock script !move.movetostation, and I suspect this will travel through the shortest route to get there regardless of known status. It doesn't know about OK's blacklist either.

In vanilla AP I was unable to construct rationale for why a trader shouldn't buy a jumpdrive, and hence did not add a config option. 100k is quickly recovered with the massive boost to efficiency. Perhaps a tethered single sector trader wouldn't have use for one, but then the trader won't leave his sector to go and buy a jumpdrive so it's not a problem.

I can see how it would be a problem if your favourite mod makes them cost millions of credits or something, but my playtesting, at least since jumpdrive acquisition was added, has only included vanilla AP. Very early versions were developed under TC + XTC.

Equipping config will probably be the next major feature. Some design discussion about it begins at the following post, and yes it'll certainly be possible to configure - at least on a global basis - whether or not ships will buy jumpdrives.
http://forum.egosoft.com/viewtopic.php? ... 23#4087923
User avatar
hourheroyes
Posts: 346
Joined: Mon, 9. Apr 12, 05:14
x4

Post by hourheroyes »

So I just downloaded this mod to try it, running XRM, and I got 10 traders set up but they just keep going further into negative profit :( :( :(

Is something going wrong here, or do I need to be patient? It seems like they're making OK trades.
Treelor
Posts: 315
Joined: Mon, 5. May 08, 01:25
x4

Post by Treelor »

Nothing wrong, I think. If you buy a trader, the cost of that ship is deducted from the global trade balance. They should make it up over time. If they're making trades that are dropping the balance, though, then they aren't making OK trades.
Shimrod
Posts: 907
Joined: Tue, 18. Feb 03, 01:43
x4

Post by Shimrod »

It's normal for trader balance to go negative to begin with. It starts off at zero and goes negative when the trader buys a jumpdrive, fuel and its first load of wares.

The price of the ship itself and existing equipment won't be deducted though. The balance just tracks trades the trader has made while running OK trade.

If the trader balance never climbs back up after it actually starts selling stuff that's definitely a problem. So yes allow the ships some time to recover their initial costs, but if it remains negative then do let me know. I'll keep an eye out.

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