5 Months Ago
Implemented a dynamic NPC vending price system based on sales in a rolling window -Prices are increased when an item is sold a certain amount of times in an in-game day (PriceIncreasePerSalesInterval and PriceIncreaseAmount control this behaviour, so if they were set to 3 and 0.1, for every 3 purchases of an item in a 24 hour window the price will increase 10%). The rolling window is configured via the IntervalHours convar and defaults to 24 -Prices are decreased if an item isn't sold for a certain amount of hours (PriceDecreaseInterval and PriceDecreaseAmount, so if they were set to 3 and 0.1, every three hours the price of the item will drop by 10%) Currently clamped between a 50% discount and a 300% price increase Currently only applies for purchases that are made using scrap as the currency Updated the in-person vending machine UI with a UI indicator displaying the current discount/surcharge, the dozen other places we show vending machine prices still need updating All time and discount values are currently using the examples provided above, they are just for testing and will be changed