The pixellated, blobby thing in the middle of the screen is the intersection of two Perlin bitmaps.
One contains information for the amount of salt available on a given chunk of land. The brighter the pixel, the more salt can be harvested from that coordinate.
The other is a height-map of sorts. When I generate this bitmap, I perform a threshold operation to see if a given supply of salt is "exposed", e.g. the salt can be harvested without any intermediary steps being performed. Each black square represents an area where the salt is underground, and must be exposed before it can be harvested. This is where the alchemist NPC (creator of explosions) comes in. In order for the miners to be able to get the salt the alchemist must come in and blow a big hole in the ground.
Once all the salt in an area is harvested that area can be used for farming.
Farming can only happen on a black square. That square can either be an area that has been cleared of salt, or an area which has not yet been blown up by an alchemist.
An area which is being farmed cannot be mined for salt at any point in the future. Inevitably, squares which might be mined are lost to the needs of farming.
As the game progresses there will inevitable be a point where all of the available salt is mined, and the land is nothing but farms.
There is a trader NPC, which I am hoping to have up and running soon, which will be able to trade excess salt and food for gold, and will thus ensure the stability of the town.
Note that most of these interactions have not yet been implemented.
The data for the bitmaps is contained in the file called "config.xml", which looks like this:
A Dry Harvest
My studies in economics lead me to believe that a closed system will inevitably collapse. Hopefully the game will end before this happens.