[MOD/Script] LI Production Modules (PM) - v7.2 29/08/2010

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

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

Post by Logain Abler »

Requiemfang wrote:Just a quick question about what factories you can't install

Ore, Water and Silicon can't be added to PM modules correct? because they require a rock to be placed on?
Yes thats true. You can use PM to build the mines, but not the product.

LA
Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang »

Thought so, just wanted to confirm my suspisions on this, means I'll have to complex my mines and have them transport the ore, silicon and ice to the PM I have set up
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

Requiemfang wrote:Thought so, just wanted to confirm my suspisions on this, means I'll have to complex my mines and have them transport the ore, silicon and ice to the PM I have set up
Not if your using FDN, and its in range ;)

LA
Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang »

Indeed, I plan to get those set up asap that way I can start converting the products of the PM into credits :twisted:
JoeTheDestroyer
Posts: 36
Joined: Wed, 14. May 08, 01:40
x3tc

Post by JoeTheDestroyer »

Glimpse wrote:- Currently many scripts add their own consumables and custom wares.So instead of creating factories for them,we could reverse engineer that ware and add it to blueprints for production with balancing resources.Much like energy cells and silicon for a tech subtype ware and some random bio for food type ware.

Of course you know much better than what I could think of balancing and performance side so they are just there as ideas.No pressure or anything.And for balancing,you can take all the credits I have but please don't make me build millions of factories to mass produce some point singularity projectors and M2 battleships!
It's funny you should mention this, I'm just finishing up my own modification to PM to add this. I was going to ask Logain if he had any interest in looking it over for inclusion...

The ware research should be pretty general and work for custom wares as well (with a few exceptions). I've basically divided all the wares into their maintypes (laser,shield,etc) and done curve fits to predict factory prices. The total research cost is then 3x the (predicted) factory cost. 10% of this is paid in credits and the other 90% is provided by some number of the ware to be researched (equivalent to the 90% value). If that number of wares isn't available, the difference can be made up in credits. However, the cost goes up quadratically, up to 35x if you only have one sample available.

For example, say you wanted to research the Phased Array Laser Cannon. Normally this research would require 47x PALC and 3,886,892 credits. However, without cheating or modification, you can only get 2x PALC (during Final Fury). You can still do the research with those two, but the fee will now be 357,222,747 credits.

The "balancing resources", as you call them, are determined automatically. The algorithm searches through all the factories in the game, first for ones producing the exact ware, then, if needed, for one producing a ware with the same maintype. There are script commands that add the approriate resources. Then, if needed, I replace the factory's product with the desired one and the game automatically adjusts cycle times, etc. I also replace the food (if there is any) with the one selected in the PM options, so the player can control what kind of food they need. (This also lets the player have all their factory modules use the same food type, if they want to pay a premium.) This algorithm works in my testing, but I've only been testing for lasers, shields, missiles and ammo.

The biggest flaw is that I can't really handle Tech wares (SSTYPE_W_TECH) in a general way. The problem being that there are a number of sub-categories in this maintype. Although I do handle each of the categories, I was forced to hardcode which wares went into which categories so any custom wares in this maintype will be ignored. If anyone can suggest a better way to handle this, I'm all ears! Also, the curve fits aren't very precise (some of the tech wares are +/- 40%), but I've tried to set the cost factor (3x) high enough so that research will always be more expensive than just buying and salvaging a station.

In addition to wares research (blueprint creation), I also added production research (blueprint improvement). This allows you to take any ware blueprint (whether from research or salvaged) and increase its size. The research cost is 1.5x the new factory price minus the old factory price. Base factory price is calculated using the same mechanism above (which gives the price for an S-sized factory). The factory price is then calculated using a factor I determined by fitting a curve to the average cost ratios S->L and L->XL for factories already in the game:

Code: Select all

  Code | Size  | Cost Factor
     S |   1xS |  1.0
     M |   2xS |  1.8125
     L |   5xS |  4.25
    XL |  10xS |  7.5625
   XXL |  20xS | 12.125
   5XL |  50xS | 19.5
  10XL | 100xS | 25.25
Comments welcome, of course. I'm especially interested in others opinions on the various costs.
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

The new grouped module build time reduction for ship & station production is up and running.

I can build a Colossus in just under 36 minutes using 99 modules.
99 is the max limit of modules allowed for a single Ship/Station type.

I have only a few outstanding bits to finish (some option menu stuff and the link into FDN) and I'll be into full testing with FDN.

I already have normal ware production running on a PM which is also an FDN node, make the supply issues so easy.


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

Post by Logain Abler »

@ JoeTheDestroyer

Wow. Lot to take in there, but it looks like you've been busy!

The first version of PM I built (but never released) built ware blueprints by searching the universe for existing productions then cloning the settings (I think its mentioned in the first few posts). Sounds a bit like your approach, but it also sounds like you've had more progress than I ever did.

The new version of PM is not far off complete, but there has been no change to the salvaging process.

I'd be interested to see how you've modified PM. I hope dismantling my messy scripts didn't give you to much of a headache? Glad you thought it worthy of the effort.

LA
JoeTheDestroyer
Posts: 36
Joined: Wed, 14. May 08, 01:40
x3tc

Post by JoeTheDestroyer »

Logain Abler wrote:The first version of PM I built (but never released) built ware blueprints by searching the universe for existing productions then cloning the settings (I think its mentioned in the first few posts). Sounds a bit like your approach, but it also sounds like you've had more progress than I ever did.
I suspected this when I saw a number of entries in the t file that seemed somewhat related to what I was doing.

I started off thinking I would scan existing factories, as you said. However, later I realized that method might miss some factories that had existed but been destroyed (Pirate IBL forges, for example). So I added a second scan that spawned every station in the SSTYPE_FACTORY maintype and checked it. I left the original scan thinking it might speed things up (not having to spawn a bunch of stuff), but it turns out it was actually slower. So now all I do is pick an out of the way sector (one the player isn't in) and spawn every factory and check it against the conditions I spoke of previously.

The scan takes about 10sec on my laptop. I considered doing a single scan and caching the results, but rejected this because it would then be unable to adapt to later patches/mods that add/change factories.
Logain Abler wrote:I'd be interested to see how you've modified PM.
I'll pm you a link to the code and summarize here.

I actually didn't change much at all in the PM code itself. I added a "research" command to plugin.MPM2.Salvage.Task that appends the single blueprint passed to the ware blueprints array when time has expired. I added a "research" module type and updated plugin.MPM2.Menu.Values and plugin.MPM2.Repair.Menu.Dynamic to show them in the Salvage and Repair summary screen. Finally, in plugin.MPM2.Host.Menu I added a "Configure Research modules" option and changed "Active Salvage and Repair modules" to read "Active Salvage, Research and Repair modules". That's it for changes in the base PM code.

I also added 3 script files. The main gui that lets you select wares or blueprints to research is in plugin.MPM2.RnD.Menu. A detail menu that shows the costs and results of the select research is in plugin.MPM2.RnD.Details. Both of these are based (heavily) on the similarly-named salvage scripts. All the business logic including factory price prediction and blueprint generation is in plugin.MPM2.RnD.Calcs.

All of my text changes/additions are currently hardcoded and not in the t file. I figured I could do that if you decided to use any of it (and if not, having it in a t file doesn't mean much for my personal use).

Also, during the scan I periodically display subtitle text with a % complete. This works for me since I know what is going on, but it may be confusing for a regular user because the menu disappears (and if you accessed PM through the station console as I usually do, it shows that while waiting). I may have to figure out your dynamic menus and create a "progress" menu so that users aren't confused.
Logain Abler wrote:I hope dismantling my messy scripts didn't give you to much of a headache?
Not at all, I'm pretty new to X scripting so it was a good learning experience. :)

The only thing that might have given me a headache would be if I had to write all of this in the in-game editor. Thank god (and Whimsy) for Exscripter...
Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang »

LA I have to say I am impressed now, this is the first time I was able to use PM for the first time and thanks to what I know and now that I know how to use this I'm basically deconstructing my complexes and opting for PM stations to take their place :P one hell of a way to beat the crap out of complexes since you just have one station with modules for production instead of dozens of plexed stations in system, also doesn't kill FPS when looking at the PM station as compared to a plex of 20+ stations. LOL but this is also dependent on where you have the plex to begin with. Terran space for example... the stations there already have a high poly count and already eat up FPS as is, lol I don't wanna add anymore FPS drop to the game.

That aside, I'll still have to plex my Ore, Silicon and Ice mines but I don't mind that at all

using this in conjunction with FDN, PM becomes powerful but plexing roid mines isn't that bad now anyways because of the asteroid fusion script, the large output yield of a roid the less mines I have to have in system now which is awesome.
Varek Raith
Posts: 331
Joined: Thu, 23. Aug 07, 21:33
x4

Post by Varek Raith »

The link is dead. :cry:
And the one to Apricot's site isn't the latest version, afaik.
Same with the unified menu script.
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

Requiemfang wrote:LA I have to say I am impressed now, this is the first time I was able to use PM for the first time and thanks to what I know and now that I know how to use this I'm basically deconstructing my complexes and opting for PM stations to take their place :P one hell of a way to beat the crap out of complexes since you just have one station with modules for production instead of dozens of plexed stations in system, also doesn't kill FPS when looking at the PM station as compared to a plex of 20+ stations. LOL but this is also dependent on where you have the plex to begin with. Terran space for example... the stations there already have a high poly count and already eat up FPS as is, lol I don't wanna add anymore FPS drop to the game.

That aside, I'll still have to plex my Ore, Silicon and Ice mines but I don't mind that at all

using this in conjunction with FDN, PM becomes powerful but plexing roid mines isn't that bad now anyways because of the asteroid fusion script, the large output yield of a roid the less mines I have to have in system now which is awesome.
Glad you like it, you hit on all the reasons I built FDN & PM in the first place.

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

Post by Logain Abler »

Varek Raith wrote:The link is dead. :cry:
And the one to Apricot's site isn't the latest version, afaik.
Same with the unified menu script.
I'll check the links.

LA

Edit: Link is back.
Varek Raith
Posts: 331
Joined: Thu, 23. Aug 07, 21:33
x4

Post by Varek Raith »

Thanks, I appreciate it.
8)
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

Thought I'd post a few screens of how things are looking:

Production Complex Menu: Production, Salvage & Repair Modules are now prefixed
[ external image ]

Ware Production Summary – Parent & Child Modules
[ external image ]

Parent Module Details - (Yellow figures are total resources including Child Module )
[ external image ]

Blueprint Menu – Wares & Equipment are prefixed with origination Race (Ar = Argon & so on)
[ external image ]

Blueprint Detail – Now can be deleted
[ external image ]

Had a real headache today over the FDN supply logic, set the PM as an FDN Node and then set it as its own default Node (so PM can sell its local surplus stock via FDN). Selling works well, but when it came to the PM querying the FDN network for resources it was checking and moving it's own stock and stalling.... lol
dpadula
Posts: 242
Joined: Tue, 15. Aug 06, 18:47
x4

Post by dpadula »

Well I am eagerly awaiting the new version here. I can't wait to be able to use multiple modules to build ships faster.
-----
Dell Precision 3600
12 gb ram
Nvidia 1060
256 gd boot ssd and 1 tb data ssd
Windows 10
dpadula
Posts: 242
Joined: Tue, 15. Aug 06, 18:47
x4

Post by dpadula »

I have a quick ship producing question. I had a PM and produced 10 ships at a time. After the first 10 the rest appear as a storage ware that I can not access as a ship. Is this a glitch or is it me? I am producing too many ships too fast?
-----
Dell Precision 3600
12 gb ram
Nvidia 1060
256 gd boot ssd and 1 tb data ssd
Windows 10
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

dpadula wrote:I have a quick ship producing question. I had a PM and produced 10 ships at a time. After the first 10 the rest appear as a storage ware that I can not access as a ship. Is this a glitch or is it me? I am producing too many ships too fast?
Shouldn't do that! Maybe a bug, if it's a ware type 7 it should create the ship, not a ware type.

LA

Edit: Try this fix http://labler.stormmage.org/plugin.MPM2 ... n.Task.zip
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

FAQ - Started for v7 (10/08/2010)

Post by Logain Abler »

FAQ:


LI_Modv7 Compatibility with older versions:
Logain Abler wrote:
dpadula wrote:@LA: Do you mean that if you have anything deployed it has to be destroyed and recreated...correct?
LI_Modv7 has been re-built to address the PHQ Blueprints issue caused by using modified HQ.

There could be object reference issues, however fingers crossed all it will do is show incorrect models in-game and in the PM, FDN & SDDN menus.

The worst it will do is show your save file as corrupt.

LA
Merging LI_Modv7 tDock:
imperfiction wrote:
Varek Raith wrote:I've been trying to merge your tdocks with that of the SRMv0.83 mod.
I've been failing, badly.
Can I trouble you for some help?
:oops:
@Varek Raith
I'm going to assume you know how to merge tdocks. I've had a little progress merging the mods. basically...

Change the number of entries (in SRM) in the 3rd line of tdocks from 87 to 96 (to reflect the 9 dummy stations) then copy/paste/overwrite the fdn/pm entries in. You'll have to unpack and modify 9951-L044.pck because it contains wrong text which will mess up the merge. I just deleted them since the 9910-L044 does that anyway. So far it works ok on that end.

The problem I'm having now is the shipyard install which will add FDN Nodes but not the Relay or Trading Post. No problems with the PM. With the dock install fix most work but I've found a shipyard going blank in Siezewell. I'm just going to wait on script updates before i proceed any further.

Buying LI_Modv7 Stations:
Logain Abler wrote: There is a potential issue adding custom stations to existing race Shipyards, by which tradable items become unavailable to the player and the Shipyard show no items for sale.

To overcome this issue if LI_Modv7 is installed two new Shipyards are created for each Major race and all LI Stations are added for purchase as normal by the player. This removes any requirement to modify and existing race Shipyards

LI Stations can be bought as normal via these outlets.

Logain Industries:
Spoiler
Show
Argon - Ringo Moon & Treasure Chest
Bororn - Rolk's Drift & Hollow Infinity
Paranid - Emperor Mines & Priest Refuge
Split - Thuruk's Pride & Njy's Deception
Teladi - Greater Profit & New Income
Terran - Saturn 3 & Neptune


FDN Storage and PM Storage and Production Caps:
Logain Abler wrote:
breytac wrote:I'm still getting used to the new way of doing things. I forgot to change the "Maintain Locally" setting. Once I set it to 0 on the PM, all products were transferred to the FDN for transport to factories. I know I could keep some products on the PM, but I think of the FDN as a sort of warehouse and distribution point.
The maintain locally is there for wares the PM produces but also uses as a resource, it stops PM sending what it needs locally to FDN and then having to requesting it back later.

I always ensure I have a local stock for such scenarios.

If the PM is a Node there’s a bit more thought required as its doing 2 functions.

I set the “Production Cap” slightly higher than the “Maintain Locally Cap”.
I set the FDN “Ware Cap” to the same as the “Maintain Local Cap”

With the three settings set as such PM will build more than it has been told to store locally, this excess is passed to the FDN element which will then pass it out to other FDN Node within INN range.

I use this approach as a kind of load balance between multiple PM and FDN stations.

PM Enabled TL/M1 class ships:
Logain Abler wrote:
Ragemaster9999 wrote:Logain, im trying to get the production module added for my mobile pirate base hauler (pirate TL) and it tells me I do not own any capable ships.

Im also looking in the PM options config menu from the community plugin
manager and can see the option for adding/enabling various dockable stations to PM but no option to enable or disable TL or M1 class ships.

Am i missing something in the options, or is the pirate TL hauler exempt? Pirate is not listed in default race listed so maybe their TL is excluded?
Once the TL has Supply Command Software installed it will be listed.

Quick Guide:
Logain Abler wrote: Salvaging: (creating Blueprints):
The first step in setting up you new Production Complex is creating Blueprints. Blueprints are used to configure the Modules, telling it what to produce and the resources required for production.

To create Blueprints the Production Complex (I will use this as a generic name for any dock or TL/Carrier using PM) needs to salvage (reverse engineer) the object as follows:

Factory -> Station & Ware Blueprint (with the exception of minerals)
Dock -> Station
Equipment – Ware Blueprint
Ship -> Ship Blueprint

How to create Blueprints: Select Main Menu -> Select Production Complex -> Select the Salvage Option -> Select from the available objects


Production:
Once you have the required Blueprint you can then link it to any free Modules. For Wares & Equipment the number of assigned Modules increase the amount produced and the amount of resources required. For Ships and Stations increasing the amount of Modules reduces the production time.

How to setup Module: Select Main Menu -> Select Production Complex -> Select the Production Option -> Select from the available Blueprints -> Enter the number of Modules when prompted


Storage Management:
Storage Management is used to manage the production levels at the Complex and also to link to any FDN Nodes in INN range.

How to update local levels: Select Main Menu -> Select Production Complex -> Select the Storage Management Option -> Select and update the required value

How to update select an FDN Node: Select Main Menu -> Select Production Complex -> Select the Storage Management Option -> Select an FDN Node from the list
Last edited by Logain Abler on Sat, 18. Dec 10, 10:33, edited 14 times in total.
Logain Abler
Posts: 2255
Joined: Mon, 31. Oct 05, 08:44
x4

Post by Logain Abler »

Production Modules - 11/08/2010
Release Notes Version 7

Summary:
PMv7 will work as script only, with the LI_Modv7 file, or third party custom docks
Improved Grouped Module production
Ship & Station build changes, Modules now reduce production time
New build logic & tasks
LI_Modv7 is completely new and has been re-done to incorporate a work around for the modified PHQ & blueprint issues. This fix will only work with LI modified HQ docks

Compatibility:
This is a completely new version and is NOT compatible with earlier version
Due to the LI_Mod file changes this will NOT be compatible with any save games which have FDN, PM or SSDN installed
PMv7 is only compatible with FDNv7
PMv7 can only use LI_Modv7


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

Post by Logain Abler »

I should have a little addition to PM out tomorrow.

The Blueprint Manager shows all the blueprints saved against PM enabled docks (no ships):
[ external image ]

You will be able to move (not copy) or delete Blueprints which aren't currently being used (used in orange):
[ external image ]

Just finishing off the code & testing to do.

LA

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