BETA Release - Factory Loop Delivery Software - v0.12

The place to discuss scripting and game modifications for X²: The Threat.

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

Post Reply
Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

BETA Release - Factory Loop Delivery Software - v0.12

Post by Nazgutek » Mon, 28. Mar 05, 15:01

Download Factory Loop Delivery Software v0.12 from:
http://www.blackcat.eclipse.co.uk/x2/pl ... .v0.12.zip

What does FLDS (for short) do?

It allows you to link factories to a 'Hub' factory to create a loop. Ships assigned to a Hub homebase can then deliver any wares produced by any of the factories in the loop to any factory in the loop that needs them. No need to assign ships to every station.

It's been designed to be easy to use. You link stations via the command console of your chosen 'Hub' station. All a ship needs is a homebase when you run the FLDS command. It doesn't ask you 184 times for various factories and wares, it can work that all out from the list of factories held by its homebase.

It's been designed to reduce the number of transport ships you need. Because a ship working a loop can pickup produced wares from any of the producers and deliver them to any station that needs them, you don't need one ship per factory. Whilst developing and testing FLDS, I had one lonely Mercury doing all the shipments for a close-packed loop (Power Plant, Cattle Ranch, Cahoona Bakery, Crystal Fab and Silicon Mine), and it kept the loop running.

Comments and bug reports are very very welcome. I have provided a german text xml file, but it's all in english. I will attempt to get a german translation done once I know the code settles.

Fixes/Changes in v0.12:
- Fixed a possible race-condition when accessing a local variable held by a Source or Destination station.
- Equipment Docks and Trading Stations will now be recognised as a valid recipient of a produced ware, and their needs will be 'critical' below 99% of what they can store. Be careful when linking Trading Stations, as they could suck all your resources out of your loop. This change allows you to get a loop to deliver finished ship equipment to a Dock as soon as possible.
- Transports now handle wares left in their cargo bays. However, they won't deliver a ware if that ware is not produced by one of the linked stations in the loop. It's a pain to actually get a list of what wares a ship is carrying.
- Transports will finish FLDS, and refuse to start it, if less than 10% of their total cargo capacity is free after a delivery. You really don't want that Split Caiman shipping 60 energy cells at a time...
- Transports will finish FLDS, and refuse to start it, if the hull drops below 80%.
- New method for working out if a route is not worthwhile. This includes basing the critical level of a resource on the amount of product a factory can produce. So resources of a BPPC Forge will be 'critical' below 50%. The minimal critical level is 5%.
Last edited by Nazgutek on Wed, 30. Mar 05, 22:57, edited 4 times in total.

Carl Sumner
Posts: 5112
Joined: Mon, 23. Feb 04, 02:28
x4

Post by Carl Sumner » Mon, 28. Mar 05, 22:12

Sounds good! :D
Tinker

"If engineers built buildings the way programmers write programs, the first woodpecker that came along would destroy civilization!"

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Post by Nazgutek » Tue, 29. Mar 05, 00:59

OK, already discovered a bug on an eyeball-debug of the code. The ship script modifies a local variable array outside the critical section, and another ship could be reading the same array at the same time.

This could result in either a ship thinking there's enough ware to pick up (when it finds out there isn't, it merely adjusts to the available amount and carries on), or the destination has enough room for the ware it has onboard (which will result in the ship failing to unload, notifying the player of this, and stopping FLDS on that ship).

Fixing this is actually dead easy, but it's midnight here, so I'll deal with it tomorrow.

User avatar
ajsarge
Posts: 528
Joined: Sun, 11. Apr 04, 09:01
x3tc

Post by ajsarge » Tue, 29. Mar 05, 03:08

This will really help my loop! While I only have one, it is a pain to have all those SDS ships flying about, just waiting to get killed.

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Post by Nazgutek » Wed, 30. Mar 05, 13:57

The race-condition bug is fixed, and is already in v0.12. Other changes/addons I'm currently working on for v0.12:

1) Transports dealing with wares left onboard if a station in the loop needs them,
2) Transports stopping work (and not starting) when their hull is below 80%, and notifying the player,
3) Including Equipment Docks and Trading Stations as valid places to deliver wares, and making shipments to those more important,
4) Improving the "detect worthwhile shipment" code to avoid unnecessary shipments, for example, 50 energy cells.

The hold-up on v0.12 is the first (which ironically affects the fourth), but it hopefully won't be long in being done.

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Post by Nazgutek » Wed, 30. Mar 05, 18:51

v0.12 has been packaged up and is available for download. Original Post has been edited to reflect new version.

Galaxy613
Posts: 2517
Joined: Tue, 28. Dec 04, 03:19
x3

Post by Galaxy613 » Wed, 30. Mar 05, 19:10

Sounds really usefull Nazgutek! :D Tho I don't own many stations (partly because I don't really have a game going... >.> ) So I don't think I'll use this much. But maybe later when I'm not so confused in my life. :shock:
10,000 Lightyears of awesomeness

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Post by Nazgutek » Thu, 31. Mar 05, 16:26

Not had much feedback yet. Yes, it's still a BETA, but from the testing I've managed to achieve so far, it doesn't crash my game or testbeds, and performs shipments as I would expect.

Now, the one factor that FLDS doesn't have is paying for wares when shipping them. And I'm thinking on how to implement pricing. However, I'd love to hear any ideas on the following points:

1) Keeping the amount of 'data entry' the player needs to do to a minimum

2) Prices set by ware type, set per producing factory, set per receiving station, or set per possible route?

I'm thinking of implementing a simple-to-use system where when you select a station to link to a Hub, it asks for a ware price. That price is assigned to any ware that linked station produces, no matter which station receives it. If you enter a negative number, that be the way to unlink a station (and if you give your hub a negative number, it unlinks every station).

This would allow an incomplete loop to keep money flowing from a selling station to stations that buy outside resources, but I'm wondering if it would be too limited?

Thoughts, suggestions, ideas, feedback and comments all welcome, as are any bugs you find...

m0nkey
Posts: 57
Joined: Fri, 3. Dec 04, 13:40
x2

Thanx god been praying lol

Post by m0nkey » Thu, 31. Mar 05, 17:12

He really good script dude just what i need currently have about 8 stations all looped in one sector . Have just put in a trading dock so your software will make life s0oooo much easier. Will give it a go let you know how it turns out thxs :D
So i said to her "The Force runs stromg in my family"

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Post by Nazgutek » Thu, 31. Mar 05, 17:15

After a discussion with tramsan (who's never posted here but that's irrelevant), another possible solution came to light. Many thanks to tramsan for pointing out that you don't really care as long as credits get balanced somehow in the loop :wink:

Instead of pricing wares within the loop, I could just add a feature that sets a stations credit balance to an amount specified by the player. Money would move from and to the Hub station as set by FLDS, and the Hub can be given a minimum balance and a maximum balance to have. Credits would then flow from Hub to or from the players main account.

So if you had an incomplete loop that needs to buy an outside resource, and sells a product (for example, missiles), FLDS could then keep factories cashed-up so they can buy the outside resources, and profits would accumulate at the Hub for that chain.

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Re: Thanx god been praying lol

Post by Nazgutek » Thu, 31. Mar 05, 17:17

m0nkey wrote:Have just put in a trading dock so your software will make life s0oooo much easier.
Be careful with that Trading Dock. It will probably suck up all the wares inside your loop if you link it in. If you only want a certain product to go to the Trading Station, use the Trading Station as a second Hub, and link the producer to it.

User avatar
TSM
Not a Moderator
Posts: 1766
Joined: Thu, 1. Jul 04, 12:31
x4

Post by TSM » Fri, 1. Apr 05, 14:15

Pretty impressed with what I have seen so far with this script, am I currect in assuming if you had a crystal fab in your loop and all the other factories the the fab require were in that loop the FLDS would keep fab suppiled without any further input?
FAQ's Egosoft Interactive FAQ
Egosoft Wiki

Nazgutek
Posts: 127
Joined: Wed, 16. Mar 05, 11:42
x3tc

Post by Nazgutek » Fri, 1. Apr 05, 15:50

TycoonSpaceMan wrote:Pretty impressed with what I have seen so far with this script, am I currect in assuming if you had a crystal fab in your loop and all the other factories the the fab require were in that loop the FLDS would keep fab suppiled without any further input?
FLDS will ship wares if (a) a factory produces it and (b) another factory needs it. It will ship any and all wares that meet that requirement. In what order it ships them is a rather more complicated answer.

So for your Crystal Fab, if it is linked into the same loop as a silicon mine, food factory and power plant, then FLDS will supply what it can from those factories to the Crystal Fab.

User avatar
TSM
Not a Moderator
Posts: 1766
Joined: Thu, 1. Jul 04, 12:31
x4

Post by TSM » Fri, 1. Apr 05, 17:06

Cool :D , some major loops going in my game then :roll:, including 2 loops with same factories one with FLDS and other with ASDS see which is the more efficent FLDS is obviously going to use less ships but we will still get idea of efficency :wink:
Last edited by TSM on Sat, 2. Apr 05, 13:45, edited 1 time in total.
FAQ's Egosoft Interactive FAQ
Egosoft Wiki

User avatar
Burianek
Posts: 2928
Joined: Mon, 29. Dec 03, 04:29
x3tc

Post by Burianek » Sat, 2. Apr 05, 03:21

TycoonSpaceMan wrote:one with FLDS and other with ASDS see which is the more efficent FLDS is obviously going to use less ships but we will stiff get idea of efficency
how come aSDS will use more? :gruebel:
"Nature's first green is gold" . . . stay golden.

Post Reply

Return to “X²: The Threat - Scripts and Modding”