At the heart of Thrive’s mechanics lies a set of simulations which allow gameplay to function. For the most part, these are not completely accurate depictions of the real world, but abstractions, which require far less processing power and give the player a more intuitive view.
Ideally, the rules of the simulation should allow many possibilities, with sensitive reliance on initial conditions to create entirely new scenarios on each playthrough. Balancing for this goal will be difficult – it would be all too easy to accidentally create an environment where one survival strategy or exploitation of the simulation beats everything else. As in the real world, one way to counter this is to present different challenges in different locations or at different times throughout the game, destabilizing the dominance of some species and allowing others to rise.
Underlying the simulation is a system known as CPA (Compounds, Population Dynamics, Auto-Evo), the bedrock of the game itself. The CPA System is perhaps the biggest draw for people towards the project, as it allows evolution to take place. There are direct links between CPA, metabolism, AI and environment creation. Each feeds into the others, creating a set of feedback loops as in nature. Again, making this system work correctly will be a challenge, especially since the game will be built iteratively.
All simulations work using a different time measurement to that used by the frame rate.
Main Article: CPA System
In essence, the CPA System is what the entirety of the game is about. It controls player and NPC evolution, and builds the world the player must fight against. There is no major adversary in the game other than the power of evolution. Other species will become successful and present a challenge for the player, which skill should be able to overcome.
Everything in the CPA System is interlinked. Compounds are relatively simple, but Population Dynamics and Auto-Evo rely on heavy abstraction and complex formulas. Many things are likely to fail when actually used in-game, so new systems will need to be devised.
Though the CPA System is the basis of everything, it might be a good idea to implement it after most other gameplay features have been added. This will give a list of all available compounds and processes for use in the simulation.
Everything in the game revolves around compounds. In the scientific sense, compounds are substances comprised of two or more different elements chemically bound together, but for the purposes of simplicity this definition has been expanded to include single elements and mixtures too.
Each compound type has an associated atomic weight (which allows for calculations of how much can be stored within a vacuole, for instance), but all are measured in a unit derived from the mole. Moles scale numbers of molecules up to usable sizes, but for the game’s purposes they will need to be scaled down again. One mole of hydrogen weighs one gram, but an entire cell generally has a mass somewhere in the region of a few picograms, many orders of magnitude smaller. Measurement in individual molecules would still be excessive, so a middle ground must be found.
At this point, it’s unknown whether compounds will be measured in integer or decimal values. The latter has the advantage of allowing more precision, but this may come at a cost, discussed later.
One basic principle of compounds is that they are always conserved. They can be converted into other types via chemical reactions, but the weight of the products should always equal that of the reactants. If the exact reverse is applied to the products, the same amount of reactants should appear. If compounds are measured using decimals, then rounding errors may gradually cause an amount to deviate from its initial state after many conversions.
Conservation of compounds applies not only to individual reactions, but to the environment as a whole. The game world is divided into patches. Each patch is assigned a biome type, and a full game world can be constructed using adjacent patches. Compounds can flow between patches via the methods described below, but other than a few exceptions, there is no influx or outflow of compounds from the game world as a whole. Compound concentrations are determined at the beginning of the game, and for the most part never change.
One compound which can be added or removed is ATP, the measure of energy transfer within a cell. Energy enters the environment as heat or light, concentrated in spots or in certain biome types. Certain survival strategies make use of this influx (photosynthesis and thermosynthesis). Once ATP is produced, it is consumed by organelles, dissipating as heat again. Heat flows at a constant rate out of the environment to prevent the heat death of the game universe while the player is still playing it.
Another non-conserved compound is water. Like the real world, water in-game is special in many ways. It permeates everywhere at maximum capacity, providing a transfer medium for compound clouds. It’s assumed that there is an infinite supply of water flowing in from outside the world boundaries at all times. Cells are also primarily made of water, and the amount of water they contain vastly exceeds the amount of any other compound. Measuring it would result in a massive number as even minuscule volumes of other compounds must be counted, so water is ignored. However, water is used and produced in some reactions, specifically photo/thermosynthesis and aerobic respiration. This at first presents a problem – theoretically, this could create an infinite supply of oxygen and hydrogen as well. But there is one way to stop this: so long as there is no process which converts water directly into oxygen and hydrogen, all levels are mediated by the availability of other compounds. Photosynthesis requires a supply of carbon dioxide, which is finite and controlled like all other compounds. This is a limiting factor in the production of oxygen.
In a single patch there are species which fill slots in the ecosystem. There are a limited number of slots per patch. A species is defined by three variables – its genetic code (an abstract representation of its structure, appearance and behavior), a total number of compounds, and a population number.
Depending on what organelles a species has, it can convert compounds into other compounds. Compounds are also processed by bacteria and the environment. Individuals have boundaries and can absorb compounds in the environment (in the form of compound clouds). There is a steady flow of some compounds out of a species and others into a species, due to the death of its members and their consumption of environmental compounds.
Each individual also has a certain amount of locked up compounds which make up its internal structure. When a cell dies, its collected compounds are released as compound clouds, but its locked up compounds remain stored in floating organelles. Digesting agents or engulfing microbes can break these down, creating more compound clouds or absorbing the compounds into their own visible stores.
Organelles have a defined amount of compounds they represent. For instance, each mitochondrion might consist of x glucose, y amino acids and z nitrogen (these constituents have been picked out of thin air for the purpose of giving an example and are in no way accurate). When broken down, the organelle releases those amounts of each compound into the environment.
Locked up compounds do present a problem: where do the locked up compounds in a cell come from? One possible solution is to extract the compounds from the parent cell’s stores when it divides, but this leads to other problems. What if it doesn’t have enough, or even any, storage space for a particular compound, let alone sufficient stores? Should the player be prevented from reproducing until they gather enough?
Another solution is to have reproductase transfer the compounds over. In essence, this would involve using reproductase as a label for stored compounds needed to produce offspring. Compounds could be converted to reproductase, and eventually released on death and digestion. This does raise further questions though. If organelles have a set makeup, does an organelle-heavy cell need more reproductase to divide? If more organelles are added as a mutation, where do the required stores for them come from if not thin air?
An alternative option would be to have a set amount of reproductase distributed evenly amongst all organelles when a cell is created, abandoning the idea of set constituents. While theoretically this leads to no net increase or decrease, and gives all organelles some compound makeup, rounding errors strike back again. 5 reproductase (or its constituent compounds) distributed between 7 organelles would require fractions to be accurate, or else the total amount of compounds in the environment would gradually drift off course as more would be added or taken away out of thin air.
A solution must be found to keep the compound system intact, even if it’s an ugly hack like compensating for lost compounds by artificially adding more into the environment to match the total that disappear, and vice versa.
Finally, another problem to address is how to make sure compounds do not disappear completely from the environment. Glucose is the main culprit – in the early game, no cells will photosynthesize or thermosynthesize, so all will consume glucose. They will have locked up glucose which can be consumed by other cells, but this may not be quick enough to fight the disappearance of glucose as it’s converted into water and carbon dioxide. On one hand, this presents a naturally arising driver of evolutionary change, an incentive for some cells to develop photo/thermosynthesis and others to start hunting. On the other, if left unchecked this could result in the extinction of all species if neither of these strategies arise in time.
Bacteria represent an environmental store of glucose, so may be the savior if used correctly. Again, balancing is key.
The amount of compounds in a patch determines the environment the player will see. If there is a large amount of calcium in a patch, the player will see many rock surfaces (these dissolve to release calcium into the environment). If there’s a lot of ammonia, there’ll be large ammonia clouds, and so on. The player’s surrounding area is the only area not simulated abstractly, but it takes information from the compounds model to create itself.