Shops

Shops are buildings within a Settlement that function as locations for the Player to sell goods to in exchange for currency.

Each Settlement will start off with a Farmer’s Market and a Hardware Store. Every 50k population, the Settlement will add another random shop also based on Settlement type.

Each Shop will select 8 Products from their lists below that will be sold to the Shop based on its type. 1 Product will be considered Demanded (Priced at 125% base price) 3 normal at 100%, while others are considered Under Demanded (Priced at 80% base price)

Supply and Demand
To simulate a Supply/Demand Market for the Player, each Shop will list each good in their inventory with the amount they require as well as the amount they will purchase the good upon consuming the good every cycle.

This amount required by the Shop is determined based on the population and the monthly production of the good using the following equation:

Demand = shopModifier + ceil(0.05 * ceil(population / 50000) * (30 / timeToProduce) * producedAmount * tierValue * difficulty)

The following table displays the value for tierValue; a number determined by the tier of the settlement.

Tier Values:
 * Tier 0: 6
 * Tier 1: 6
 * Tier 2: 3
 * Tier 3: 3
 * Tier 4: 3

Some higher tier Shops also impose an additional -1 on demand to keep their demand low. (Prototype Showroom, Home Goods, Book Store, Liquor Store).

Demand can never be zero.

Based on the amount of goods the Player supplies the Shop, a good will have one of three states:


 * Fully Demanded - No Goods were supplied
 * Partial Supplied - Some Goods were supplied
 * Completely Supplied - All Goods were supplied

This state should be represented by a Bar under or to the side of the good.

If there the Player provides more Products than the Shop demanding, the Shop will store the Product in its infinite storage and consume it when it is needed. If a Shop stores the item instead of consuming it, the Player will not receive the value of the good until it is consumed.

At one point a Settlement may want to send a good to a Shop whether it was crafted in the same Settlement or by trading with another Settlement. If this happens in parallel with a Player has sending that same good to the same shop, the Player’s Good will be consumed first.

Keeping a Settlement supplied with goods that the can consume will help the Settlement Prosper and Grow, otherwise the Settlement will stagnate or even shrink.

A Shop is considered supplied when at least 1 Product is sold within the last cycle (15 days)