After much thought, below is a first proposal for how this could work. I recognize that it seems very ambitious, but I actually don't think that it is ridiculously hard to program. How well it plays out is another matter, so much feedback encouraged at this early stage!!!
(Note: the formatting of all this is screwed up. For the original, more readable post,
see here.)
Starting Assumptions
Without Lattice, Roanoke would have the same climate as Venus due to its proximity to the sun. Thus, the game of terraforming is a delicate one: go too far and the planet becomes a living (or dead) hell.
* Terrain = average temperature.
* Features = climatic conditions.
* Bonsues = well, bonuses
Once per turn, a function sweeps through each tile in the game and runs the following calculations. (Preferably this is done in C++ or else I can imagine Python bogging down significantly):
1. Calculate the "temperature" of that tile.
2. Based on the temperature, calculate the chance of the tile changing.
3. Determine if the terrain does, in fact, change. (This should provide some stability to terrain, I hope).
4. Determine whether this change invalidates any features. If so, destroy or change them. (E.g. change CO2 gas to CO2 ice).
5. If features are removed, remove any bonuses that depend on them. (Cows cannot survive without O2)
6. Determine if any random bonuses appear.
I will get to the crucial calculation of Step 1 in a bit, but before doing that, it might make sense to go over what the results of that calculation would be.
Terrain
Temperature Terrain
< 0 Very Cold
1-5 Cold
6-10 Terran I
11-15 Terran II
16+ Hellish
Features
Feature Terrain
Lattice All but Hellish
CO2 All but Very Cold
O2 All
Lattice is a super-efficient absorber of energy from the sun (but not necessarily from ambient atmosphere, don't ask me why, I just made it up). However, O2 is "poisonous" to Lattice. The O2 feature provides "fresh water," so a tile that is adjacent to O2 and considered "irrigated" has a certain chance of killing any Lattice on it.
Both CO2 and O2 are shorthand for that gas being "present." The bulk of the atmosphere would remain some kind of buffer like N2. "O2" implies that "CO2" (and water, methane, etc.) is present and therefore "counts" as a greenhouse gas (see below). Later on we might consider adding a "Forest" feature that provides the human benefits of O2 but without generating greenhouse gases.
BTW, do I recognize that it's silly to have atmospheric gas localized like this? Well, I did a very quick read in Wikipedia on atmospheric dispersion modeling and answered, "yes," but decided, "To hell with science, this is what will make the game fun." If anyone has better ideas, please pipe up!
Bonuses
Bonuses are pretty much as they are in the game, but tied more directly to their "sponsoring" features. E.g. lattice resources will only appear in lattice and "die" if the lattice is removed; corn, rice, and wheat will only appear in CO2 or O2 and die if they are removed; etc. Mineral bonuses (iron or whatever) are unaffected by these changes.
Some bonuses in turn affect the chance of a feature appearing. Here is a fairly intuitive progression in the game:
Terrain terraformed up to "Terran I." The CO2 Feature appears, which enables the player to build an open-air farm. The farm has a chance of generating a wheat/corn/rice bonus (small food bonus). The farm+bonus has a chance of turning the CO2 Feature into an O2 Feature. The O2 Feature enables the player to build a pasture, which has a chance of generating a cow/pig/sheep/whatever bonus (big food bonus). Alternatively, the O2 bonus enables the player to build a Habitat for people to live, which will have a much more balanced yield benefit (mixed food/production/commerce bonus).
I've thought least about this aspect, so I particularly want feedback on this proposal.
The Climate Calculation
The climate calculation starts with the assumption that all tiles receive 10 "points" per turn from the sun. (Later we can get fancy and (a) adjust for lattitude, if this doesn't screw players that start near the poles; or (b) make the sun a variable star, etc.). It then adjusts that amount by local conditions (features, active terraforming) and global conditions to produce an integer value for "temperature" that influences the terrain value of that tile.
Global Calculation
The global calculation adds up all the Lattice (and fibersea) and imputed CO2 on the planet and adjusts accordingly, as follows:
Lattice adjuster: Total Lattice+Fibersea count / Total tiles * (-10)
Greenhouse adjuster: (Total CO2 + Total O2 + Total city unhealthiness) / Total tiles * 20
example: Assume a 50x100 map (5,000 total tiles). 3,000 tiles are lattice or fibersea. The lattice adjuster is -6. There are about 200 CO2+O2 features, plus another 20 cities with 5 unhealthy faces. The Greenhouse adjuster is (200+100)/3000, or +1.
Local Calculation
The local calculation adjusts for features, improvements, and "culture" on or adjacent to the tile as follows:
Lattice: +5 if this tile contains Lattice. +1 for each horizontal/vertical tile that contains Lattice (so, maximum total of 4 - diagonals don't count to save computing power).
Terran food improvement: +1 if this tile contains a Hothouse or other improvement that generates Terran food. This presumes that a Terran player would want to terraform towards Terran conditions.
Culture: +1 if this tile is controlled by a player with lifeform "Terran." +2 if player is "Mutagen." -2 if player is "Roan." 0 otherwise.
Calculation Result
All the numbers are added up and compared with the terrain table above. If the terrain is now "out of sync" with the temperature, there is a % chance that the tile will change based on (difference x 20%). For example, if the terrain is Very Cold but the temperature is 7, there is a (7-5) * 20%, or 40%, chance that it will change to "Cold."
Example 1: Total Lattice Coverage
Starting value 10
Lattice: on tile -5
Lattice: 4 adjacent -4
Global effect -6
Total -5
Result: 100% Very Cold
Example 2: Some Adjacent Lattice
Starting value 10
Lattice: on tile 0
Lattice: 2 adjacent -2
Global effect -6
Total 2
Result: Very Cold
(60% chance of change if current value = Cold)
Example 3: Human Base Tile, unimproved
Starting value 10
Improvement: None 0
Cultural effect 1
Global effect -6
Total 5
Result: Cold
(100% chance of change if current value = Very Cold)
Example 4: Mutagen Base Tile, improved; global warming + removal of Lattice underway
Starting value 10
Improvement: Hothouse 1
Cultural effect 2
Global effect -4
Total 9
Result: Terran I
(80% chance of change if current value = Cold)