The freemarket is a server setting designed to even out the number of weapons/accessories that are bought. It does this by raising the price of the most used items, and lowering the price of the least used items. This is meant to make the least used weapons more attractive and perhaps auto-balancing the price vs effectiveness.
Here is the algorithm used when any item is bought:
- get a list of items that may have been bought instead. This list only contains items around the same price (give or take 30%), that are the same item type (i.e. a weapon/defense/etc) and that are allowed to be included for the free market (a setting in the accessories.xml file).
- If there is only 1 item in the list don't change the price.
- Find out how much money each item should get, the price spent divided by the number of items in the list (the average money spent per item).
- For the bought weapon in the list add the free market adjustment to the price (server setting), for all other weapons remove the free market adjustment from the price.
These adjusted prices are stored persistently in a file.
Adjusted prices are capped between limits so they don't get out of hand. Prices are capped between 50% and 150% of the original price. Adjusted prices are also rounded to the nearest 10.