TG:Logic/Industry logic

Industries in the game are to be simulated in detail, and there is some hope that the result of the aforesaid simulation will be a map-wide economy.

Initial thoughts (copy/pasted from main game page):
 * industries normally carry goods between them by other means of transport (not available to the player): road, ship, or plane; and have a complete set of contracts they are fulfilling (iron ore mine A has a contract to deliver four wagons of iron ore to steel mill B and is using trucks to do so at a transport cost of $250 per ton). Player can bid on a contract (in previous example, at MOST $249 per ton!) and may be awarded it. Contracts last 1-3 years, with renegotiation when complete, at which point industry, if unsatisfied, may terminate contract.
 * Goodwill ratings -- industries, industrial groups, and global.

Industry generation
When industries are placed on the map, they come equipped with a starting amount of cash. The industries may use this to purchase raw materials and/or improvements in production speed.

Depending on the industry type, a raw material may be required for production to start -- if that raw material is unavailable (does not exist within reasonable distance on map), the industry may "panic" and request a quote from a player transport company for a contract to bring the raw material from further away (even off-map, if needed).

If the industry is not able to secure the flow of a required raw material, it should go into a maintenance-only, minimal-cost mode wherein production capacity is minimal, but the cash reserve will last longest.

Cash reserve
The cash reserve of an industry is tracked and, if negative for several months(?) in a row, the industry will be bankrupt and its machinery sold off for scrap metal. The building will remain and slowly crumble to dust -- though a later company may purchase it and restart the business with more cash reserve left over than if starting from scratch.

This reduced restart cost must be balanced against the obvious undesirability of the area -- if the previous industry went out of business for lack of a raw material supplier, a later industry of the same type will not want to start up in the same location unless conditions improve (cheaper transport from further away, or new raw material producers available within range).

The cash reserve will deplete from purchases of raw materials, (the cost of which will include said raw materials' transport costs, plus a reasonable profit for the supplier).

Cash reserve will increase from sale of goods to an accepting industry, minus the cost of transporting said goods (which is paid to the transporting authority, as per existing contract).

Production
Industries fall into three categories: producers-only, producers-and-consumers, and consumers-only. Given the logic outlined above under the heading, the way for both types of producers to make profits is clear. However, this leaves consumers with an unclear cashflow. So let's go into details on each industry type.

A producer makes a raw material out of nothing -- think of a farm, for instance, generating grain crops periodically without requiring any input. With that said, it should be perfectly possible for deliveries of a certain cargo to increase production (think of bringing fuel and farm equipment to the aforementioned farm -- it can then plant and tend a larger farm area, leading to an increased harvest).

Producer-consumers (aka manufacturers) generate finished goods out of raw materials. For instance, a steel mill generates steel by smelting iron ore with coal, producing an iron-carbon alloy. They can also increase production by retooling, hiring more workers, and in some cases, accepting special goods -- for instance, a load of machine parts may be delivered to a steel mill to allow it to retool to a more automated process, thereby increasing its production. Note, however, that if production capacity increases, a higher amount of raw materials will be required, thus more (or bigger) contracts must be generated from the producing industries. This is naturally balanced by bigger sales in a deficiency economy.

Ugliest, economy-wise, are the consumers -- they buy goods from other industries, but do not directly sell anything, making them the money faucets for the map-wide economy. They must be very carefully balanced so that not too much money goes into the whole thing, preventing the OpenTTD scenario of "I have enough money to flatten the map". Aside from the periodic generation of money in their cash reserves, however, consumer industries work much the same as a manufacturer with no finished goods.

Economic cycles
The global economy will affect industries mostly indirectly -- the only ones seeing a direct effect are consumers, whose magic money bags will increase more slowly, if at all, in a recession than they would in an economic boom.

Indirectly, this will affect all producers and manufacturers by consumers' cancelling of contracts they cannot support financially. This will lead to cut-backs and further cancelled contracts all the way up to the start of the production chains.

Random events
Industries of any kind can be affected by occasional random events, decided similarly to disasters. Random events may be beneficial or detrimental to production, indirectly affecting contracts. For example, it should be possible for a strike at a manufacturer leading to a large stockpile of raw materials with practically no finished goods sold -- the manufacturer may even go bankrupt from this event. It should, however, also be possible for a wealthy benefactor to invest in increasing an industry's cash reserves.

Random events will be more likely to happen when environmental conditions are appropriate -- for instance, a labor strike probably won't happen during an economic boom (however, it may do so, simulating a penny-wise pound-foolish industry operator that doesn't pay his workers enough).