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.