outpost_2:concepts:population_and_morale

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
outpost_2:concepts:population_and_morale [2023/11/01 05:47] blackbox222outpost_2:concepts:population_and_morale [2026/05/22 01:14] (current) – Fixed formatting and added more info BlackBox
Line 3: Line 3:
 There are three classes of colonists in OP2: There are three classes of colonists in OP2:
  
-  * Kids: All colonists start out as Children born at the Nursery.  Their sole function is to grow up into Workers when trained by an active University. +  * **Kids**: All colonists start out as Children born at the Nursery.  Their sole function is to grow up into Workers when trained by an active University. 
-  * Workers: Workers are required for operation of most structures, and can be trained into up to 10 Scientists at a time at any active University. +  * **Workers**: Workers are required for operation of most structures, and can be trained into up to 10 Scientists at a time at any active University. 
-  * Scientists: Scientists are also required to operate certain structures, and can also do [[Outpost 2:Outpost 2 Manual:Research]] at any active Labs.  They can also be assigned as Workers when there's a colonist shortage (though with a corresponding Morale hit as seen below).+  * **Scientists**: Scientists are also required to operate certain structures, and can also do [[Outpost 2:Outpost 2 Manual:Research]] at any active Labs.  They can also be assigned as Workers when there's a colonist shortage (though with a corresponding Morale hit as seen below).
  
-Morale is a "colony happiness" value that is computed from various colony conditions, as well as events that occur during gameplay.  This value ranges from 0-99, but this range is segmented into various morale levels which apply various modifiers to other mechanics in the game:+**Morale** is a "colony happiness" value that is computed from various colony conditions, as well as events that occur during gameplay.  This value ranges from 0-99, but this range is segmented into various morale levels which apply various modifiers to other mechanics in the game:
  
-^ Morale Level ^ Min Morale ^ Research Modifier ^ Production Modifier ^ Food Modifier ^ Fertility Modifier ^ Death Modifier ^ +^ Morale Level ^ `morale.txt` Name ^ Min Morale ^ Research Modifier ^ Production Modifier ^ Food Modifier ^ Fertility Modifier ^ Death Modifier ^ 
-Excellent    | 90         | 15                | -25                 | 20            | 35                 | 620            | +Excellent    | `UTOPIA`          | 90         | 15                | -25                 | 20            | 35                 | 620            | 
-Good         | 70         | 8                 | -10                 | 8             | 46                 | 500            | +Good         | `GROOVY`          | 70         | 8                 | -10                 | 8             | 46                 | 500            | 
-Fair         | 45         | 0                 | 0                   | 0             | 64                 | 390            | +Fair         | `OKAYFINE`        | 45         | 0                 | 0                   | 0             | 64                 | 390            | 
-Poor         | 25         | -8                | 10                  | -5            | 82                 | 280            | +Poor         | `UPSET`           | 25         | -8                | 10                  | -5            | 82                 | 280            | 
-Terrible     | 0          | -15               | 20                  | -10           | 107                | 180            |+Terrible     | `WAYBAD`          | 0          | -15               | 20                  | -10           | 107                | 180            |
  
-These levels are defined in morale.txt.  The game also implements a power modifier that can give a bonus or penalty to power production, but this is set to 0 for all morale levels. (The table in morale.txt also defines a "defect rate" which is 0 for all levels except Poor (5) and Terrible (10), but this is unused by the game as far as anyone is aware).+Numerous constants governing morale calculations are defined in `morale.txt`. For example, the morale levels and associated modifiers are defined at the top of `morale.txt` as `M_PTS_TOT`, `M_RSCH_BONUS`, `M_FACT_BONUS`, `M_FOOD_BONUS`, `M_FERT_RATE` and `M_DIE_RATE` respectively. The game also implements a power modifier (`M_POW_BONUS`) that can give a bonus or penalty to power production, but this is set to 0 for all morale levels. (The table in `morale.txtalso defines `M_DEFECT_RATE` which is 0 for all levels except Poor (5) and Terrible (10), but appears to be unused by the game).
  
 In "morale steady" games this is typically forced to Good, but the mission designer can force morale to any of these levels. In "morale steady" games this is typically forced to Good, but the mission designer can force morale to any of these levels.
 +
 +==== Strategy ====
 +
 +  * Despite there being a "demand %" shown for Med Centers, having excess Medical Center capacity strictly lowers the death rate (at the cost of Scientists and power to run the medical centers).  While maintaining < 100% Med Center demand is necessary to avoid a morale hit by itself, further reducing demand % can have enormous benefits even in Morale Steady games.
 +    * Veteran OP2 players strive for 30-40% demand to give a decent reduction to death rate.
 +  * There is limited value in having more than 1 Nursery and University:
 +    * Multiple nurseries do not increase birth rate, only decreasing kid death rate by providing 40 capacity for kids, but this is quickly obsoleted when Med Centers become available as they have a base capacity of 50, upgradeable to 75 (and apply to all colonists).
 +    * Multiple universities do not increase worker training rate (though later in the game, multiple universities can be built in order to train more than 10 scientists at a time).
 +  * Birth rate and death rate are affected favorably by high morale, so it's in your best interest to keep morale reasonably high.
 +  * There is no value in researching Leisure Studies / Public Performance (to build Recreation Facilities or Forums). As described below, this does not factor into Morale at all until the tech is researched, at which point it only hurts you due to the Morale penalty from not building any rec centers (which require Workers and Power to run without providing any other benefit). Since it's not a prerequisite for any other techs besides Multitainment Console Upgrade (which increases the capacity of rec centers) there is zero useful reason to research it.
 +  * When playing as Eden, spamming Impulse Items from Consumer Goods Factories is one of the most effective ways to artificially boost morale in the late game by keeping event morale high (so long as you can spare the resources):
 +    * Despite Wares and Luxury Wares giving a larger morale bonus, Impulse Items are more time- and cost-effective due to having a build time of 800 and only requiring 150 common metal.
 +  * Destroying "good" enemy buildings such as morale-related buildings has a severe negative morale effect (and in most cases you only need to destroy the enemy Command Center to win e.g. in a Last One Standing game), so unless you are at the end of the game there is little value in attacking them.
  
 ==== Morale Model ==== ==== Morale Model ====
Line 33: Line 46:
  
 The game also stores various ratios described below in terms of hundredths of a percent (i.e. 100% = 10000) to avoid floating point rounding errors in calculation.  These get scaled accordingly when shown on the UI. The game also stores various ratios described below in terms of hundredths of a percent (i.e. 100% = 10000) to avoid floating point rounding errors in calculation.  These get scaled accordingly when shown on the UI.
 +
 +The following calculations are (roughly) shown in the order the game computes them during a morale update.
  
 === Event Morale Decay === === Event Morale Decay ===
  
-First, event morale decays according to the following formulas:+First, event morale decays according to the following formula:
 <code> <code>
 Event Morale = (Event Morale * EVENT_DEC_RATE + (255 if Event Morale is negative)) / 256 Event Morale = (Event Morale * EVENT_DEC_RATE + (255 if Event Morale is negative)) / 256
 </code> </code>
  
-Adding 255 in the case that event morale is negative ensures that it will get back to 0 given enough time.  EVENT_DEC_RATE is a value from morale.txt used to adjust the decay rate.+Adding 255 in the case that event morale is negative ensures that it will get back to 0 given enough time.  `EVENT_DEC_RATEis a value from `morale.txtused to adjust the decay rate.
  
 === Base Conditions === === Base Conditions ===
Line 55: Line 70:
 </code> </code>
  
-Total residence capacity is the sum of Production_Capacity (as defined in building.txt and upgradeable by techs) for all residences the player has (by default, Residence = 25, Advanced Residence = 50, Reinforced Residence = 40.  Residence can be upgraded to 75 via the Environmental Psychology tech).+Total residence capacity is the sum of `Production_Capacity(as defined in `building.txt`, and can be further modified by techs) for all residences the player has (by default, Residence = 25, Advanced Residence = 50, Reinforced Residence = 40.  Residence can be upgraded to 75 via the Environmental Psychology tech).
  
 As mentioned before, this (and all ratios in this section) is essentially a percentage stored in terms of hundredths of a percent, to avoid rounding errors (in other words, 100% = 10000). As mentioned before, this (and all ratios in this section) is essentially a percentage stored in terms of hundredths of a percent, to avoid rounding errors (in other words, 100% = 10000).
Line 113: Line 128:
 ** Overcrowding Multiplier ** ** Overcrowding Multiplier **
  
-An overcrowding multiplier is determined from residence demand, based on values in morale.txt.  Note that these stack as follows:+An overcrowding multiplier is determined from residence demand, based on the `CROWDED_*` constants in morale.txt.  Note that these stack as follows:
  
 ^ Residence Demand ^ Modifier ^ Total ^ ^ Residence Demand ^ Modifier ^ Total ^
Line 124: Line 139:
 ** Food Modifier ** ** Food Modifier **
  
-This also comes from morale.txt and is based on the food supply level computed earlier, stacking as follows:+This also comes from morale.txt (`FOOD_*`) and is based on the food supply level computed earlier, stacking as follows:
  
 ^ Food Supply          ^ Modifier ^ Total ^ ^ Food Supply          ^ Modifier ^ Total ^
Line 134: Line 149:
 ** Disabled Building Modifier ** ** Disabled Building Modifier **
  
-Also from morale.txt, this corresponds to the disabled building ratio, stacking as follows:+Based on `DIS_BLD_*` in morale.txt, this corresponds to the disabled building ratio, stacking as follows:
  
 ^ Ratio           ^ Modifier ^ Total ^ ^ Ratio           ^ Modifier ^ Total ^
Line 141: Line 156:
 | <66% (High)     | -1       | 0     | | <66% (High)     | -1       | 0     |
 | 66%+ (Max)      | -2       | -2    | | 66%+ (Max)      | -2       | -2    |
-| 10000 (default) | Same as Low     ||+| 10000 (default) | Same as Low    | |
  
 ** Rec/Forum Demand Modifier ** ** Rec/Forum Demand Modifier **
  
-This stacks similarly to the previous modifiers, defined as 1 in morale.txt:+This stacks similarly to the previous modifiers, defined as 1 in morale.txt (via `REC_UT_*` and `FORUM_UT_*`):
  
 ^ Demand         ^ Modifier ^ Total ^ ^ Demand         ^ Modifier ^ Total ^
Line 152: Line 167:
 | <= 200% (High) | 1        | 3     | | <= 200% (High) | 1        | 3     |
 | > 200% (Max)   | 1        | 3     | | > 200% (Max)   | 1        | 3     |
 +
 +As stated previously, this modifier *does not apply* if the corresponding tech is not researched (thus there is no point in researching these techs or building these).
  
 ** Med Center Demand Modifier ** ** Med Center Demand Modifier **
  
-^ Demand         ^ Modifier ^ Total ^+These stack and come from `MED_UT_*` in morale.txt. 
 + 
 +^ Demand          ^ Modifier ^ Total ^
 | <= 100% (Low)   | 1        | 1     | | <= 100% (Low)   | 1        | 1     |
 | <= 150% (Med)   | 1        | 2     | | <= 150% (Med)   | 1        | 2     |
Line 161: Line 180:
 | > 200% (Max)    | 1        | 3     | | > 200% (Max)    | 1        | 3     |
 | 10000 (default) | 0        |       | | 10000 (default) | 0        |       |
 +
 +** Operational Modifiers **
 +
 +^ Description                     ^ `morale.txt` name ^ Value ^
 +| At least one active Nursery:    | `NURSERY_ON`      | 2     |
 +| At least one active University: | `UNIV_ON`         | 2     |
 +
 +These are `NURSERY_ON` and `UNIV_ON` in morale.txt.
 +
 +** Disaster Warning Systems **
 +
 +This checks if the "required" tech of the quake, lightning, tornado, volcano, or meteor unit has been researched, which enables early warnings for disasters (the tech ID comes from `weapons.txt`).
 +
 +^ Disaster          ^ Tech Name                       ^ Tech ID        ^ Modifier Name  ^ Value ^
 +| Quake             | Seismology                      | 03201          | `DIS_QUAKE_ON` | 2     |
 +| Electrical Storm  | Meteorology                     | 05302          | `DIS_ELEC_ON`  | 2     |
 +| Vortex            | Severe Atmospheric Disturbances | 05303          | `DIS_SAND_ON`  | 2     |
 +| Volcanic Eruption | Vulcanology                     | 03202          | `DIS_VOL_ON`   | 2     |
 +| Meteor            | Meteor Detection                | 08317 -> 08316 | `DIS_MET_ON`   | 2     |
 +
 +All of these are additive (i.e. add 2 if the tech is researched, 0 otherwise)
 +
 +** DIRT Damage Prevention Modifiers **
 +
 +These are cumulative as before, based on the `DIRT_*` morale.txt constants.
 +
 +^ Avg Damage Prevention ^ Modifier ^ Total ^
 +| < 625 (Low)           | 1        | 1     |
 +| >= 625 (Med)          | 1        | 2     |
 +| >= 1250 (High)        | 1        | 3     |
 +| >= 1775 (Max)         | 1        | 4     |
 +
 +** Unoccupied Colonists Modifiers **
 +
 +From `UNOC_*` in morale.txt.
 +
 +^ Unoccupied Colonist % ^ Modifier ^ Total ^
 +| >= 10% (Low)          | -1       | -1    |
 +| >= 30% (Med)          | -2       | -3    |
 +| >= 50% (High)         | -3       | -6    |
 +
 +** Scientists as Workers Modifiers **
 +
 +From `PHD_WHINE_*` in morale.txt.
 +
 +^ Scientists as Workers % ^ Modifier ^ Total ^
 +| >= 5% (Low)             | -1       | -1    |
 +| >= 20% (Med)            | -1       | -2    |
 +| >= 40% (High)           | -2       | -4    |
 +| >= 65% (Max)            | -3       | -7    |
 +
 +** Difficulty Scaling **
 +
 +**TODO**: Look into this more (`DIFF_*` in morale.txt).
 +
 +=== Event Morale ===
 +
 +As discussed above, as certain events happen in game, this will adjust the event morale accordingly:
 +
 +^ Event                               ^ `morale.txt` variable ^ Value ^
 +| Kid dies                            | `KID_DIES`            | -8    |
 +| Adult dies                          | `ADULT_DIES`          | -6    |
 +| Kid born                            | `KID_BORN`            | 2     |
 +| "Good" structure dies               | `GOOD_BUILD_DIES`     | -16   |
 +| Regular structure dies              | `REG_BUILD_DIES`      | -12   |
 +| Research completed                  | `NEW_TECH_BORN`       | 6     |
 +| Disaster spawns (tech unresearched) | `DISASTER_NO_WARN`    | -6    | 
 +| Disaster spawns (tech researched)   | `DISASTER_WARNED`     | -3    |
 +| Impulse Items produced              | `CONSUMER_GOODS_1`    | 8     |
 +| Wares produced                      | `CONSUMER_GOODS_2`    | 14    |
 +| Luxury Wares produced               | `CONSUMER_GOODS_3`    | 20    |
 +| "Good" enemy structure dies         | `ENEMY_GOOD_DIES`     | -800  |
 +| "Bad" enemy structure dies          | `ENEMY_BAD_DIES`      | 20    |
 +| Worker trained                      | `TECH_SCHOOL`         | 2     |
 +| Scientist trained                   | `PHD_TRAINED`         | 2     |
 +| Command Center built                | `CC_BORN`             | 10    |
 +
 +Notes on the above:
 +  * Which disaster modifier gets applied is based on which of the early-warning techs are researched (as described above)
 +  * "Good" structures are morale related buildings (e.g. Nursery, Residence, Medical Center)
 +    * **TODO**: is this an exhaustive list?
 +  * "Bad" structures are combat related buildings (e.g. Guard Post)
 +  * **TODO**: Are the worker and scientist trained events per-colonist or per-training?
 +  * The event morale is updated at the time the game processes the event, but the actual morale update is deferred until a morale processing cycle (every 256 ticks).
 +    * For this reason, morale changes from events stack without any limit.
  
 ==== Population Model ==== ==== Population Model ====
Line 166: Line 270:
 The colony population is updated every 32nd processing tick (256 ticks) for each human player.  AI players are forced to 4096 workers, 4096 scientists, and 256 kids. The colony population is updated every 32nd processing tick (256 ticks) for each human player.  AI players are forced to 4096 workers, 4096 scientists, and 256 kids.
  
-The following discussion makes use of M_FERT_RATE and M_DIE_RATE from morale.txt. M_FERT_RATE determines the rate at which new kids are born. The values are unintuitive: a lower value means a higher birth rate. M_DIE_RATE determines the rate at which people (kids, workers, and scientists) die. As uninituitively as before, a HIGHER value means a LOWER death rate.+The following discussion makes use of `M_FERT_RATEand `M_DIE_RATEfrom morale.txt. `M_FERT_RATEdetermines the rate at which new kids are born. The values are unintuitive:*lowervalue means a *higherbirth rate. `M_DIE_RATEdetermines the rate at which people (kids, workers, and scientists) die. As uninituitively as before, a HIGHER value means a LOWER death rate.
  
 === Medical Center Capacity === === Medical Center Capacity ===
  
-In addition, the "total med center capacity" below is the sum of the Production_Capacity (as defined in building.txt and upgraded by techs) of all active Medical Centers owned by the player.  This defaults to 50 for the base Medical Center and 75 with Automated Diagnostic Examinations.+In addition, the "total med center capacity" below is the sum of the `Production_Capacity(as defined in `building.txtand upgraded by techs) of all active Medical Centers owned by the player.  This defaults to 50 for the base Medical Center and 75 with Automated Diagnostic Examinations.
  
 === New Kids and Workers === === New Kids and Workers ===
Line 187: Line 291:
 </code> </code>
  
-As before, the remainder is stored and used in the next update to allow for fractional kid growth over time. M_FERT_RATE is a value defined in morale.txt for each morale level.+As before, the remainder is stored and used in the next update to allow for fractional kid growth over time. `M_FERT_RATEis a value defined at the top of morale.txt for each morale level.
  
 === Kid, Worker, and Scientist Deaths === === Kid, Worker, and Scientist Deaths ===
Line 196: Line 300:
 </code> </code>
  
-The remainder is stored for use in the next update, and total med center capacity is a previously computed value for each player.  In other words, Nurseries are assumed to have a capacity of 40 (note that this becomes fairly pointless once Med Centers are available as they lower death rate for all colonists and have a higher capacity, for the same upkeep in workers, scientists, and power).  M_DIE_RATE is a value from morale.txt based on the player's current morale level.+The remainder is stored for use in the next update, and total med center capacity is a previously computed value for each player.  In other words, Nurseries are assumed to have a capacity of 40 (note that this becomes fairly pointless once Med Centers are available as they lower death rate for all colonists and have a higher capacity, for the same upkeep in workers, scientists, and power).  `M_DIE_RATE` comes from morale.txt based on the player's current morale level.
  
 Worker and Scientist deaths (assuming there are any) are separately computed similarly using the formula below: Worker and Scientist deaths (assuming there are any) are separately computed similarly using the formula below:
Line 207: Line 311:
  
 Scientist training is not handled here, because that is something that is manually initiated at the University by the player. Scientist training is not handled here, because that is something that is manually initiated at the University by the player.
- 
-==== Strategy ==== 
- 
-  * Despite there being a "demand %" shown for Med Centers, having excess medical center capacity strictly lowers the death rate (at the cost of Scientists and power to run the medical centers).  Veteran OP2 players strive for 30-40% demand to give a decent reduction to death rate. 
-  * There is limited value in having more than 1 nursery and university: 
-    * Multiple nurseries do not increase birth rate, only decreasing kid death rate by providing 40 capacity for kids, but this is quickly obsoleted when Med Centers become available as they have a base capacity of 50, upgradeable to 75 (and apply to all colonists). 
-    * Mutliple universities do not increase worker training rate (though later in the game multiple universities would allow you to train more than 10 scientists at a time). 
-  * Birth rate and death rate are affected favorably by high morale, so it's in your best interest to keep morale reasonably high. 
  • outpost_2/concepts/population_and_morale.1698817638.txt.gz
  • Last modified: 2023/11/01 05:47
  • by blackbox222