http://btmodding.warriorsblood.com/index.php?title=Shops Doesnt have that info listed, but certain items in shops have weights. I have seen values from 0 to 50 used. What do the numbers do exactly?
Thanks
Thanks
thinking the weight is reverse
0 being the most common and 20 being the most rare.
Given what I saw looking at it item by item, I'd have to agree -- 0 is "common as dirt on a planet", and 20 is "we deny this ever existed".
But that is in direct opposition to this post: http://forum.paradoxplaza.com/forum...mpany_commander.1099514/page-69#post-24387779
Yes, you are right. The rarity scale goes up like that. The higher the number, the rarer the item. I just don't think this value is used by stores. I think it is only used for salvage distribution.Take a stroll through the default files for the cockpit upgrades, and note that the better versions have higher rarity values.
Look through the LosTech items... they all have the highest rarity value I've found, which is 20.
In contrast, the standard versions of the basic 3025 weapons have a rarity value of 0.
I don't think it would make sense for the better or more exotic items to have rarity values that would make them more common in the game.
Therefore, I have to conclude that 0 = common, 20 = rarest of the rare.
I have found the code so now I can give an exact answer for weights in shops.
It takes the summed value of all of the weights in the shop file. It generates a random number from 0-1 and multiplies it times this total value of weights.
- It does work as hypothesized. Only weights matter as defined in the shop files.
- It creates a sum of all of the weight values for these items.
- Then, for each special that the shop is allowed (as defined by its max specials value), it generates a new item. It queries the item list in order and checks to see if that item gets added.
- The algorithm for this is simple, yet subtle in its ordering preference. It always starts from the top of the list and works its way down. It follows this logic:
It then looks at the list in order. For each item, it takes its weight value and sees if it is larger than these randomized value from all of the weights. If it is, the item gets added to the shop. If the item is already there, it just adds more of the same item based upon its "count" value. If the weight is lower than the randomized value, it adds that items weight value to the next item in line and checks if this new weight value hits the threshold. If it does, it gets added to the shop. If not, it continues adding this weight value until an item is added...
It continues to do adding over and over until it reaches the limit of allowed specials. It always starts over from the top of the list every time.
The MAJOR take away from this is that the adding of items is percentage based with an order dependence. The items at the top off the list will always be more favored than lower on the list.
Explain the 'in order' part. Where and how does the list order itself?
Exactly this.Within each shop file, for starters -- it's a series of entries in the JSON file.
Critical side-question:
Presumably this is *also* the way the game calculates hit locations. If the Head location is moved from the start of the list to the end of the list, will this result in a significant reduction?
That's... Huh. I'm going to look at the code.Critical side-question:
Presumably this is *also* the way the game calculates hit locations. If the Head location is moved from the start of the list to the end of the list, will this result in a significant reduction?