Page 1 of 1

Adding New Weapons and making the Available

Posted: Thu Feb 06, 2014 4:29 am
by PaulB
Can someone explain the meaning of the following entries and fields in Planets, Bases, etc.?

{upgrades/Reactors/Medium;1;.1;6;3}
{upgrades/Weapons/Mounted_Guns_Medium;1;.1;6;5}

What do the 4 numbers mean/represent?

I know the entries determine what is available for purchase at the Ship Upgrades - but what exactly do the numbers mean?

And could someone also explain a little about ship_upgrades.py ?
I've made some mods in Vegastrike.
I added the Galaxy (from PGG) to Vegastrike and Tachyon Cannon, Plasma Gun, and Proton Torpedo to units.csv, master_parts_list.csv, and weapon_list.xml but when I go to buy weapons the tachyon and plasma (even if they show up) are grayed out so not available and I don't know why.
If I click on them the descriptions are NOT what the description says in master_parts_list.csv but something to the effect of what a shield or engine enhancement would show.

To make new weapons available what has to be done beside creating units.csv, master_parts_list.csv, and weapon_list.xml entries ?
Paul

Re: Adding New Weapons and making the Available

Posted: Thu Feb 06, 2014 7:20 am
by klauss
Without mention of which column, it's just guessing. But guessing it's Imports:

{<category>;<price>;<price std dev>;<quantity>;<quantity std dev>}

Re: Adding New Weapons and making the Available

Posted: Sun Feb 09, 2014 5:30 am
by PaulB
klauss wrote:Without mention of which column, it's just guessing. But guessing it's Imports:

{<category>;<price>;<price std dev>;<quantity>;<quantity std dev>}
Could you expound a little on the <quantity std dev> and what it means and an example or two?
I have a vague idea but I'm not clear and google didn't really clarify it enough for me - at least in the context of VS.
Paul

Re: Adding New Weapons and making the Available

Posted: Sun Feb 09, 2014 7:43 am
by klauss
It's a statistics thing. Randomization. It basically says how far from the average quantity <quantity> the actual value should vary. So, roughly, a quantity of 5 with std dev 1 would mean 5 plus or minus 1 (actually a bit more but roughly that).

Re: Adding New Weapons and making the Available

Posted: Sun Feb 09, 2014 11:33 am
by PaulB
Thanks, I kinda thought maybe that might be it but wasn't sure.
Paul

Re: Adding New Weapons and making the Available

Posted: Thu Oct 30, 2014 5:57 am
by TBeholder
base price/quantity - those are average values (multipliers), relative to "base prices" - the ones set in data/parts/trade_goods.csv or trade_equipment.csv (formerly master parts), deviations - how far it may vary.

price = abs ( base_price * (rel_price-price_dev) + price_dev*2* random(0..1) )
Price = ( price + (base_price*aveweight) )/(aveweight+1), where aveweight is confwar "cargo/price_recenter_factor" (default 0)


i.e. without recentering, final price is base price multiplied by (price ±(0..1)*price_dev) - e.g. if price is 2 and price_dev is 0.6, the final value will be somewhere between 1.4x and 2.6x of base price.
With recentering >0, differences from medium values will be reduced (1/3 for price_recenter_factor=2) for everything.
Same deal with quantity, so quantity -1 quantity dev 4 means (-5..+3) - usually none, but sometimes up to 3.

On top of this, confvar cargo/price_quant_adj_power (1), cargo/min_price_quant_adj (1), cargo/max_price_quant_adj (5) can change quantity depending on the price, with default values reserves of goods will be values set for a base x1 at minimum price and x0.2 at maximum price among the prices set for items in this category, not in range of possible values for an item (yup, it's weird and may be a bug).

Source code is here.