Difference between revisions of "Nutrition (Stat)"

From RimWorld Wiki
Jump to navigation Jump to search
(Nutrition Stat)
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{Stub|reason=1) Version history 2) Two-way links}}
 
{{Stub|reason=1) Version history 2) Two-way links}}
 +
{{See also|Max Nutrition|Saturation|Food}}
 
{{Verified|1.5.4104}}{{Stat
 
{{Verified|1.5.4104}}{{Stat
 
| def name = Nutrition
 
| def name = Nutrition
Line 12: Line 13:
 
| parts = StatPart_BodySize, StatPart_NaturalNotMissingBodyPartsCoverage, StatPart_PlantGrowthNutritionFactor, StatPart_IsFlesh, StatPart_IsCorpseFresh
 
| parts = StatPart_BodySize, StatPart_NaturalNotMissingBodyPartsCoverage, StatPart_PlantGrowthNutritionFactor, StatPart_IsFlesh, StatPart_IsCorpseFresh
 
}}
 
}}
{{See also|Max Nutrition|Saturation|Food}}
 
  
 
== Stat Parts ==
 
== Stat Parts ==
Line 81: Line 81:
 
== Calculating Nutrition ==
 
== Calculating Nutrition ==
 
For Plants:
 
For Plants:
<code>'''Nutrition'' = '''Base Nutrition''' × '''Nutrition Factor From Growth'''</code>
+
<code>'''Nutrition''' = '''Base Nutrition''' × '''Nutrition Factor From Growth'''</code>
  
 
For Corpses:
 
For Corpses:
<code>'''Nutrition'' =  × '''Body Size''' × '''Coverage of Body Parts''' × '''Is Flesh''' × '''Is Corpse Fresh'''</code>
+
<code>'''Nutrition''' =  × '''Body Size''' × '''Coverage of Body Parts''' × '''Is Flesh''' × '''Is Corpse Fresh'''</code>
  
 
== Bases ==
 
== Bases ==
<div class="mw-collapsible">
+
{{Recode|section=1|reason=Uses manual and direct image calls instead of icon templates}}
 
=== Plants ===
 
=== Plants ===
 +
<div><li style="display: inline-table;">
 +
Click to <div class="mw-collapsible">
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
{| {{STDT| c_14 sortable}}
 
{| {{STDT| c_14 sortable}}
Line 308: Line 310:
 
</div>
 
</div>
 
</div>
 
</div>
 +
</li></div>
  
<div class="mw-collapsible">
 
 
=== Items ===
 
=== Items ===
 +
<div><li style="display: inline-table;">
 +
Click to <div class="mw-collapsible">
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
{| {{STDT| c_08 sortable}}
 
{| {{STDT| c_08 sortable}}
Line 481: Line 485:
 
</div>
 
</div>
 
</div>
 
</div>
 +
</li></div>
  
 
=== Pawns ===
 
=== Pawns ===
==== Life Stage Factors ====
 
{| {{STDT| c_01 sortable}}
 
! Life Stage !! Body Size Factor !! Food Max Factor !! Max Food
 
|-
 
| Baby || 0.2 || 0.625 || 0.125 <!-- bodySizeFactor * foodMaxFactor = maxFood = 0.125 -->
 
|-
 
| Child || 0.35 || 2.286 || 0.8 <!-- bodySizeFactor * foodMaxFactor = maxFood = 0.8 -->
 
|-
 
| Teenager || 0.8 || 1.25 || 1 <!-- bodySizeFactor * foodMaxFactor = maxFood = 1.0 -->
 
|-
 
| Larva (Insect) || 0.2 || 2 || 0.4
 
|-
 
| Immature (Insect) || 0.5 || 1.5 || 0.75
 
|-
 
| Baby (Animal) || 0.2 || 3 || 0.6
 
|-
 
| Baby (Tiny Animal) || 0.1 || 6 || 0.6
 
|-
 
| Juvenile (Animal) || 0.5 || 1.5 || 0.75
 
|-
 
| Preteen {{BiotechIcon}} || 0.7 || 1.552 || 0.9 <!-- bodySizeFactor * foodMaxFactor = maxFood = 0.9 -->
 
|}
 
 
<div class="mw-collapsible">
 
 
==== Body Size ====
 
==== Body Size ====
 +
<div><li style="display: inline-table;">
 +
Click to <div class="mw-collapsible">
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
{| {{STDT| c_01 sortable}}
 
{| {{STDT| c_01 sortable}}
Line 809: Line 792:
 
</div>
 
</div>
 
</div>
 
</div>
 +
</li></div>
 +
 +
== Factors ==
 +
=== Lifestage ===
 +
<div><li style="display: inline-table;">
 +
{| {{STDT| c_01 sortable}}
 +
! Life Stage !! Body Size Factor !! Food Max Factor !! Max Food
 +
|-
 +
| Baby || 0.2 || 0.625 || 0.125 <!-- bodySizeFactor * foodMaxFactor = maxFood = 0.125 -->
 +
|-
 +
| Child || 0.35 || 2.286 || 0.8 <!-- bodySizeFactor * foodMaxFactor = maxFood = 0.8 -->
 +
|-
 +
| Teenager || 0.8 || 1.25 || 1 <!-- bodySizeFactor * foodMaxFactor = maxFood = 1.0 -->
 +
|-
 +
| Larva (Insect) || 0.2 || 2 || 0.4
 +
|-
 +
| Immature (Insect) || 0.5 || 1.5 || 0.75
 +
|-
 +
| Baby (Animal) || 0.2 || 3 || 0.6
 +
|-
 +
| Baby (Tiny Animal) || 0.1 || 6 || 0.6
 +
|-
 +
| Juvenile (Animal) || 0.5 || 1.5 || 0.75
 +
|-
 +
| Preteen {{BiotechIcon}} || 0.7 || 1.552 || 0.9 <!-- bodySizeFactor * foodMaxFactor = maxFood = 0.9 -->
 +
|}
 +
</li></div>
  
 
== Stat Def Data ==
 
== Stat Def Data ==

Latest revision as of 10:05, 11 November 2024

Nutrition (Stat) is a stat: How nutritious this food is. Its minimum allowed value is 0. Its default value is 0.

Stat Parts[edit]

Body Size[edit]

Nutrition = Nutrition × Body Size

Body Size Factor is determined by the lifestage of a pawn. This value is 1 by default for most adult / fully formed pawns, or for those with only one applicable lifestage: resulting in no impact to nutrition.

Base Body Size is determined by the race of a pawn: Humans have a base body size of 1.

These are the 2 factors for calculating the resulting pawn's body size:

Body Size = Body Size Factor × Base Body Size

Natural Not Missing Body Parts Coverage[edit]

Nutrition = Nutrition × Coverage of Intact Natural Body Parts

Coverage of Intact Natural Body Parts = Coverage of Body Parts - Coverage of Missing Natural Body Parts

Plant Growth Nutrition Factor[edit]

Nutrition = Nutrition × Nutrition Factor From Growth

Plant Growth is a value ranging from 0~1: by default it is 0.15, or 15%.

Nutrition Factor From Growth is a multiplier on nutrition gained from plants, based on Plant Growth.

For sowable plants:

Nutrition Factor From Growth = Plant Growth

For non-sowable plants:

Nutrition Factor From Growth = 0.5 + 0.5 × Plant Growth

Is Flesh[edit]

Nutrition = Nutrition × Is Flesh

Is Flesh is determined by whether or not the flesh type of a pawn's race is organic.

If the flesh type is organic: Is Flesh = 1

If the flesh type is not organic:

Is Flesh = 0

In other words: organic pawns have nutrition, and non organic pawns do not. Organic flesh types include Normal, Insectoid, Entity Flesh Content added by the Anomaly DLC, and Fleshbeast Content added by the Anomaly DLC: i.e. Humans, all Animals, Insectoids, and Fleshbeasts Content added by the Anomaly DLC, Sightstealers Content added by the Anomaly DLC, Noctols Content added by the Anomaly DLC, Fleshmass nuclei Content added by the Anomaly DLC, Gorehulks Content added by the Anomaly DLC, Devourers Content added by the Anomaly DLC, and Chimeras Content added by the Anomaly DLC. Non organic flesh types include: Mechanoid and Entity Mechanical Content added by the Anomaly DLC: i.e. all Mechanoids, and Nociospheres Content added by the Anomaly DLC, Metalhorrors Content added by the Anomaly DLC, and Revenants Content added by the Anomaly DLC.

Is Corpse Fresh[edit]

Nutrition = Nutrition × Is Corpse Fresh Is Corpse Fresh is determined by the rot stage of a corpse. The three stages are:

  • Fresh
  • Rotting
  • Dessicated

If the rot stage is fresh:

Is Corpse Fresh = 1

Otherwise:

Is Corpse Fresh = 0

If a corpse is not rottable, then it is always considered fresh (e.g. Unnatural corpses Content added by the Anomaly DLC).

In other words: fresh corpses have nutrition, and rotting or dessicated corpses do not.

Calculating Nutrition[edit]

For Plants: Nutrition = Base Nutrition × Nutrition Factor From Growth

For Corpses: Nutrition = × Body Size × Coverage of Body Parts × Is Flesh × Is Corpse Fresh

Bases[edit]

Plants[edit]

  • Click to
  • Items[edit]

  • Click to
  • Pawns[edit]

    Body Size[edit]

  • Click to
  • Factors[edit]

    Lifestage[edit]

  • Life Stage Body Size Factor Food Max Factor Max Food
    Baby 0.2 0.625 0.125
    Child 0.35 2.286 0.8
    Teenager 0.8 1.25 1
    Larva (Insect) 0.2 2 0.4
    Immature (Insect) 0.5 1.5 0.75
    Baby (Animal) 0.2 3 0.6
    Baby (Tiny Animal) 0.1 6 0.6
    Juvenile (Animal) 0.5 1.5 0.75
    Preteen Content added by the Biotech DLC 0.7 1.552 0.9
  • Stat Def Data[edit]

    Def Name
    Label
    Label For Full Stat List
    Offset Label
    Attributes
    Description Category Parameters Complex
    Parameters
    Display
    Priority
    In
    Category
    • Def Name:
      Nutrition
    • Label:
      nutrition
    How nutritious this food is.
    • Display Order:
      2
    • Def Name:
      BasicsNonPawnImportant
    • Label:
      Basics
    • Display All By Default:
      false
    • Default Base Value: 0
    • Min Value: 0
    • Show If Undefined: false
    • To String Style: FloatTwo
    • Parts:
      • StatPart_BodySize
      • StatPart_NaturalNotMissingBodyPartsCoverage
      • StatPart_PlantGrowthNutritionFactor
      • StatPart_IsFlesh
      • StatPart_IsCorpseFresh
    3000