[TC][AP][Script][AL] LI Freight Distribution Network (FDN) – v8.04

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

Post Reply
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

[TC][AP][Script][AL] LI Freight Distribution Network (FDN) – v8.04

Post by Logain Abler » Mon, 21. May 12, 10:56

Logain Industries Freight Distribution Network (FDN) v8.04


Introduction:
Logain Industries FDN is a freight storage and distribution solution able to support the production infrastructure of any organisation.

Gate Network Integration:
Advancements in teleportation technology pioneered by Logain Industries have enabled direct integration with the Gate network.

Quantum Virtual Storage:
Logain Industries have made ground-breaking advancements in the principle of Ethereal Quantum State Storage and Solid-State Quantum-Memory Matrixes to indefinitely hold the propertied of object in virtual storage.

The marriage of the two Technologies enables FDN to store and distribute freight to all stations with Teleportation technology across the known Gate network


Info:
This is a script only version of FDN which does not require the use of a Mod, as a script it should have no Mod comparability issues.


X3 Version:
FDNv8 has been written to work with both X3:TC and X3:AP, the only difference between the two versions is the custom menus. The appropriate menu will be called for the game version.


Required Utilities:
FDNv8 requires Community Plugin Configuration by Cycrow.


Download Links:
[ external image ]


Technical Info:
Script uses file 9910-L044 for text strings
Script uses file 09910 for Log File


Install of script files:
Manually install files from the script.zip. This link contains a guide for installing script files manually.
Great guide also by Cycrow link


Turn on AL Plugin:
Great guide by LV shows how to turn on an AL Plug-in link


Compatibility with Production Modules:
FDNv8 is not currently compatibility with the existing PM supply process, due to the virtual stock management in v8 it won’t be until re-written to do so.
There is however work around, FDNv8 enables virtual storage on all docks the movement of wares to and from the PM can be managed within FDN.

By setting a maintained level on the PM/Dock to take into account wares used as resources and setting product wares to be sent to the DC the movement of wares can be simulated.


Thanks:
- To everyone who has support, used, provide feedback, encouragement and help over the years
- Cycrow for Community Plugin Configuration
- LV for Googlecode hosting
- SS_T for X1TD
- wwdragon for his diligent testing
- DrBullwinkle for his lib.BW.isAP


Edit [1st Dec 2015]: replaced outdated x1tp download link with working one from xdownloads. X2-Illuminatus
Last edited by Logain Abler on Tue, 21. Aug 12, 20:10, edited 31 times in total.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Change Log

Post by Logain Abler » Mon, 21. May 12, 10:56

[Change Log]:
Test Build 0000 - 30/05/2012
Test Build 0010 - 03/06/2012
Test Build 0030 - 10/06/2012


FDNv8.00 - First Release - 16/06/2012
FDNv8.01 - Transfer ware to HQ fix - 17/07/2012
FDNv8.02 - Null value fix in Factory supply - 21/07/2012
FDNv8.03 - Tweaked factory supply for large number of stations - 14/08/2012
FDNv8.04 - Fix reset issue - 21/08/2012
Last edited by Logain Abler on Tue, 21. Aug 12, 20:11, edited 36 times in total.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Mon, 21. May 12, 10:57

[User Guide]:
First draft 30/05/2012

Welcome and thank you for choosing Logain Industries FDN as you’re scalable freight management, storage and distribution solution.
This is a script only version of FDN which does not require the use of a Mod, as a script it should have no Mod comparability issues.

Start FDN:
First turn on FDN via AL settings
Access FDN Menu via Cycrow's Community Plugin Configuration
Set a Dock to act as your Distribution Centre


Distribution Centre (DC):
The Distribution Centre is the heart of you're Freight Distribution Network and act as a centralised hub for the collection, management and distribution of wares to and from your Factories, Docks and Production Modules.

Features:
- There can only be one Dock designated as the DC but this can be changed as required
- The DC will monitor and manage the ware requirements at player owned Factories and Docks
- The DC can buy wares required to maintain production
- The DC can sell wares above a set threshold

Limitations:
- The DC will not monitor Complexes
- The buying and selling of wares will only cover the Sectors in which the player has a deployed Station or Advance Satellite


DC ware management options:
The following options are set at the ware level.

Remote Access past stock level – This is the level, which if set will limit access to the ware by none-production elements

Allow FDN to buy ware – This will allow the DC to buy the ware if required to maintain factory production, this is only called if there is insufficient wares held on the DC
Buy at/or below – This is the price at which or below which the DC will attempt to but the ware

Sell ware past stock level – This will allow the DC to sell the ware once the stock level is higher
Sell ware at/or above - This is the price at which or above which the DC will attempt to sell the ware

Move Ware – This will allow the user to move stock to any owned Station or Ship.

Note: All stock level inputs will accept 0 upwards; the value can be turned off with any negative number such as -1
Note: Wares will be removed from the virtual stock before the physical.


Factories:
- Factory Products and Resources can be managed by FDN
- If Products are selected to be FDN managed they will be removed and held centrally at the DC
- If Recourses are selected to be FDN managed they will be supplied to the Factory to maintain production

Auto Manage – with Auto Manage enabled all newly deployed Factories will have their Products & Resources set to FDN managed when first scanned by FDN.
This can be disabled at any time and manually managed


Docks:
- Docks will automatically be monitored by FDN which can manage their stock levels
- Quantum Virtual Storage is enabled on all Docks, with any Dock eligible to act as the DC
- All Docks will be able to sell wares via FDN with the same limitations as the DC, they will not buy wares
- Wares held in Docks will not be used to support production
- Surplus wares can be moved to the DC


Dock ware management options:
The following options are set at the ware level:

Maintain stock at level – This is the level, which if set will limit access to the ware by none-production elements

Pass Surplus to Distribution Centre – This will allow all surplus stock (any stock above the Maintain stock level) to be passed to the DC
Note if set to ‘0’ all stock will be sent to the DC.

Sell ware past stock level – This will allow the Dock to sell the ware once the stock level is higher
Sell ware at/or above - This is the price at which or above which the Dock will attempt to sell the ware

Move Ware – This will allow the user to move stock to any owned Station or Ship.

Note: All stock level inputs will accept 0 upwards; the value can be turned off with any negative number such as -1
Note: Wares will be removed from the virtual stock before the physical.


Configuration Menu:
This menu sets global options:

Add/Change Distribution Centre – This is used to specify which Dock will act as the DC, this can be change at any time

Auto Manage Factories – If on FDN will automatically manage Products & Resources on Factories when first found by FDN

Dynamic Menus – This allows the player to turn on and off the three dynamic menus

Supply Debug – This allows the player to turn on and off the debug logging of the supply process

Mater Reset – This will set all FDN values to default, this will also purge all virtual stock values



Compatibility with Production Modules:
FDNv8 is not currently compatibility with the existing PM supply process, due to the virtual stock management in v8 it won’t be until re-written to do so.
There is however work around, FDNv8 enables virtual storage on all docks the movement of wares to and from the PM can be managed within FDN.

By setting a maintained level on the PM/Dock to take into account wares used as resources and setting product wares to be sent to the DC the movement of wares can be simulated.



[FAQ]:
Q - Does FDN v8 require a mod file like pervious versions?
A - No, this is a script only version. The original FDN bypassed the inherent ware limit on Docks by using modified HQ’s for increased storage, with the newly implemented Virtual Storage the workaround is not longer needed. This also means FDN v8 will not have the Mod compatibility issues of previous versions

Q - What is Remote Access used for now; can you give an example, please?
A - Remote access is used to limit non-production access to stock, so in this case Docks, I think this is critical to ensure that wares required for production are not lost. I will be writing supply script which can be called by other scripts; again they will only be able to remove wares above the remote access level

Q -What level of resources does FDN supply and maintain at Factories?
A - FDN will maintain 3 * the resources required per cycle, or the maximum amount that can be held by the Factory, whichever is the lowest

Q - Why 3 * the required resources?
A - FDN uses a centralised scan to check the Factories, 3 * the resources allows for skipped scans where the Factory doesn't meet the supply criteria

Q - Why only 1 Distribution Centre?
A - Simplicity. Multiple Nodes (as they were in previous versions) or Distribution Centres add to complexity of code and complexity of use. With virtual storage enabled on all Docks there is not need for multiple instances

Q - What is Virtual Storage and how does it work?
A - Good question, the answer too which even I don't know... It's a simple idea, once the physical storage is full FDN will hold wares as a local variable on the object (currently limited to Docks) updating the amount to take into account ware transfers. FDN will always remove from Virtual as first choice and add to Physical as first choice

Q - What is the limit to the amount of a ware held in virtual storage?
A - Under testing the limit is 2,147,483,647, fill it I dare you!

Q - Is there a limit on the number of sector the DC can support like previous versions?
A - No, if you can see it so can FDN, there are no limits or Advance Satellites required to supply Factories and Docks

Q - Why does FDN not work with Complexes?
A - Because I hate them, seriously their the only reason FDN exists

Q - What should I do if I have a Complex I want FDN to supply?
A - I’d suggest saving the game and destroying the Complex Hub. You can always revert back to your save

Q - Why is it when I change which Dock is DC the change doesn't seem to take effect immediately?
A - Some changes do take immediate effect, such as the supply of wares to Factories and the buying of ware. If the DC is changed in the middle of a cycle selling wares the resulting sale will stay with the original location, not move to the new DC which didn't initiate the original sale. The sell cycle is staggered so it doesn't hog the games resources and depending on the number of ware to sell and the amount involved could take a while to complete
Last edited by Logain Abler on Wed, 1. Jan 14, 14:27, edited 53 times in total.

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Mon, 21. May 12, 12:15

Any chance this could also be attached to a TL or in fact any ship, and include the storage and moving around of Marines ?

2 reasons.

Virtual storage for TL's for those doing mega-complex creation so they can add all of the stations they want in one trip ?

And the ability to store Marines globally so any ship that uses them can call back the best of them as many times as they need marines. It would need ship commands to add marines into the global pool, and get the best ones back. The existing restrictions on how many marines a shiop can have are a joke (imo) and I've been trying to figure out how to do exactly what your going to do with wares, only just with marines. If you could include ships and marines, then it solves that problem as well.

On ships, it also would solve the whole restricted cargo bay problems.

Zonzo
Posts: 120
Joined: Mon, 13. Aug 07, 23:02
x4

Post by Zonzo » Mon, 21. May 12, 15:32

Logain Abler wrote:
Zonzo wrote:After giving thought a little. Logain, is it possible make FDN work in 2 modes?
1. Automatic - Current, no changes.
2. Manual, all wares must be entered in to FDN manually, also cap limit will be followed. And when FDN starts polling fabs/stations, wares what missing on FDN list will be ignored. Currently FDN has self wares discovery.
I kept looted missiles in production complex and when I linked it in to FDN network. Closest node pulled all missiles in. Grrrr... :D
IMO that would help deal with transfer glitch and over stocking. Also when stock is reached and if other FDN's wont accept ware, leave wares to fab/complex. When fab/complex stock is full then production stops buy it's self.
I'm looking at a balance, I think people will get frustrated adding wares to FDN manually.

So FDN will still self discover all the wares the player produces or requires, FDN will see all Factories (Not Complexes) but will only manage their resources & products if told too.

There will be only one 'Node', now Distribution Centre (DC), there will be no Trade Posts as FDN will treat all docks the same (and all docks will have virtual storage). Currently I can easily change which Dock is the DC at will.

The management of wares will be similar to the current version, but with better handling of the levels such as remote access cap and sell cap.

I'm nailing down the bones of the UI at the moment.


LA
I'm bringing this here. Still Logain, auto discovery is good but pulling all in to FDN network is not so good.
Li Complex I mentioned, I was making and storing there stuff for The Hub plot.
Already had stored 450K Teladium, over 200K Micro chips, something around 100K Crystals, ore, silicon. Plus shields, weapons, ammo, missiles. All together over 10 mil storage space.
If FDN pulls all that stuff in to network, can you imagine hassle sorting out all wares. That's why my complex wasn't connected to FDN network. I was forced use separate mine for mining minerals and 2 CLS ships. One dealt with ore and silicon and other with ecells.
Still some kind logic is needed that FDN network won't pull in every thing, especially what players making for their own needs.
Last edited by Zonzo on Mon, 21. May 12, 15:51, edited 1 time in total.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Mon, 21. May 12, 15:39

Zonzo wrote:
Logain Abler wrote:
Zonzo wrote:After giving thought a little. Logain, is it possible make FDN work in 2 modes?
1. Automatic - Current, no changes.
2. Manual, all wares must be entered in to FDN manually, also cap limit will be followed. And when FDN starts polling fabs/stations, wares what missing on FDN list will be ignored. Currently FDN has self wares discovery.
I kept looted missiles in production complex and when I linked it in to FDN network. Closest node pulled all missiles in. Grrrr... :D
IMO that would help deal with transfer glitch and over stocking. Also when stock is reached and if other FDN's wont accept ware, leave wares to fab/complex. When fab/complex stock is full then production stops buy it's self.
I'm looking at a balance, I think people will get frustrated adding wares to FDN manually.

So FDN will still self discover all the wares the player produces or requires, FDN will see all Factories (Not Complexes) but will only manage their resources & products if told too.

There will be only one 'Node', now Distribution Centre (DC), there will be no Trade Posts as FDN will treat all docks the same (and all docks will have virtual storage). Currently I can easily change which Dock is the DC at will.

The management of wares will be similar to the current version, but with better handling of the levels such as remote access cap and sell cap.

I'm nailing down the bones of the UI at the moment.


LA
I'm bringing this here. Still Logain, auto discovery is good but pulling all in to FDN network is not so good.
Li Complex I mentioned, I was making and storing there stuff for The Hub plot.
Already had stored 450K Teladium, over 200K Micro chips, something around 100K Crystals, ore, silicon. Plus shields, weapons, ammo, missiles. All together over 10 mil storage space.
If FDN pulls all that stuff in to network, can you imagine hassle sorting out all wares. That's why my complex wasn't connected to FDN network.
Still some kind logic is needed that FDN network won't pull in every thing, especially what players making for their own needs.

FDN will still self discover all the wares the player produces or requires, FDN will see all Factories (Not Complexes) but will only manage their resources & products if told too.

If you don't tell FDN to manage the product of a factory, it won't remove it, if you don't tell FDN to manager the resources o a factory it won't supply them.

Does that not cover your concers? It will also ignore complexes.

LA

Zonzo
Posts: 120
Joined: Mon, 13. Aug 07, 23:02
x4

Post by Zonzo » Mon, 21. May 12, 15:54

OK, thanks. Let's see what is coming up. I can always find work around if it is not working as I want. :P

wwdragon
Posts: 3746
Joined: Mon, 1. Oct 07, 02:18
x4

Post by wwdragon » Mon, 21. May 12, 19:41

Please fix Production Modules equipment bugs before doing this. :!:

I think this new FDN should use physical storage on the node. How else can I pick up the 100 Advanced Sats or whatever else I'm storing on it for personal use?
Editing posts since long before I remember.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Mon, 21. May 12, 20:55

wwdragon wrote:Please fix Production Modules equipment bugs before doing this. :!:

I think this new FDN should use physical storage on the node. How else can I pick up the 100 Advanced Sats or whatever else I'm storing on it for personal use?
You will be able to manual transfer from virtual storage to any player owned station or ship.

No need to dock.

LA

wwdragon
Posts: 3746
Joined: Mon, 1. Oct 07, 02:18
x4

Post by wwdragon » Tue, 22. May 12, 03:16

Oh, interesting. :)

Will you make that accessible via a quick interface hotkey?
Editing posts since long before I remember.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Tue, 22. May 12, 10:42

wwdragon wrote:Oh, interesting. :)

Will you make that accessible via a quick interface hotkey?
I'm currently using Cycrow's excellent plug-in manager.

LA

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Tue, 22. May 12, 22:59

Virtual storage on the distribution centre and docks is up and running, as is the first build of the supply logic between factories and the distribution centre.

It's small scale testing at the moment with basic supply chains but it's looking very promising. The logic involved in managing the inter-play between physical and virtual storage was/is surprisingly simple.

The logic for supply between factories and the distribution centre was/is surprisingly simple, so much so that I'm sure I've missed something!

The AL timer fires a script that check a factory & dock arrays exists (updated each time the menu opens), if the factory array exists a script is called that cycle through the factories, it checks settings, if the station is close to completing a production cycle or if stalled. If it passed the checks at this point the script starts a separate script that handles the movement of ware. I would guess that the over-heads involved will be minimal, and a lot less than the current FDN set-up, but stress testing needs to be done.

LA

wwdragon
Posts: 3746
Joined: Mon, 1. Oct 07, 02:18
x4

Post by wwdragon » Wed, 23. May 12, 09:43

Sounds like its going really well. 8)

Will it tie seamlessly into PM's? They are working well for me now, asside from ship equipment.

The only problems with the old FDN are:
1) It keeps tossing wares around to the smaller nodes, even when I've told it to only keep them in my main, XL Node.
This won't be a problem with only one distro center. :)

2) It doesn't respect the Maintain Local Stock level settings. It keeps swiping stuff and then re-feeding it back when the PM cycles. :x
Please make sure this new one doesn't take things when it's below the Keep Locally level!

3) It's just not selling things, even though I know there's plenty of buyers.
I think the script might be stalling when it does the search. :?
Hopefully this'll be fixed by the singular, central place.
Perhaps you should make it's search function a stepped, universe wide one that checks each ware in turn and takes about a minute to go through each ware availabililty/sellability?

Thanks for making it! Hope you're healing up well.
Editing posts since long before I remember.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Wed, 23. May 12, 11:04

wwdragon wrote:Sounds like its going really well. 8)

Will it tie seamlessly into PM's? They are working well for me now, aside from ship equipment.
It should do, PM uses a FDN script for moving wares, and this will be updated. Yet to be done.
wwdragon wrote: The only problems with the old FDN are:
1) It keeps tossing wares around to the smaller nodes, even when I've told it to only keep them in my main, XL Node.
This won't be a problem with only one distro center. :)
Yes, one Distribution Centre solves -all the Node to Node issues, it simplifies everything. Not sure why I didn’t come up with virtual storage before….
wwdragon wrote: 2) It doesn't respect the Maintain Local Stock level settings. It keeps swiping stuff and then re-feeding it back when the PM cycles. :x
Please make sure this new one doesn't take things when it's below the Keep Locally level!
FDN enables virtual storage on all Docks, I’ve done this to simplify the interaction between FDN & PM. I will be re-writing PM to take into account virtual storage and have more robust ware management.
In the short term I aim to make the new FDN work with the current version of PM…. Fingers crossed
wwdragon wrote: 3) It's just not selling things, even though I know there's plenty of buyers.
I think the script might be stalling when it does the search. :?
Hopefully this'll be fixed by the singular, central place.
Perhaps you should make it's search function a stepped, universe wide one that checks each ware in turn and takes about a minute to go through each ware availabililty/sellability?
The buy and sell feature will be re-written once I’m happy with the core features.

LA

wwdragon
Posts: 3746
Joined: Mon, 1. Oct 07, 02:18
x4

Post by wwdragon » Thu, 24. May 12, 01:43

*thumbs up* :)
Editing posts since long before I remember.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 24. May 12, 09:30

apricotslice wrote:Any chance this could also be attached to a TL or in fact any ship, and include the storage and moving around of Marines ?

2 reasons.

Virtual storage for TL's for those doing mega-complex creation so they can add all of the stations they want in one trip ?

And the ability to store Marines globally so any ship that uses them can call back the best of them as many times as they need marines. It would need ship commands to add marines into the global pool, and get the best ones back. The existing restrictions on how many marines a shiop can have are a joke (imo) and I've been trying to figure out how to do exactly what your going to do with wares, only just with marines. If you could include ships and marines, then it solves that problem as well.

On ships, it also would solve the whole restricted cargo bay problems.
I see no reason why Virtual Storage wouldn’t work on ships, factories, or any object in-game.
There would need to be a monitor script to move ware between Physical and Virtual.

LA

User avatar
apricotslice
Posts: 14129
Joined: Sun, 16. May 04, 13:01
x4

Post by apricotslice » Thu, 24. May 12, 09:45

Marines would be a bit different to normal wares. They could be collected automatically, but there would need to be a manual method of triggering the return of marines to the ship wanting to use them, preferably in order of best trained down. If not used for say 30 minutes, they get virtually stored again.

Once stored though, it would be simple to do an additional script that trains the marines while in virtual. :)

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 24. May 12, 17:23

Soon early screenshots of the three main menus.

The Distribution Centre:
http://i547.photobucket.com/albums/hh46 ... C_Menu.png

The Factories List:
http://i547.photobucket.com/albums/hh46 ... y_Menu.png

The Docks List:
http://i547.photobucket.com/albums/hh46 ... t_Menu.png


All the menus are called and created within the one main menu.
The ware values are dynamic, the virtual stock levels are in orange.
The three main menus are navigated by switching between the three top layer views, the sub menus (Factory, Dock and Ware details) are also built within the main menu but returned to the the originating menu.

Early days but the feel is not so far away from the previous version.


LA

wwdragon
Posts: 3746
Joined: Mon, 1. Oct 07, 02:18
x4

Post by wwdragon » Thu, 24. May 12, 18:33

Looks good. I hope you will still have a max storage for virtual amounts.

Something I've noticed about pms research is the rather massive amount of units of an object needed and credits needed to reverse engineer it. It takes 10 minutes to RE anything.
This doesn't make sense on either side. The only cost after you have a few of the object should be some minor expenses for tools or testing(less then 1mill for anything), while the time to reverse engineer should be the main investment, with it varrying based on the complexity of the object.

Think about taking stuff apart and putting it back together in RL. You might break your radio taking it apart, but you'll learn how it works. just takes time and a couple tools. :wink:

Please go with this time based modifier when you re-write pm after this.
Editing posts since long before I remember.

Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler » Thu, 24. May 12, 19:07

wwdragon wrote:Looks good. I hope you will still have a max storage for virtual amounts.

Something I've noticed about pms research is the rather massive amount of units of an object needed and credits needed to reverse engineer it. It takes 10 minutes to RE anything.
This doesn't make sense on either side. The only cost after you have a few of the object should be some minor expenses for tools or testing(less then 1mill for anything), while the time to reverse engineer should be the main investment, with it varrying based on the complexity of the object.

Think about taking stuff apart and putting it back together in RL. You might break your radio taking it apart, but you'll learn how it works. just takes time and a couple tools. :wink:

Please go with this time based modifier when you re-write pm after this.
To be honest the R/E time was a compromise, I couldn't work out a constant time scale based on the object. My focus was mass ware production to support drone production for SSDN, R/E was purely secondary as was ship, station and equipment.
PM was a complete beast to write and I don't expect the re-write will be any different, hopefully the magic power of hindsight +10 will help!
As for the cap on Virtual Storage, I must ask why? The idea of VT is to make FDN purely script based and to work on any in-game dock and bypassing all the issues that came with modded docks.
I can do it, it's a simple addition to the logic but it's just another configuration option to catch people out, that's one thing I've learnt is that flexibility can and in most cases just adds to complexity....

Having said that I'm always open to ideas (apricotslice was the spark behind a singe "Node") and if I can I'll try to add features if they work within the core idea of FDN.


LA :)

Post Reply

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